From 12c669fd831db891a86a38afca1ef3476a029caa Mon Sep 17 00:00:00 2001 From: Sean McGrail Date: Tue, 17 Nov 2020 14:40:27 -0800 Subject: [PATCH] Regenerated Clients --- .../awsrestjson/api_op_JsonMaps.go | 4 +- .../awsrestjson/api_op_JsonMaps_test.go | 12 +-- .../protocoltest/awsrestjson/deserializers.go | 13 ++- .../protocoltest/awsrestjson/endpoints.go | 5 +- .../protocoltest/awsrestjson/serializers.go | 9 +- .../protocoltest/awsrestjson/types/enums.go | 10 +- internal/protocoltest/ec2query/endpoints.go | 5 +- internal/protocoltest/ec2query/types/enums.go | 10 +- internal/protocoltest/jsonrpc/endpoints.go | 5 +- internal/protocoltest/jsonrpc/types/enums.go | 10 +- internal/protocoltest/jsonrpc10/endpoints.go | 5 +- .../protocoltest/jsonrpc10/types/enums.go | 10 +- internal/protocoltest/query/endpoints.go | 5 +- internal/protocoltest/query/types/enums.go | 10 +- internal/protocoltest/restxml/endpoints.go | 5 +- internal/protocoltest/restxml/types/enums.go | 10 +- .../api_op_ListAnalyzedResources.go | 83 +++++++++++++++++ .../accessanalyzer/api_op_ListAnalyzers.go | 81 ++++++++++++++++ .../accessanalyzer/api_op_ListArchiveRules.go | 82 ++++++++++++++++ service/accessanalyzer/api_op_ListFindings.go | 81 ++++++++++++++++ service/accessanalyzer/endpoints.go | 5 +- service/acm/api_op_ListCertificates.go | 85 +++++++++++++++++ service/acm/endpoints.go | 5 +- .../api_op_ListCertificateAuthorities.go | 87 +++++++++++++++++ service/acmpca/api_op_ListPermissions.go | 85 +++++++++++++++++ service/acmpca/api_op_ListTags.go | 84 +++++++++++++++++ service/acmpca/endpoints.go | 5 +- .../api_op_ListBusinessReportSchedules.go | 84 +++++++++++++++++ .../api_op_ListConferenceProviders.go | 84 +++++++++++++++++ .../api_op_ListDeviceEvents.go | 84 +++++++++++++++++ .../api_op_ListGatewayGroups.go | 82 ++++++++++++++++ .../alexaforbusiness/api_op_ListGateways.go | 81 ++++++++++++++++ service/alexaforbusiness/api_op_ListSkills.go | 83 +++++++++++++++++ .../api_op_ListSkillsStoreCategories.go | 84 +++++++++++++++++ .../api_op_ListSkillsStoreSkillsByCategory.go | 84 +++++++++++++++++ .../api_op_ListSmartHomeAppliances.go | 84 +++++++++++++++++ service/alexaforbusiness/api_op_ListTags.go | 83 +++++++++++++++++ .../api_op_SearchAddressBooks.go | 85 +++++++++++++++++ .../alexaforbusiness/api_op_SearchContacts.go | 84 +++++++++++++++++ .../alexaforbusiness/api_op_SearchDevices.go | 83 +++++++++++++++++ .../api_op_SearchNetworkProfiles.go | 85 +++++++++++++++++ .../alexaforbusiness/api_op_SearchProfiles.go | 84 +++++++++++++++++ .../alexaforbusiness/api_op_SearchRooms.go | 83 +++++++++++++++++ .../api_op_SearchSkillGroups.go | 84 +++++++++++++++++ .../alexaforbusiness/api_op_SearchUsers.go | 83 +++++++++++++++++ service/alexaforbusiness/endpoints.go | 5 +- service/amplify/endpoints.go | 5 +- service/apigateway/api_op_GetApiKeys.go | 82 ++++++++++++++++ .../apigateway/api_op_GetBasePathMappings.go | 84 +++++++++++++++++ .../api_op_GetClientCertificates.go | 84 +++++++++++++++++ service/apigateway/api_op_GetDeployments.go | 83 +++++++++++++++++ service/apigateway/api_op_GetDomainNames.go | 83 +++++++++++++++++ service/apigateway/api_op_GetModels.go | 82 ++++++++++++++++ service/apigateway/api_op_GetResources.go | 82 ++++++++++++++++ service/apigateway/api_op_GetRestApis.go | 82 ++++++++++++++++ service/apigateway/api_op_GetUsage.go | 82 ++++++++++++++++ service/apigateway/api_op_GetUsagePlanKeys.go | 83 +++++++++++++++++ service/apigateway/api_op_GetUsagePlans.go | 82 ++++++++++++++++ service/apigateway/api_op_GetVpcLinks.go | 82 ++++++++++++++++ service/apigateway/endpoints.go | 5 +- service/apigatewaymanagementapi/endpoints.go | 5 +- service/apigatewayv2/endpoints.go | 5 +- service/appconfig/api_op_ListApplications.go | 83 +++++++++++++++++ .../api_op_ListConfigurationProfiles.go | 85 +++++++++++++++++ .../api_op_ListDeploymentStrategies.go | 85 +++++++++++++++++ service/appconfig/api_op_ListDeployments.go | 83 +++++++++++++++++ service/appconfig/api_op_ListEnvironments.go | 83 +++++++++++++++++ .../api_op_ListHostedConfigurationVersions.go | 85 +++++++++++++++++ service/appconfig/endpoints.go | 5 +- .../api_op_DescribeConnectorProfiles.go | 85 +++++++++++++++++ service/appflow/api_op_DescribeConnectors.go | 76 +++++++++++++++ .../api_op_DescribeFlowExecutionRecords.go | 85 +++++++++++++++++ service/appflow/api_op_ListFlows.go | 81 ++++++++++++++++ service/appflow/endpoints.go | 5 +- .../api_op_DescribeScalableTargets.go | 89 ++++++++++++++++++ .../api_op_DescribeScalingActivities.go | 89 ++++++++++++++++++ .../api_op_DescribeScalingPolicies.go | 89 ++++++++++++++++++ .../api_op_DescribeScheduledActions.go | 89 ++++++++++++++++++ service/applicationautoscaling/endpoints.go | 5 +- .../api_op_DescribeContinuousExports.go | 85 +++++++++++++++++ .../api_op_DescribeImportTasks.go | 83 +++++++++++++++++ .../applicationdiscoveryservice/endpoints.go | 5 +- .../api_op_ListApplications.go | 83 +++++++++++++++++ .../api_op_ListComponents.go | 83 +++++++++++++++++ .../api_op_ListConfigurationHistory.go | 89 ++++++++++++++++++ .../api_op_ListLogPatternSets.go | 84 +++++++++++++++++ .../api_op_ListLogPatterns.go | 83 +++++++++++++++++ .../api_op_ListProblems.go | 82 ++++++++++++++++ service/applicationinsights/endpoints.go | 5 +- service/appmesh/api_op_ListGatewayRoutes.go | 88 ++++++++++++++++++ service/appmesh/api_op_ListMeshes.go | 87 +++++++++++++++++ service/appmesh/api_op_ListRoutes.go | 87 +++++++++++++++++ service/appmesh/api_op_ListTagsForResource.go | 89 ++++++++++++++++++ service/appmesh/api_op_ListVirtualGateways.go | 89 ++++++++++++++++++ service/appmesh/api_op_ListVirtualNodes.go | 88 ++++++++++++++++++ service/appmesh/api_op_ListVirtualRouters.go | 89 ++++++++++++++++++ service/appmesh/api_op_ListVirtualServices.go | 89 ++++++++++++++++++ service/appmesh/endpoints.go | 5 +- .../api_op_DescribeImagePermissions.go | 84 +++++++++++++++++ service/appstream/api_op_DescribeImages.go | 82 ++++++++++++++++ service/appstream/endpoints.go | 5 +- service/appsync/endpoints.go | 5 +- service/athena/api_op_GetQueryResults.go | 82 ++++++++++++++++ service/athena/api_op_ListDataCatalogs.go | 82 ++++++++++++++++ service/athena/api_op_ListDatabases.go | 81 ++++++++++++++++ service/athena/api_op_ListNamedQueries.go | 82 ++++++++++++++++ service/athena/api_op_ListQueryExecutions.go | 83 +++++++++++++++++ service/athena/api_op_ListTableMetadata.go | 82 ++++++++++++++++ service/athena/api_op_ListTagsForResource.go | 84 +++++++++++++++++ service/athena/api_op_ListWorkGroups.go | 82 ++++++++++++++++ service/athena/endpoints.go | 5 +- .../api_op_DescribeAutoScalingGroups.go | 85 +++++++++++++++++ .../api_op_DescribeAutoScalingInstances.go | 85 +++++++++++++++++ .../api_op_DescribeLaunchConfigurations.go | 85 +++++++++++++++++ ...i_op_DescribeNotificationConfigurations.go | 85 +++++++++++++++++ .../autoscaling/api_op_DescribePolicies.go | 83 +++++++++++++++++ .../api_op_DescribeScalingActivities.go | 85 +++++++++++++++++ .../api_op_DescribeScheduledActions.go | 85 +++++++++++++++++ service/autoscaling/api_op_DescribeTags.go | 82 ++++++++++++++++ service/autoscaling/endpoints.go | 5 +- service/autoscalingplans/endpoints.go | 5 +- service/backup/api_op_ListBackupJobs.go | 82 ++++++++++++++++ .../backup/api_op_ListBackupPlanTemplates.go | 84 +++++++++++++++++ .../backup/api_op_ListBackupPlanVersions.go | 83 +++++++++++++++++ service/backup/api_op_ListBackupPlans.go | 82 ++++++++++++++++ service/backup/api_op_ListBackupSelections.go | 83 +++++++++++++++++ service/backup/api_op_ListBackupVaults.go | 82 ++++++++++++++++ service/backup/api_op_ListCopyJobs.go | 81 ++++++++++++++++ .../backup/api_op_ListProtectedResources.go | 83 +++++++++++++++++ .../api_op_ListRecoveryPointsByBackupVault.go | 84 +++++++++++++++++ .../api_op_ListRecoveryPointsByResource.go | 84 +++++++++++++++++ service/backup/api_op_ListRestoreJobs.go | 82 ++++++++++++++++ service/backup/api_op_ListTags.go | 81 ++++++++++++++++ service/backup/endpoints.go | 5 +- .../api_op_DescribeComputeEnvironments.go | 91 ++++++++++++++++++ .../batch/api_op_DescribeJobDefinitions.go | 89 ++++++++++++++++++ service/batch/api_op_DescribeJobQueues.go | 88 ++++++++++++++++++ service/batch/api_op_ListJobs.go | 87 +++++++++++++++++ service/batch/endpoints.go | 5 +- service/braket/api_op_SearchDevices.go | 81 ++++++++++++++++ service/braket/api_op_SearchQuantumTasks.go | 83 +++++++++++++++++ service/braket/endpoints.go | 5 +- .../api_op_DescribeBudgetActionHistories.go | 85 +++++++++++++++++ .../api_op_DescribeBudgetActionsForAccount.go | 85 +++++++++++++++++ .../api_op_DescribeBudgetActionsForBudget.go | 85 +++++++++++++++++ service/budgets/api_op_DescribeBudgets.go | 83 +++++++++++++++++ .../api_op_DescribeNotificationsForBudget.go | 85 +++++++++++++++++ ...i_op_DescribeSubscribersForNotification.go | 85 +++++++++++++++++ service/budgets/endpoints.go | 5 +- service/chime/api_op_ListAccounts.go | 81 ++++++++++++++++ service/chime/api_op_ListAttendees.go | 81 ++++++++++++++++ service/chime/api_op_ListBots.go | 81 ++++++++++++++++ service/chime/api_op_ListMeetings.go | 81 ++++++++++++++++ service/chime/api_op_ListPhoneNumberOrders.go | 83 +++++++++++++++++ service/chime/api_op_ListPhoneNumbers.go | 82 ++++++++++++++++ service/chime/api_op_ListProxySessions.go | 82 ++++++++++++++++ service/chime/api_op_ListRoomMemberships.go | 83 +++++++++++++++++ service/chime/api_op_ListRooms.go | 81 ++++++++++++++++ service/chime/api_op_ListUsers.go | 81 ++++++++++++++++ .../chime/api_op_ListVoiceConnectorGroups.go | 84 +++++++++++++++++ service/chime/api_op_ListVoiceConnectors.go | 83 +++++++++++++++++ service/chime/endpoints.go | 5 +- .../api_op_DescribeEnvironmentMemberships.go | 84 +++++++++++++++++ service/cloud9/api_op_ListEnvironments.go | 82 ++++++++++++++++ service/cloud9/endpoints.go | 5 +- .../api_op_ListAppliedSchemaArns.go | 83 +++++++++++++++++ .../api_op_ListAttachedIndices.go | 83 +++++++++++++++++ .../api_op_ListDevelopmentSchemaArns.go | 84 +++++++++++++++++ .../clouddirectory/api_op_ListDirectories.go | 82 ++++++++++++++++ .../api_op_ListFacetAttributes.go | 83 +++++++++++++++++ .../clouddirectory/api_op_ListFacetNames.go | 82 ++++++++++++++++ service/clouddirectory/api_op_ListIndex.go | 83 +++++++++++++++++ .../api_op_ListManagedSchemaArns.go | 83 +++++++++++++++++ .../api_op_ListObjectAttributes.go | 84 +++++++++++++++++ .../api_op_ListObjectChildren.go | 84 +++++++++++++++++ .../api_op_ListObjectParentPaths.go | 84 +++++++++++++++++ .../api_op_ListObjectParents.go | 83 +++++++++++++++++ .../api_op_ListObjectPolicies.go | 84 +++++++++++++++++ .../api_op_ListPolicyAttachments.go | 84 +++++++++++++++++ .../api_op_ListPublishedSchemaArns.go | 84 +++++++++++++++++ .../api_op_ListTagsForResource.go | 84 +++++++++++++++++ .../api_op_ListTypedLinkFacetAttributes.go | 84 +++++++++++++++++ .../api_op_ListTypedLinkFacetNames.go | 84 +++++++++++++++++ service/clouddirectory/api_op_LookupPolicy.go | 82 ++++++++++++++++ service/clouddirectory/endpoints.go | 5 +- .../api_op_DescribeAccountLimits.go | 76 +++++++++++++++ .../api_op_DescribeStackEvents.go | 76 +++++++++++++++ .../api_op_DescribeStackResourceDrifts.go | 87 +++++++++++++++++ .../cloudformation/api_op_DescribeStacks.go | 75 +++++++++++++++ .../cloudformation/api_op_ListChangeSets.go | 75 +++++++++++++++ service/cloudformation/api_op_ListExports.go | 74 +++++++++++++++ service/cloudformation/api_op_ListImports.go | 74 +++++++++++++++ .../api_op_ListStackInstances.go | 86 +++++++++++++++++ .../api_op_ListStackResources.go | 76 +++++++++++++++ .../api_op_ListStackSetOperationResults.go | 87 +++++++++++++++++ .../api_op_ListStackSetOperations.go | 86 +++++++++++++++++ .../cloudformation/api_op_ListStackSets.go | 84 +++++++++++++++++ service/cloudformation/api_op_ListStacks.go | 74 +++++++++++++++ .../api_op_ListTypeRegistrations.go | 86 +++++++++++++++++ .../cloudformation/api_op_ListTypeVersions.go | 85 +++++++++++++++++ service/cloudformation/api_op_ListTypes.go | 84 +++++++++++++++++ service/cloudformation/endpoints.go | 5 +- service/cloudfront/endpoints.go | 5 +- service/cloudhsm/endpoints.go | 5 +- service/cloudhsmv2/api_op_DescribeBackups.go | 83 +++++++++++++++++ service/cloudhsmv2/api_op_DescribeClusters.go | 83 +++++++++++++++++ service/cloudhsmv2/api_op_ListTags.go | 82 ++++++++++++++++ service/cloudhsmv2/endpoints.go | 5 +- service/cloudsearch/endpoints.go | 5 +- service/cloudsearchdomain/endpoints.go | 5 +- service/cloudtrail/api_op_ListPublicKeys.go | 75 +++++++++++++++ service/cloudtrail/api_op_ListTags.go | 74 +++++++++++++++ service/cloudtrail/api_op_ListTrails.go | 74 +++++++++++++++ service/cloudtrail/api_op_LookupEvents.go | 82 ++++++++++++++++ service/cloudtrail/endpoints.go | 5 +- .../cloudwatch/api_op_DescribeAlarmHistory.go | 83 +++++++++++++++++ service/cloudwatch/api_op_DescribeAlarms.go | 82 ++++++++++++++++ .../cloudwatch/api_op_DescribeInsightRules.go | 84 +++++++++++++++++ service/cloudwatch/api_op_GetMetricData.go | 82 ++++++++++++++++ service/cloudwatch/api_op_ListDashboards.go | 75 +++++++++++++++ service/cloudwatch/api_op_ListMetrics.go | 74 +++++++++++++++ service/cloudwatch/endpoints.go | 5 +- service/cloudwatchevents/endpoints.go | 5 +- .../api_op_DescribeDestinations.go | 84 +++++++++++++++++ .../api_op_DescribeLogGroups.go | 83 +++++++++++++++++ .../api_op_DescribeLogStreams.go | 84 +++++++++++++++++ .../api_op_DescribeMetricFilters.go | 84 +++++++++++++++++ .../api_op_DescribeSubscriptionFilters.go | 85 +++++++++++++++++ .../cloudwatchlogs/api_op_FilterLogEvents.go | 82 ++++++++++++++++ service/cloudwatchlogs/api_op_GetLogEvents.go | 83 +++++++++++++++++ service/cloudwatchlogs/endpoints.go | 5 +- service/codeartifact/api_op_ListDomains.go | 81 ++++++++++++++++ .../api_op_ListPackageVersionAssets.go | 84 +++++++++++++++++ .../api_op_ListPackageVersions.go | 83 +++++++++++++++++ service/codeartifact/api_op_ListPackages.go | 81 ++++++++++++++++ .../codeartifact/api_op_ListRepositories.go | 82 ++++++++++++++++ .../api_op_ListRepositoriesInDomain.go | 84 +++++++++++++++++ service/codeartifact/endpoints.go | 5 +- .../codebuild/api_op_DescribeCodeCoverages.go | 83 +++++++++++++++++ service/codebuild/api_op_DescribeTestCases.go | 84 +++++++++++++++++ service/codebuild/api_op_ListBuildBatches.go | 82 ++++++++++++++++ .../api_op_ListBuildBatchesForProject.go | 84 +++++++++++++++++ service/codebuild/api_op_ListBuilds.go | 74 +++++++++++++++ .../codebuild/api_op_ListBuildsForProject.go | 76 +++++++++++++++ service/codebuild/api_op_ListProjects.go | 74 +++++++++++++++ service/codebuild/api_op_ListReportGroups.go | 84 +++++++++++++++++ service/codebuild/api_op_ListReports.go | 82 ++++++++++++++++ .../api_op_ListReportsForReportGroup.go | 86 +++++++++++++++++ .../codebuild/api_op_ListSharedProjects.go | 85 +++++++++++++++++ .../api_op_ListSharedReportGroups.go | 85 +++++++++++++++++ service/codebuild/endpoints.go | 5 +- .../api_op_DescribeMergeConflicts.go | 83 +++++++++++++++++ .../api_op_DescribePullRequestEvents.go | 86 +++++++++++++++++ .../codecommit/api_op_GetCommentReactions.go | 84 +++++++++++++++++ .../api_op_GetCommentsForComparedCommit.go | 85 +++++++++++++++++ .../api_op_GetCommentsForPullRequest.go | 86 +++++++++++++++++ service/codecommit/api_op_GetDifferences.go | 82 ++++++++++++++++ .../codecommit/api_op_GetMergeConflicts.go | 82 ++++++++++++++++ .../api_op_ListApprovalRuleTemplates.go | 84 +++++++++++++++++ ...iatedApprovalRuleTemplatesForRepository.go | 85 +++++++++++++++++ service/codecommit/api_op_ListBranches.go | 74 +++++++++++++++ service/codecommit/api_op_ListPullRequests.go | 82 ++++++++++++++++ service/codecommit/api_op_ListRepositories.go | 75 +++++++++++++++ ...ListRepositoriesForApprovalRuleTemplate.go | 84 +++++++++++++++++ service/codecommit/endpoints.go | 5 +- .../api_op_ListApplicationRevisions.go | 77 +++++++++++++++ service/codedeploy/api_op_ListApplications.go | 75 +++++++++++++++ .../api_op_ListDeploymentConfigs.go | 76 +++++++++++++++ .../codedeploy/api_op_ListDeploymentGroups.go | 76 +++++++++++++++ .../api_op_ListDeploymentInstances.go | 77 +++++++++++++++ service/codedeploy/api_op_ListDeployments.go | 75 +++++++++++++++ service/codedeploy/endpoints.go | 5 +- .../api_op_ListProfileTimes.go | 86 +++++++++++++++++ .../api_op_ListProfilingGroups.go | 87 +++++++++++++++++ service/codeguruprofiler/endpoints.go | 5 +- .../api_op_ListCodeReviews.go | 82 ++++++++++++++++ .../api_op_ListRecommendationFeedback.go | 84 +++++++++++++++++ .../api_op_ListRecommendations.go | 83 +++++++++++++++++ .../api_op_ListRepositoryAssociations.go | 91 ++++++++++++++++++ service/codegurureviewer/endpoints.go | 5 +- .../api_op_ListActionExecutions.go | 87 +++++++++++++++++ .../codepipeline/api_op_ListActionTypes.go | 75 +++++++++++++++ .../api_op_ListPipelineExecutions.go | 86 +++++++++++++++++ service/codepipeline/api_op_ListPipelines.go | 74 +++++++++++++++ .../api_op_ListTagsForResource.go | 83 +++++++++++++++++ service/codepipeline/api_op_ListWebhooks.go | 82 ++++++++++++++++ service/codepipeline/endpoints.go | 5 +- service/codestar/endpoints.go | 5 +- .../api_op_ListConnections.go | 83 +++++++++++++++++ .../codestarconnections/api_op_ListHosts.go | 82 ++++++++++++++++ service/codestarconnections/endpoints.go | 5 +- .../api_op_ListEventTypes.go | 83 +++++++++++++++++ .../api_op_ListNotificationRules.go | 84 +++++++++++++++++ .../api_op_ListTargets.go | 82 ++++++++++++++++ service/codestarnotifications/endpoints.go | 5 +- service/cognitoidentity/endpoints.go | 5 +- .../api_op_AdminListGroupsForUser.go | 83 +++++++++++++++++ .../api_op_AdminListUserAuthEvents.go | 84 +++++++++++++++++ .../api_op_ListGroups.go | 81 ++++++++++++++++ .../api_op_ListIdentityProviders.go | 83 +++++++++++++++++ .../api_op_ListResourceServers.go | 83 +++++++++++++++++ .../api_op_ListUserPoolClients.go | 84 +++++++++++++++++ .../api_op_ListUsers.go | 81 ++++++++++++++++ .../api_op_ListUsersInGroup.go | 82 ++++++++++++++++ service/cognitoidentityprovider/endpoints.go | 5 +- service/cognitosync/endpoints.go | 5 +- .../api_op_ListDocumentClassificationJobs.go | 84 +++++++++++++++++ .../api_op_ListDocumentClassifiers.go | 84 +++++++++++++++++ ...pi_op_ListDominantLanguageDetectionJobs.go | 84 +++++++++++++++++ .../api_op_ListEntitiesDetectionJobs.go | 84 +++++++++++++++++ .../api_op_ListEntityRecognizers.go | 83 +++++++++++++++++ .../api_op_ListKeyPhrasesDetectionJobs.go | 84 +++++++++++++++++ .../api_op_ListSentimentDetectionJobs.go | 84 +++++++++++++++++ .../api_op_ListTopicsDetectionJobs.go | 84 +++++++++++++++++ service/comprehend/endpoints.go | 5 +- service/comprehendmedical/endpoints.go | 5 +- service/computeoptimizer/endpoints.go | 5 +- .../api_op_DescribeRemediationExceptions.go | 85 +++++++++++++++++ ...i_op_DescribeRemediationExecutionStatus.go | 85 +++++++++++++++++ .../api_op_GetResourceConfigHistory.go | 86 +++++++++++++++++ .../api_op_SelectAggregateResourceConfig.go | 85 +++++++++++++++++ service/configservice/endpoints.go | 5 +- .../connect/api_op_GetCurrentMetricData.go | 83 +++++++++++++++++ service/connect/api_op_GetMetricData.go | 81 ++++++++++++++++ service/connect/api_op_ListContactFlows.go | 82 ++++++++++++++++ .../connect/api_op_ListHoursOfOperations.go | 83 +++++++++++++++++ service/connect/api_op_ListPhoneNumbers.go | 82 ++++++++++++++++ service/connect/api_op_ListPrompts.go | 81 ++++++++++++++++ service/connect/api_op_ListQueues.go | 81 ++++++++++++++++ .../api_op_ListRoutingProfileQueues.go | 84 +++++++++++++++++ service/connect/api_op_ListRoutingProfiles.go | 83 +++++++++++++++++ .../connect/api_op_ListSecurityProfiles.go | 83 +++++++++++++++++ .../connect/api_op_ListUserHierarchyGroups.go | 84 +++++++++++++++++ service/connect/api_op_ListUsers.go | 81 ++++++++++++++++ service/connect/endpoints.go | 5 +- .../api_op_GetTranscript.go | 81 ++++++++++++++++ service/connectparticipant/endpoints.go | 5 +- .../api_op_DescribeReportDefinitions.go | 84 +++++++++++++++++ .../costandusagereportservice/endpoints.go | 5 +- .../api_op_GetSavingsPlansCoverage.go | 85 +++++++++++++++++ ...pi_op_GetSavingsPlansUtilizationDetails.go | 85 +++++++++++++++++ .../api_op_ListCostCategoryDefinitions.go | 84 +++++++++++++++++ service/costexplorer/endpoints.go | 5 +- ...DescribeApplicableIndividualAssessments.go | 86 +++++++++++++++++ .../api_op_DescribeCertificates.go | 86 +++++++++++++++++ .../api_op_DescribeConnections.go | 86 +++++++++++++++++ .../api_op_DescribeEndpointTypes.go | 86 +++++++++++++++++ .../api_op_DescribeEndpoints.go | 85 +++++++++++++++++ .../api_op_DescribeEventSubscriptions.go | 87 +++++++++++++++++ .../api_op_DescribeEvents.go | 85 +++++++++++++++++ ...p_DescribeOrderableReplicationInstances.go | 87 +++++++++++++++++ ...pi_op_DescribePendingMaintenanceActions.go | 87 +++++++++++++++++ ..._op_DescribeReplicationInstanceTaskLogs.go | 87 +++++++++++++++++ .../api_op_DescribeReplicationInstances.go | 87 +++++++++++++++++ .../api_op_DescribeReplicationSubnetGroups.go | 87 +++++++++++++++++ ...escribeReplicationTaskAssessmentResults.go | 87 +++++++++++++++++ ...p_DescribeReplicationTaskAssessmentRuns.go | 86 +++++++++++++++++ ...ibeReplicationTaskIndividualAssessments.go | 86 +++++++++++++++++ .../api_op_DescribeReplicationTasks.go | 87 +++++++++++++++++ .../api_op_DescribeSchemas.go | 85 +++++++++++++++++ .../api_op_DescribeTableStatistics.go | 87 +++++++++++++++++ service/databasemigrationservice/endpoints.go | 5 +- .../api_op_ListDataSetRevisions.go | 83 +++++++++++++++++ service/dataexchange/api_op_ListDataSets.go | 81 ++++++++++++++++ service/dataexchange/api_op_ListJobs.go | 81 ++++++++++++++++ .../dataexchange/api_op_ListRevisionAssets.go | 83 +++++++++++++++++ service/dataexchange/endpoints.go | 5 +- .../datapipeline/api_op_DescribeObjects.go | 75 +++++++++++++++ service/datapipeline/api_op_ListPipelines.go | 74 +++++++++++++++ service/datapipeline/api_op_QueryObjects.go | 82 ++++++++++++++++ service/datapipeline/endpoints.go | 5 +- service/datasync/api_op_ListAgents.go | 81 ++++++++++++++++ service/datasync/api_op_ListLocations.go | 81 ++++++++++++++++ .../datasync/api_op_ListTagsForResource.go | 83 +++++++++++++++++ service/datasync/api_op_ListTaskExecutions.go | 83 +++++++++++++++++ service/datasync/api_op_ListTasks.go | 81 ++++++++++++++++ service/datasync/endpoints.go | 5 +- service/dax/endpoints.go | 5 +- service/detective/api_op_ListGraphs.go | 82 ++++++++++++++++ service/detective/api_op_ListInvitations.go | 84 +++++++++++++++++ service/detective/api_op_ListMembers.go | 83 +++++++++++++++++ service/detective/endpoints.go | 5 +- .../devicefarm/api_op_GetOfferingStatus.go | 75 +++++++++++++++ service/devicefarm/api_op_ListArtifacts.go | 74 +++++++++++++++ service/devicefarm/api_op_ListDevicePools.go | 75 +++++++++++++++ service/devicefarm/api_op_ListDevices.go | 74 +++++++++++++++ service/devicefarm/api_op_ListJobs.go | 74 +++++++++++++++ .../api_op_ListOfferingTransactions.go | 77 +++++++++++++++ service/devicefarm/api_op_ListOfferings.go | 74 +++++++++++++++ service/devicefarm/api_op_ListProjects.go | 74 +++++++++++++++ service/devicefarm/api_op_ListRuns.go | 74 +++++++++++++++ service/devicefarm/api_op_ListSamples.go | 74 +++++++++++++++ service/devicefarm/api_op_ListSuites.go | 74 +++++++++++++++ .../devicefarm/api_op_ListTestGridProjects.go | 83 +++++++++++++++++ .../api_op_ListTestGridSessionActions.go | 84 +++++++++++++++++ .../api_op_ListTestGridSessionArtifacts.go | 84 +++++++++++++++++ .../devicefarm/api_op_ListTestGridSessions.go | 83 +++++++++++++++++ service/devicefarm/api_op_ListTests.go | 74 +++++++++++++++ .../devicefarm/api_op_ListUniqueProblems.go | 76 +++++++++++++++ service/devicefarm/api_op_ListUploads.go | 74 +++++++++++++++ service/devicefarm/endpoints.go | 5 +- service/directconnect/endpoints.go | 5 +- .../api_op_DescribeDomainControllers.go | 84 +++++++++++++++++ service/directoryservice/endpoints.go | 5 +- service/dlm/endpoints.go | 5 +- service/docdb/api_op_DescribeCertificates.go | 90 ++++++++++++++++++ ...api_op_DescribeDBClusterParameterGroups.go | 87 +++++++++++++++++ .../api_op_DescribeDBClusterParameters.go | 87 +++++++++++++++++ .../api_op_DescribeDBClusterSnapshots.go | 87 +++++++++++++++++ service/docdb/api_op_DescribeDBClusters.go | 86 +++++++++++++++++ .../docdb/api_op_DescribeDBEngineVersions.go | 87 +++++++++++++++++ service/docdb/api_op_DescribeDBInstances.go | 86 +++++++++++++++++ .../docdb/api_op_DescribeDBSubnetGroups.go | 86 +++++++++++++++++ service/docdb/api_op_DescribeEvents.go | 85 +++++++++++++++++ ...i_op_DescribeOrderableDBInstanceOptions.go | 87 +++++++++++++++++ ...pi_op_DescribePendingMaintenanceActions.go | 87 +++++++++++++++++ service/docdb/endpoints.go | 5 +- .../api_op_ListContributorInsights.go | 84 +++++++++++++++++ service/dynamodb/api_op_ListTables.go | 82 ++++++++++++++++ service/dynamodb/endpoints.go | 5 +- service/dynamodbstreams/endpoints.go | 5 +- service/ebs/api_op_ListChangedBlocks.go | 82 ++++++++++++++++ service/ebs/api_op_ListSnapshotBlocks.go | 83 +++++++++++++++++ service/ebs/endpoints.go | 5 +- .../api_op_DescribeCapacityReservations.go | 87 +++++++++++++++++ service/ec2/api_op_DescribeCarrierGateways.go | 85 +++++++++++++++++ .../api_op_DescribeClassicLinkInstances.go | 86 +++++++++++++++++ ..._op_DescribeClientVpnAuthorizationRules.go | 86 +++++++++++++++++ .../api_op_DescribeClientVpnConnections.go | 86 +++++++++++++++++ .../ec2/api_op_DescribeClientVpnEndpoints.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeClientVpnRoutes.go | 86 +++++++++++++++++ .../api_op_DescribeClientVpnTargetNetworks.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeCoipPools.go | 83 +++++++++++++++++ service/ec2/api_op_DescribeDhcpOptions.go | 84 +++++++++++++++++ ...i_op_DescribeEgressOnlyInternetGateways.go | 85 +++++++++++++++++ .../ec2/api_op_DescribeExportImageTasks.go | 84 +++++++++++++++++ .../api_op_DescribeFastSnapshotRestores.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeFleets.go | 84 +++++++++++++++++ service/ec2/api_op_DescribeFlowLogs.go | 83 +++++++++++++++++ service/ec2/api_op_DescribeFpgaImages.go | 83 +++++++++++++++++ ...api_op_DescribeHostReservationOfferings.go | 87 +++++++++++++++++ .../ec2/api_op_DescribeHostReservations.go | 87 +++++++++++++++++ service/ec2/api_op_DescribeHosts.go | 85 +++++++++++++++++ ..._DescribeIamInstanceProfileAssociations.go | 85 +++++++++++++++++ .../ec2/api_op_DescribeImportImageTasks.go | 84 +++++++++++++++++ .../ec2/api_op_DescribeImportSnapshotTasks.go | 85 +++++++++++++++++ ...op_DescribeInstanceCreditSpecifications.go | 87 +++++++++++++++++ service/ec2/api_op_DescribeInstanceStatus.go | 86 +++++++++++++++++ .../api_op_DescribeInstanceTypeOfferings.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeInstanceTypes.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeInstances.go | 85 +++++++++++++++++ .../ec2/api_op_DescribeInternetGateways.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeIpv6Pools.go | 83 +++++++++++++++++ .../api_op_DescribeLaunchTemplateVersions.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeLaunchTemplates.go | 86 +++++++++++++++++ ...eTableVirtualInterfaceGroupAssociations.go | 90 ++++++++++++++++++ ...beLocalGatewayRouteTableVpcAssociations.go | 85 +++++++++++++++++ .../api_op_DescribeLocalGatewayRouteTables.go | 85 +++++++++++++++++ ...cribeLocalGatewayVirtualInterfaceGroups.go | 85 +++++++++++++++++ ...p_DescribeLocalGatewayVirtualInterfaces.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeLocalGateways.go | 84 +++++++++++++++++ .../ec2/api_op_DescribeManagedPrefixLists.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeMovingAddresses.go | 88 ++++++++++++++++++ service/ec2/api_op_DescribeNatGateways.go | 84 +++++++++++++++++ service/ec2/api_op_DescribeNetworkAcls.go | 84 +++++++++++++++++ ..._op_DescribeNetworkInterfacePermissions.go | 86 +++++++++++++++++ .../ec2/api_op_DescribeNetworkInterfaces.go | 87 +++++++++++++++++ service/ec2/api_op_DescribePrefixLists.go | 84 +++++++++++++++++ .../ec2/api_op_DescribePrincipalIdFormat.go | 85 +++++++++++++++++ service/ec2/api_op_DescribePublicIpv4Pools.go | 85 +++++++++++++++++ ..._DescribeReservedInstancesModifications.go | 77 +++++++++++++++ ...i_op_DescribeReservedInstancesOfferings.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeRouteTables.go | 84 +++++++++++++++++ ...p_DescribeScheduledInstanceAvailability.go | 86 +++++++++++++++++ .../ec2/api_op_DescribeScheduledInstances.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeSecurityGroups.go | 86 +++++++++++++++++ service/ec2/api_op_DescribeSnapshots.go | 90 ++++++++++++++++++ .../ec2/api_op_DescribeSpotFleetRequests.go | 86 +++++++++++++++++ .../api_op_DescribeSpotInstanceRequests.go | 86 +++++++++++++++++ .../ec2/api_op_DescribeSpotPriceHistory.go | 86 +++++++++++++++++ .../ec2/api_op_DescribeStaleSecurityGroups.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeSubnets.go | 83 +++++++++++++++++ service/ec2/api_op_DescribeTags.go | 83 +++++++++++++++++ .../api_op_DescribeTrafficMirrorFilters.go | 85 +++++++++++++++++ .../api_op_DescribeTrafficMirrorSessions.go | 85 +++++++++++++++++ .../api_op_DescribeTrafficMirrorTargets.go | 85 +++++++++++++++++ ...pi_op_DescribeTransitGatewayAttachments.go | 85 +++++++++++++++++ ..._DescribeTransitGatewayMulticastDomains.go | 85 +++++++++++++++++ ...escribeTransitGatewayPeeringAttachments.go | 85 +++++++++++++++++ ...pi_op_DescribeTransitGatewayRouteTables.go | 85 +++++++++++++++++ ...op_DescribeTransitGatewayVpcAttachments.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeTransitGateways.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeVolumeStatus.go | 90 ++++++++++++++++++ service/ec2/api_op_DescribeVolumes.go | 89 ++++++++++++++++++ .../api_op_DescribeVolumesModifications.go | 85 +++++++++++++++++ ...api_op_DescribeVpcClassicLinkDnsSupport.go | 85 +++++++++++++++++ ...cribeVpcEndpointConnectionNotifications.go | 85 +++++++++++++++++ .../api_op_DescribeVpcEndpointConnections.go | 87 +++++++++++++++++ ...escribeVpcEndpointServiceConfigurations.go | 87 +++++++++++++++++ ...p_DescribeVpcEndpointServicePermissions.go | 87 +++++++++++++++++ service/ec2/api_op_DescribeVpcEndpoints.go | 85 +++++++++++++++++ .../api_op_DescribeVpcPeeringConnections.go | 85 +++++++++++++++++ service/ec2/api_op_DescribeVpcs.go | 82 ++++++++++++++++ .../ec2/api_op_GetAssociatedIpv6PoolCidrs.go | 85 +++++++++++++++++ .../api_op_GetGroupsForCapacityReservation.go | 87 +++++++++++++++++ ...api_op_GetManagedPrefixListAssociations.go | 85 +++++++++++++++++ .../ec2/api_op_GetManagedPrefixListEntries.go | 85 +++++++++++++++++ ...GetTransitGatewayAttachmentPropagations.go | 85 +++++++++++++++++ ...ansitGatewayMulticastDomainAssociations.go | 85 +++++++++++++++++ ...p_GetTransitGatewayPrefixListReferences.go | 85 +++++++++++++++++ ...GetTransitGatewayRouteTableAssociations.go | 85 +++++++++++++++++ ...GetTransitGatewayRouteTablePropagations.go | 85 +++++++++++++++++ .../ec2/api_op_SearchLocalGatewayRoutes.go | 85 +++++++++++++++++ ..._op_SearchTransitGatewayMulticastGroups.go | 85 +++++++++++++++++ service/ec2/endpoints.go | 5 +- service/ec2instanceconnect/endpoints.go | 5 +- .../ecr/api_op_DescribeImageScanFindings.go | 91 ++++++++++++++++++ service/ecr/api_op_DescribeImages.go | 89 ++++++++++++++++++ service/ecr/api_op_DescribeRepositories.go | 90 ++++++++++++++++++ .../ecr/api_op_GetLifecyclePolicyPreview.go | 93 +++++++++++++++++++ service/ecr/api_op_ListImages.go | 87 +++++++++++++++++ service/ecr/endpoints.go | 5 +- service/ecs/api_op_ListAccountSettings.go | 89 ++++++++++++++++++ service/ecs/api_op_ListAttributes.go | 88 ++++++++++++++++++ service/ecs/api_op_ListClusters.go | 87 +++++++++++++++++ service/ecs/api_op_ListContainerInstances.go | 90 ++++++++++++++++++ service/ecs/api_op_ListServices.go | 87 +++++++++++++++++ .../ecs/api_op_ListTaskDefinitionFamilies.go | 91 ++++++++++++++++++ service/ecs/api_op_ListTaskDefinitions.go | 89 ++++++++++++++++++ service/ecs/api_op_ListTasks.go | 87 +++++++++++++++++ service/ecs/endpoints.go | 5 +- service/efs/api_op_DescribeAccessPoints.go | 85 +++++++++++++++++ service/efs/api_op_DescribeFileSystems.go | 85 +++++++++++++++++ service/efs/api_op_DescribeTags.go | 84 +++++++++++++++++ service/efs/api_op_ListTagsForResource.go | 84 +++++++++++++++++ service/efs/endpoints.go | 5 +- service/eks/api_op_ListClusters.go | 87 +++++++++++++++++ service/eks/api_op_ListFargateProfiles.go | 89 ++++++++++++++++++ service/eks/api_op_ListNodegroups.go | 88 ++++++++++++++++++ service/eks/api_op_ListUpdates.go | 87 +++++++++++++++++ service/eks/endpoints.go | 5 +- .../api_op_DescribeCacheClusters.go | 86 +++++++++++++++++ .../api_op_DescribeCacheEngineVersions.go | 87 +++++++++++++++++ .../api_op_DescribeCacheParameterGroups.go | 87 +++++++++++++++++ .../api_op_DescribeCacheParameters.go | 87 +++++++++++++++++ .../api_op_DescribeCacheSecurityGroups.go | 87 +++++++++++++++++ .../api_op_DescribeCacheSubnetGroups.go | 87 +++++++++++++++++ .../api_op_DescribeEngineDefaultParameters.go | 89 ++++++++++++++++++ service/elasticache/api_op_DescribeEvents.go | 85 +++++++++++++++++ .../api_op_DescribeGlobalReplicationGroups.go | 86 +++++++++++++++++ .../api_op_DescribeReplicationGroups.go | 87 +++++++++++++++++ .../api_op_DescribeReservedCacheNodes.go | 87 +++++++++++++++++ ..._op_DescribeReservedCacheNodesOfferings.go | 87 +++++++++++++++++ .../api_op_DescribeServiceUpdates.go | 83 +++++++++++++++++ .../elasticache/api_op_DescribeSnapshots.go | 85 +++++++++++++++++ .../api_op_DescribeUpdateActions.go | 83 +++++++++++++++++ .../elasticache/api_op_DescribeUserGroups.go | 85 +++++++++++++++++ service/elasticache/api_op_DescribeUsers.go | 83 +++++++++++++++++ service/elasticache/endpoints.go | 5 +- ...DescribeEnvironmentManagedActionHistory.go | 84 +++++++++++++++++ .../elasticbeanstalk/api_op_DescribeEvents.go | 83 +++++++++++++++++ .../api_op_ListPlatformBranches.go | 83 +++++++++++++++++ .../api_op_ListPlatformVersions.go | 83 +++++++++++++++++ service/elasticbeanstalk/endpoints.go | 5 +- .../api_op_DescribeAccelerators.go | 87 +++++++++++++++++ service/elasticinference/endpoints.go | 5 +- .../api_op_DescribeLoadBalancers.go | 76 +++++++++++++++ service/elasticloadbalancing/endpoints.go | 5 +- .../api_op_DescribeListeners.go | 75 +++++++++++++++ .../api_op_DescribeLoadBalancers.go | 76 +++++++++++++++ .../api_op_DescribeTargetGroups.go | 76 +++++++++++++++ service/elasticloadbalancingv2/endpoints.go | 5 +- ...ibeInboundCrossClusterSearchConnections.go | 85 +++++++++++++++++ ...beOutboundCrossClusterSearchConnections.go | 85 +++++++++++++++++ .../api_op_DescribePackages.go | 82 ++++++++++++++++ ...eReservedElasticsearchInstanceOfferings.go | 85 +++++++++++++++++ ..._DescribeReservedElasticsearchInstances.go | 85 +++++++++++++++++ .../api_op_GetUpgradeHistory.go | 82 ++++++++++++++++ .../api_op_ListDomainsForPackage.go | 83 +++++++++++++++++ .../api_op_ListElasticsearchInstanceTypes.go | 85 +++++++++++++++++ .../api_op_ListElasticsearchVersions.go | 85 +++++++++++++++++ .../api_op_ListPackagesForDomain.go | 83 +++++++++++++++++ service/elasticsearchservice/endpoints.go | 5 +- .../api_op_ListJobsByPipeline.go | 76 +++++++++++++++ .../api_op_ListJobsByStatus.go | 75 +++++++++++++++ .../elastictranscoder/api_op_ListPipelines.go | 74 +++++++++++++++ .../elastictranscoder/api_op_ListPresets.go | 74 +++++++++++++++ service/elastictranscoder/endpoints.go | 5 +- service/emr/api_op_ListBootstrapActions.go | 76 +++++++++++++++ service/emr/api_op_ListClusters.go | 74 +++++++++++++++ service/emr/api_op_ListInstanceFleets.go | 76 +++++++++++++++ service/emr/api_op_ListInstanceGroups.go | 76 +++++++++++++++ service/emr/api_op_ListInstances.go | 74 +++++++++++++++ service/emr/api_op_ListNotebookExecutions.go | 76 +++++++++++++++ .../emr/api_op_ListSecurityConfigurations.go | 77 +++++++++++++++ service/emr/api_op_ListSteps.go | 74 +++++++++++++++ service/emr/endpoints.go | 5 +- service/eventbridge/endpoints.go | 5 +- service/firehose/endpoints.go | 5 +- service/fms/api_op_ListComplianceStatus.go | 87 +++++++++++++++++ service/fms/api_op_ListMemberAccounts.go | 86 +++++++++++++++++ service/fms/api_op_ListPolicies.go | 84 +++++++++++++++++ service/fms/endpoints.go | 5 +- service/forecast/api_op_ListDatasetGroups.go | 82 ++++++++++++++++ .../forecast/api_op_ListDatasetImportJobs.go | 83 +++++++++++++++++ service/forecast/api_op_ListDatasets.go | 81 ++++++++++++++++ .../forecast/api_op_ListForecastExportJobs.go | 83 +++++++++++++++++ service/forecast/api_op_ListForecasts.go | 81 ++++++++++++++++ service/forecast/api_op_ListPredictors.go | 82 ++++++++++++++++ service/forecast/endpoints.go | 5 +- service/forecastquery/endpoints.go | 5 +- .../api_op_DescribeModelVersions.go | 83 +++++++++++++++++ service/frauddetector/api_op_GetDetectors.go | 81 ++++++++++++++++ .../frauddetector/api_op_GetEntityTypes.go | 82 ++++++++++++++++ service/frauddetector/api_op_GetEventTypes.go | 81 ++++++++++++++++ .../frauddetector/api_op_GetExternalModels.go | 82 ++++++++++++++++ service/frauddetector/api_op_GetLabels.go | 81 ++++++++++++++++ service/frauddetector/api_op_GetModels.go | 81 ++++++++++++++++ service/frauddetector/api_op_GetOutcomes.go | 81 ++++++++++++++++ service/frauddetector/api_op_GetRules.go | 81 ++++++++++++++++ service/frauddetector/api_op_GetVariables.go | 81 ++++++++++++++++ .../api_op_ListTagsForResource.go | 83 +++++++++++++++++ service/frauddetector/endpoints.go | 5 +- service/fsx/api_op_DescribeBackups.go | 85 +++++++++++++++++ .../fsx/api_op_DescribeDataRepositoryTasks.go | 85 +++++++++++++++++ service/fsx/api_op_DescribeFileSystems.go | 86 +++++++++++++++++ service/fsx/endpoints.go | 5 +- .../api_op_DescribeFleetAttributes.go | 86 +++++++++++++++++ .../gamelift/api_op_DescribeFleetCapacity.go | 85 +++++++++++++++++ .../gamelift/api_op_DescribeFleetEvents.go | 84 +++++++++++++++++ .../api_op_DescribeFleetUtilization.go | 86 +++++++++++++++++ .../api_op_DescribeGameServerInstances.go | 85 +++++++++++++++++ .../api_op_DescribeGameSessionDetails.go | 85 +++++++++++++++++ .../api_op_DescribeGameSessionQueues.go | 85 +++++++++++++++++ .../gamelift/api_op_DescribeGameSessions.go | 84 +++++++++++++++++ service/gamelift/api_op_DescribeInstances.go | 83 +++++++++++++++++ ...pi_op_DescribeMatchmakingConfigurations.go | 85 +++++++++++++++++ .../api_op_DescribeMatchmakingRuleSets.go | 85 +++++++++++++++++ .../gamelift/api_op_DescribePlayerSessions.go | 85 +++++++++++++++++ .../api_op_DescribeScalingPolicies.go | 85 +++++++++++++++++ service/gamelift/api_op_ListAliases.go | 82 ++++++++++++++++ service/gamelift/api_op_ListBuilds.go | 82 ++++++++++++++++ service/gamelift/api_op_ListFleets.go | 82 ++++++++++++++++ .../gamelift/api_op_ListGameServerGroups.go | 84 +++++++++++++++++ service/gamelift/api_op_ListGameServers.go | 83 +++++++++++++++++ service/gamelift/api_op_ListScripts.go | 82 ++++++++++++++++ service/gamelift/api_op_SearchGameSessions.go | 85 +++++++++++++++++ service/gamelift/endpoints.go | 5 +- service/glacier/endpoints.go | 5 +- service/globalaccelerator/endpoints.go | 5 +- service/glue/api_op_GetClassifiers.go | 82 ++++++++++++++++ service/glue/api_op_GetConnections.go | 82 ++++++++++++++++ service/glue/api_op_GetCrawlerMetrics.go | 82 ++++++++++++++++ service/glue/api_op_GetCrawlers.go | 81 ++++++++++++++++ service/glue/api_op_GetDatabases.go | 81 ++++++++++++++++ service/glue/api_op_GetDevEndpoints.go | 82 ++++++++++++++++ service/glue/api_op_GetJobRuns.go | 81 ++++++++++++++++ service/glue/api_op_GetJobs.go | 81 ++++++++++++++++ service/glue/api_op_GetMLTaskRuns.go | 81 ++++++++++++++++ service/glue/api_op_GetMLTransforms.go | 82 ++++++++++++++++ service/glue/api_op_GetPartitionIndexes.go | 76 +++++++++++++++ service/glue/api_op_GetPartitions.go | 81 ++++++++++++++++ .../glue/api_op_GetSecurityConfigurations.go | 84 +++++++++++++++++ service/glue/api_op_GetTableVersions.go | 82 ++++++++++++++++ service/glue/api_op_GetTables.go | 81 ++++++++++++++++ service/glue/api_op_GetTriggers.go | 81 ++++++++++++++++ .../glue/api_op_GetUserDefinedFunctions.go | 84 +++++++++++++++++ service/glue/api_op_GetWorkflowRuns.go | 82 ++++++++++++++++ service/glue/api_op_ListCrawlers.go | 81 ++++++++++++++++ service/glue/api_op_ListDevEndpoints.go | 82 ++++++++++++++++ service/glue/api_op_ListJobs.go | 81 ++++++++++++++++ service/glue/api_op_ListMLTransforms.go | 82 ++++++++++++++++ service/glue/api_op_ListTriggers.go | 81 ++++++++++++++++ service/glue/api_op_ListWorkflows.go | 81 ++++++++++++++++ service/glue/api_op_SearchTables.go | 81 ++++++++++++++++ service/glue/endpoints.go | 5 +- service/greengrass/endpoints.go | 5 +- service/groundstation/api_op_ListConfigs.go | 81 ++++++++++++++++ service/groundstation/api_op_ListContacts.go | 81 ++++++++++++++++ .../api_op_ListDataflowEndpointGroups.go | 84 +++++++++++++++++ .../api_op_ListGroundStations.go | 83 +++++++++++++++++ .../api_op_ListMissionProfiles.go | 83 +++++++++++++++++ .../groundstation/api_op_ListSatellites.go | 82 ++++++++++++++++ service/groundstation/endpoints.go | 5 +- .../guardduty/api_op_GetUsageStatistics.go | 83 +++++++++++++++++ service/guardduty/api_op_ListDetectors.go | 82 ++++++++++++++++ service/guardduty/api_op_ListFilters.go | 82 ++++++++++++++++ service/guardduty/api_op_ListFindings.go | 82 ++++++++++++++++ service/guardduty/api_op_ListIPSets.go | 82 ++++++++++++++++ service/guardduty/api_op_ListInvitations.go | 83 +++++++++++++++++ service/guardduty/api_op_ListMembers.go | 82 ++++++++++++++++ .../api_op_ListOrganizationAdminAccounts.go | 84 +++++++++++++++++ .../api_op_ListPublishingDestinations.go | 84 +++++++++++++++++ .../guardduty/api_op_ListThreatIntelSets.go | 84 +++++++++++++++++ service/guardduty/endpoints.go | 5 +- ...DescribeAffectedAccountsForOrganization.go | 85 +++++++++++++++++ .../health/api_op_DescribeAffectedEntities.go | 85 +++++++++++++++++ ...DescribeAffectedEntitiesForOrganization.go | 85 +++++++++++++++++ .../health/api_op_DescribeEventAggregates.go | 85 +++++++++++++++++ service/health/api_op_DescribeEventTypes.go | 84 +++++++++++++++++ service/health/api_op_DescribeEvents.go | 83 +++++++++++++++++ .../api_op_DescribeEventsForOrganization.go | 85 +++++++++++++++++ service/health/endpoints.go | 5 +- service/honeycode/endpoints.go | 5 +- .../api_op_GetAccountAuthorizationDetails.go | 90 ++++++++++++++++++ service/iam/api_op_GetGroup.go | 87 +++++++++++++++++ service/iam/api_op_ListAccessKeys.go | 88 ++++++++++++++++++ service/iam/api_op_ListAccountAliases.go | 89 ++++++++++++++++++ .../iam/api_op_ListAttachedGroupPolicies.go | 90 ++++++++++++++++++ .../iam/api_op_ListAttachedRolePolicies.go | 90 ++++++++++++++++++ .../iam/api_op_ListAttachedUserPolicies.go | 90 ++++++++++++++++++ service/iam/api_op_ListEntitiesForPolicy.go | 89 ++++++++++++++++++ service/iam/api_op_ListGroupPolicies.go | 88 ++++++++++++++++++ service/iam/api_op_ListGroups.go | 87 +++++++++++++++++ service/iam/api_op_ListGroupsForUser.go | 88 ++++++++++++++++++ service/iam/api_op_ListInstanceProfiles.go | 89 ++++++++++++++++++ .../iam/api_op_ListInstanceProfilesForRole.go | 90 ++++++++++++++++++ service/iam/api_op_ListMFADevices.go | 88 ++++++++++++++++++ service/iam/api_op_ListPolicies.go | 87 +++++++++++++++++ service/iam/api_op_ListPolicyVersions.go | 89 ++++++++++++++++++ service/iam/api_op_ListRolePolicies.go | 88 ++++++++++++++++++ service/iam/api_op_ListRoles.go | 87 +++++++++++++++++ service/iam/api_op_ListSSHPublicKeys.go | 88 ++++++++++++++++++ service/iam/api_op_ListServerCertificates.go | 89 ++++++++++++++++++ service/iam/api_op_ListSigningCertificates.go | 90 ++++++++++++++++++ service/iam/api_op_ListUserPolicies.go | 88 ++++++++++++++++++ service/iam/api_op_ListUsers.go | 87 +++++++++++++++++ service/iam/api_op_ListVirtualMFADevices.go | 89 ++++++++++++++++++ service/iam/api_op_SimulateCustomPolicy.go | 89 ++++++++++++++++++ service/iam/api_op_SimulatePrincipalPolicy.go | 90 ++++++++++++++++++ service/iam/endpoints.go | 5 +- service/identitystore/api_op_ListGroups.go | 83 +++++++++++++++++ service/identitystore/api_op_ListUsers.go | 83 +++++++++++++++++ service/identitystore/endpoints.go | 5 +- .../api_op_ListComponentBuildVersions.go | 84 +++++++++++++++++ service/imagebuilder/api_op_ListComponents.go | 82 ++++++++++++++++ .../api_op_ListDistributionConfigurations.go | 84 +++++++++++++++++ .../api_op_ListImageBuildVersions.go | 83 +++++++++++++++++ .../api_op_ListImagePipelineImages.go | 84 +++++++++++++++++ .../imagebuilder/api_op_ListImagePipelines.go | 83 +++++++++++++++++ .../imagebuilder/api_op_ListImageRecipes.go | 82 ++++++++++++++++ service/imagebuilder/api_op_ListImages.go | 81 ++++++++++++++++ ...api_op_ListInfrastructureConfigurations.go | 84 +++++++++++++++++ service/imagebuilder/endpoints.go | 5 +- .../inspector/api_op_GetExclusionsPreview.go | 84 +++++++++++++++++ .../api_op_ListAssessmentRunAgents.go | 85 +++++++++++++++++ .../inspector/api_op_ListAssessmentRuns.go | 84 +++++++++++++++++ .../inspector/api_op_ListAssessmentTargets.go | 84 +++++++++++++++++ .../api_op_ListAssessmentTemplates.go | 85 +++++++++++++++++ .../api_op_ListEventSubscriptions.go | 84 +++++++++++++++++ service/inspector/api_op_ListExclusions.go | 83 +++++++++++++++++ service/inspector/api_op_ListFindings.go | 82 ++++++++++++++++ service/inspector/api_op_ListRulesPackages.go | 83 +++++++++++++++++ service/inspector/api_op_PreviewAgents.go | 82 ++++++++++++++++ service/inspector/endpoints.go | 5 +- service/iot/api_op_ListActiveViolations.go | 83 +++++++++++++++++ service/iot/api_op_ListAttachedPolicies.go | 83 +++++++++++++++++ service/iot/api_op_ListAuditFindings.go | 82 ++++++++++++++++ ...op_ListAuditMitigationActionsExecutions.go | 84 +++++++++++++++++ .../api_op_ListAuditMitigationActionsTasks.go | 84 +++++++++++++++++ service/iot/api_op_ListAuditSuppressions.go | 83 +++++++++++++++++ service/iot/api_op_ListAuditTasks.go | 82 ++++++++++++++++ service/iot/api_op_ListAuthorizers.go | 82 ++++++++++++++++ service/iot/api_op_ListBillingGroups.go | 82 ++++++++++++++++ service/iot/api_op_ListCACertificates.go | 83 +++++++++++++++++ service/iot/api_op_ListCertificates.go | 82 ++++++++++++++++ service/iot/api_op_ListCertificatesByCA.go | 83 +++++++++++++++++ service/iot/api_op_ListDimensions.go | 82 ++++++++++++++++ .../iot/api_op_ListDomainConfigurations.go | 84 +++++++++++++++++ service/iot/api_op_ListIndices.go | 81 ++++++++++++++++ service/iot/api_op_ListJobExecutionsForJob.go | 84 +++++++++++++++++ .../iot/api_op_ListJobExecutionsForThing.go | 84 +++++++++++++++++ service/iot/api_op_ListJobs.go | 81 ++++++++++++++++ service/iot/api_op_ListMitigationActions.go | 83 +++++++++++++++++ service/iot/api_op_ListOTAUpdates.go | 82 ++++++++++++++++ .../iot/api_op_ListOutgoingCertificates.go | 84 +++++++++++++++++ service/iot/api_op_ListPolicies.go | 81 ++++++++++++++++ service/iot/api_op_ListPolicyPrincipals.go | 83 +++++++++++++++++ service/iot/api_op_ListPrincipalPolicies.go | 83 +++++++++++++++++ service/iot/api_op_ListPrincipalThings.go | 83 +++++++++++++++++ ...api_op_ListProvisioningTemplateVersions.go | 84 +++++++++++++++++ .../iot/api_op_ListProvisioningTemplates.go | 84 +++++++++++++++++ service/iot/api_op_ListRoleAliases.go | 82 ++++++++++++++++ service/iot/api_op_ListScheduledAudits.go | 83 +++++++++++++++++ service/iot/api_op_ListSecurityProfiles.go | 83 +++++++++++++++++ .../api_op_ListSecurityProfilesForTarget.go | 84 +++++++++++++++++ service/iot/api_op_ListStreams.go | 81 ++++++++++++++++ service/iot/api_op_ListTagsForResource.go | 76 +++++++++++++++ service/iot/api_op_ListTargetsForPolicy.go | 83 +++++++++++++++++ .../api_op_ListTargetsForSecurityProfile.go | 84 +++++++++++++++++ service/iot/api_op_ListThingGroups.go | 82 ++++++++++++++++ service/iot/api_op_ListThingGroupsForThing.go | 84 +++++++++++++++++ ...api_op_ListThingRegistrationTaskReports.go | 84 +++++++++++++++++ .../iot/api_op_ListThingRegistrationTasks.go | 84 +++++++++++++++++ service/iot/api_op_ListThingTypes.go | 82 ++++++++++++++++ service/iot/api_op_ListThings.go | 81 ++++++++++++++++ .../iot/api_op_ListThingsInBillingGroup.go | 84 +++++++++++++++++ service/iot/api_op_ListThingsInThingGroup.go | 83 +++++++++++++++++ .../iot/api_op_ListTopicRuleDestinations.go | 84 +++++++++++++++++ service/iot/api_op_ListTopicRules.go | 82 ++++++++++++++++ service/iot/api_op_ListV2LoggingLevels.go | 83 +++++++++++++++++ service/iot/api_op_ListViolationEvents.go | 83 +++++++++++++++++ service/iot/endpoints.go | 5 +- service/iot1clickdevicesservice/endpoints.go | 5 +- .../api_op_ListPlacements.go | 83 +++++++++++++++++ .../iot1clickprojects/api_op_ListProjects.go | 82 ++++++++++++++++ service/iot1clickprojects/endpoints.go | 5 +- service/iotanalytics/api_op_ListChannels.go | 82 ++++++++++++++++ .../api_op_ListDatasetContents.go | 83 +++++++++++++++++ service/iotanalytics/api_op_ListDatasets.go | 82 ++++++++++++++++ service/iotanalytics/api_op_ListDatastores.go | 83 +++++++++++++++++ service/iotanalytics/api_op_ListPipelines.go | 82 ++++++++++++++++ service/iotanalytics/endpoints.go | 5 +- service/iotdataplane/endpoints.go | 5 +- service/iotevents/endpoints.go | 5 +- service/ioteventsdata/endpoints.go | 5 +- service/iotjobsdataplane/endpoints.go | 5 +- .../iotsecuretunneling/api_op_ListTunnels.go | 81 ++++++++++++++++ service/iotsecuretunneling/endpoints.go | 5 +- .../api_op_GetAssetPropertyAggregates.go | 83 +++++++++++++++++ .../api_op_GetAssetPropertyValueHistory.go | 83 +++++++++++++++++ .../iotsitewise/api_op_ListAccessPolicies.go | 82 ++++++++++++++++ service/iotsitewise/api_op_ListAssetModels.go | 81 ++++++++++++++++ service/iotsitewise/api_op_ListAssets.go | 80 ++++++++++++++++ .../api_op_ListAssociatedAssets.go | 82 ++++++++++++++++ service/iotsitewise/api_op_ListDashboards.go | 81 ++++++++++++++++ service/iotsitewise/api_op_ListGateways.go | 80 ++++++++++++++++ service/iotsitewise/api_op_ListPortals.go | 80 ++++++++++++++++ .../iotsitewise/api_op_ListProjectAssets.go | 81 ++++++++++++++++ service/iotsitewise/api_op_ListProjects.go | 80 ++++++++++++++++ service/iotsitewise/endpoints.go | 5 +- .../api_op_GetFlowTemplateRevisions.go | 84 +++++++++++++++++ .../api_op_GetSystemTemplateRevisions.go | 84 +++++++++++++++++ .../api_op_ListFlowExecutionMessages.go | 84 +++++++++++++++++ .../api_op_ListTagsForResource.go | 83 +++++++++++++++++ .../iotthingsgraph/api_op_SearchEntities.go | 82 ++++++++++++++++ .../api_op_SearchFlowExecutions.go | 83 +++++++++++++++++ .../api_op_SearchFlowTemplates.go | 83 +++++++++++++++++ .../api_op_SearchSystemInstances.go | 83 +++++++++++++++++ .../api_op_SearchSystemTemplates.go | 83 +++++++++++++++++ service/iotthingsgraph/api_op_SearchThings.go | 81 ++++++++++++++++ service/iotthingsgraph/endpoints.go | 5 +- service/ivs/api_op_ListChannels.go | 81 ++++++++++++++++ service/ivs/api_op_ListPlaybackKeyPairs.go | 84 +++++++++++++++++ service/ivs/api_op_ListStreamKeys.go | 82 ++++++++++++++++ service/ivs/api_op_ListStreams.go | 81 ++++++++++++++++ service/ivs/api_op_ListTagsForResource.go | 83 +++++++++++++++++ service/ivs/endpoints.go | 5 +- service/kafka/api_op_ListClusterOperations.go | 84 +++++++++++++++++ service/kafka/api_op_ListClusters.go | 82 ++++++++++++++++ .../api_op_ListConfigurationRevisions.go | 85 +++++++++++++++++ service/kafka/api_op_ListConfigurations.go | 84 +++++++++++++++++ service/kafka/api_op_ListKafkaVersions.go | 83 +++++++++++++++++ service/kafka/api_op_ListNodes.go | 82 ++++++++++++++++ service/kafka/api_op_ListScramSecrets.go | 82 ++++++++++++++++ service/kafka/endpoints.go | 5 +- .../kendra/api_op_ListDataSourceSyncJobs.go | 84 +++++++++++++++++ service/kendra/api_op_ListDataSources.go | 82 ++++++++++++++++ service/kendra/api_op_ListIndices.go | 81 ++++++++++++++++ service/kendra/endpoints.go | 5 +- service/kinesis/api_op_ListStreamConsumers.go | 84 +++++++++++++++++ service/kinesis/endpoints.go | 5 +- service/kinesisanalytics/endpoints.go | 5 +- service/kinesisanalyticsv2/endpoints.go | 5 +- .../api_op_ListSignalingChannels.go | 83 +++++++++++++++++ service/kinesisvideo/api_op_ListStreams.go | 81 ++++++++++++++++ service/kinesisvideo/endpoints.go | 5 +- .../kinesisvideoarchivedmedia/endpoints.go | 5 +- service/kinesisvideomedia/endpoints.go | 5 +- service/kinesisvideosignaling/endpoints.go | 5 +- service/kms/api_op_ListAliases.go | 85 +++++++++++++++++ service/kms/api_op_ListGrants.go | 85 +++++++++++++++++ service/kms/api_op_ListKeyPolicies.go | 86 +++++++++++++++++ service/kms/api_op_ListKeys.go | 85 +++++++++++++++++ service/kms/endpoints.go | 5 +- .../api_op_GetEffectivePermissionsForPath.go | 84 +++++++++++++++++ .../lakeformation/api_op_ListPermissions.go | 82 ++++++++++++++++ service/lakeformation/api_op_ListResources.go | 81 ++++++++++++++++ service/lakeformation/endpoints.go | 5 +- service/lambda/api_op_ListAliases.go | 81 ++++++++++++++++ .../lambda/api_op_ListEventSourceMappings.go | 84 +++++++++++++++++ .../api_op_ListFunctionEventInvokeConfigs.go | 84 +++++++++++++++++ service/lambda/api_op_ListFunctions.go | 81 ++++++++++++++++ service/lambda/api_op_ListLayerVersions.go | 82 ++++++++++++++++ service/lambda/api_op_ListLayers.go | 81 ++++++++++++++++ ...pi_op_ListProvisionedConcurrencyConfigs.go | 84 +++++++++++++++++ .../lambda/api_op_ListVersionsByFunction.go | 83 +++++++++++++++++ service/lambda/endpoints.go | 5 +- .../api_op_GetBotAliases.go | 81 ++++++++++++++++ .../api_op_GetBotChannelAssociations.go | 84 +++++++++++++++++ .../api_op_GetBotVersions.go | 82 ++++++++++++++++ .../lexmodelbuildingservice/api_op_GetBots.go | 82 ++++++++++++++++ .../api_op_GetBuiltinIntents.go | 82 ++++++++++++++++ .../api_op_GetBuiltinSlotTypes.go | 83 +++++++++++++++++ .../api_op_GetIntentVersions.go | 83 +++++++++++++++++ .../api_op_GetIntents.go | 81 ++++++++++++++++ .../api_op_GetSlotTypeVersions.go | 84 +++++++++++++++++ .../api_op_GetSlotTypes.go | 81 ++++++++++++++++ service/lexmodelbuildingservice/endpoints.go | 5 +- service/lexruntimeservice/endpoints.go | 5 +- service/licensemanager/endpoints.go | 5 +- service/lightsail/endpoints.go | 5 +- .../api_op_DescribeBatchPredictions.go | 85 +++++++++++++++++ .../api_op_DescribeDataSources.go | 83 +++++++++++++++++ .../api_op_DescribeEvaluations.go | 83 +++++++++++++++++ .../api_op_DescribeMLModels.go | 83 +++++++++++++++++ service/machinelearning/endpoints.go | 5 +- service/macie/api_op_ListMemberAccounts.go | 84 +++++++++++++++++ service/macie/api_op_ListS3Resources.go | 83 +++++++++++++++++ service/macie/endpoints.go | 5 +- service/macie2/api_op_DescribeBuckets.go | 83 +++++++++++++++++ service/macie2/api_op_GetUsageStatistics.go | 83 +++++++++++++++++ .../macie2/api_op_ListClassificationJobs.go | 83 +++++++++++++++++ .../api_op_ListCustomDataIdentifiers.go | 84 +++++++++++++++++ service/macie2/api_op_ListFindings.go | 81 ++++++++++++++++ service/macie2/api_op_ListFindingsFilters.go | 83 +++++++++++++++++ service/macie2/api_op_ListInvitations.go | 82 ++++++++++++++++ service/macie2/api_op_ListMembers.go | 81 ++++++++++++++++ .../api_op_ListOrganizationAdminAccounts.go | 84 +++++++++++++++++ service/macie2/endpoints.go | 5 +- .../api_op_ListInvitations.go | 82 ++++++++++++++++ .../managedblockchain/api_op_ListMembers.go | 81 ++++++++++++++++ .../managedblockchain/api_op_ListNetworks.go | 81 ++++++++++++++++ service/managedblockchain/api_op_ListNodes.go | 81 ++++++++++++++++ .../api_op_ListProposalVotes.go | 82 ++++++++++++++++ .../managedblockchain/api_op_ListProposals.go | 81 ++++++++++++++++ service/managedblockchain/endpoints.go | 5 +- .../api_op_ListChangeSets.go | 84 +++++++++++++++++ .../marketplacecatalog/api_op_ListEntities.go | 82 ++++++++++++++++ service/marketplacecatalog/endpoints.go | 5 +- .../marketplacecommerceanalytics/endpoints.go | 5 +- .../endpoints.go | 5 +- service/marketplacemetering/endpoints.go | 5 +- .../mediaconnect/api_op_ListEntitlements.go | 88 ++++++++++++++++++ service/mediaconnect/api_op_ListFlows.go | 87 +++++++++++++++++ service/mediaconnect/api_op_ListOfferings.go | 87 +++++++++++++++++ .../mediaconnect/api_op_ListReservations.go | 88 ++++++++++++++++++ service/mediaconnect/endpoints.go | 5 +- .../mediaconvert/api_op_DescribeEndpoints.go | 83 +++++++++++++++++ .../mediaconvert/api_op_ListJobTemplates.go | 83 +++++++++++++++++ service/mediaconvert/api_op_ListJobs.go | 81 ++++++++++++++++ service/mediaconvert/api_op_ListPresets.go | 81 ++++++++++++++++ service/mediaconvert/api_op_ListQueues.go | 81 ++++++++++++++++ service/mediaconvert/endpoints.go | 5 +- service/medialive/api_op_DescribeSchedule.go | 82 ++++++++++++++++ service/medialive/api_op_ListChannels.go | 81 ++++++++++++++++ .../api_op_ListInputDeviceTransfers.go | 84 +++++++++++++++++ service/medialive/api_op_ListInputDevices.go | 82 ++++++++++++++++ .../api_op_ListInputSecurityGroups.go | 84 +++++++++++++++++ service/medialive/api_op_ListInputs.go | 81 ++++++++++++++++ .../medialive/api_op_ListMultiplexPrograms.go | 83 +++++++++++++++++ service/medialive/api_op_ListMultiplexes.go | 82 ++++++++++++++++ service/medialive/api_op_ListOfferings.go | 81 ++++++++++++++++ service/medialive/api_op_ListReservations.go | 82 ++++++++++++++++ service/medialive/endpoints.go | 5 +- service/mediapackage/api_op_ListChannels.go | 81 ++++++++++++++++ .../mediapackage/api_op_ListHarvestJobs.go | 82 ++++++++++++++++ .../api_op_ListOriginEndpoints.go | 83 +++++++++++++++++ service/mediapackage/endpoints.go | 5 +- service/mediapackagevod/api_op_ListAssets.go | 81 ++++++++++++++++ .../api_op_ListPackagingConfigurations.go | 84 +++++++++++++++++ .../api_op_ListPackagingGroups.go | 83 +++++++++++++++++ service/mediapackagevod/endpoints.go | 5 +- service/mediastore/api_op_ListContainers.go | 83 +++++++++++++++++ service/mediastore/endpoints.go | 5 +- service/mediastoredata/endpoints.go | 5 +- service/mediatailor/endpoints.go | 5 +- .../api_op_ListApplicationStates.go | 83 +++++++++++++++++ .../api_op_ListCreatedArtifacts.go | 83 +++++++++++++++++ .../api_op_ListDiscoveredResources.go | 84 +++++++++++++++++ .../migrationhub/api_op_ListMigrationTasks.go | 83 +++++++++++++++++ .../api_op_ListProgressUpdateStreams.go | 84 +++++++++++++++++ service/migrationhub/endpoints.go | 5 +- .../api_op_DescribeHomeRegionControls.go | 84 +++++++++++++++++ service/migrationhubconfig/endpoints.go | 5 +- service/mobile/api_op_ListBundles.go | 81 ++++++++++++++++ service/mobile/api_op_ListProjects.go | 81 ++++++++++++++++ service/mobile/endpoints.go | 5 +- service/mq/api_op_ListBrokers.go | 82 ++++++++++++++++ service/mq/endpoints.go | 5 +- service/mturk/api_op_ListAssignmentsForHIT.go | 82 ++++++++++++++++ service/mturk/api_op_ListBonusPayments.go | 81 ++++++++++++++++ service/mturk/api_op_ListHITs.go | 80 ++++++++++++++++ .../api_op_ListHITsForQualificationType.go | 84 +++++++++++++++++ .../mturk/api_op_ListQualificationRequests.go | 84 +++++++++++++++++ .../mturk/api_op_ListQualificationTypes.go | 83 +++++++++++++++++ .../api_op_ListReviewPolicyResultsForHIT.go | 84 +++++++++++++++++ service/mturk/api_op_ListReviewableHITs.go | 83 +++++++++++++++++ service/mturk/api_op_ListWorkerBlocks.go | 81 ++++++++++++++++ ...api_op_ListWorkersWithQualificationType.go | 84 +++++++++++++++++ service/mturk/endpoints.go | 5 +- .../api_op_DescribeDBClusterEndpoints.go | 87 +++++++++++++++++ .../api_op_DescribeDBEngineVersions.go | 87 +++++++++++++++++ service/neptune/api_op_DescribeDBInstances.go | 86 +++++++++++++++++ .../api_op_DescribeDBParameterGroups.go | 87 +++++++++++++++++ .../neptune/api_op_DescribeDBParameters.go | 86 +++++++++++++++++ .../neptune/api_op_DescribeDBSubnetGroups.go | 86 +++++++++++++++++ .../api_op_DescribeEngineDefaultParameters.go | 89 ++++++++++++++++++ .../api_op_DescribeEventSubscriptions.go | 87 +++++++++++++++++ service/neptune/api_op_DescribeEvents.go | 85 +++++++++++++++++ ...i_op_DescribeOrderableDBInstanceOptions.go | 87 +++++++++++++++++ service/neptune/endpoints.go | 5 +- .../api_op_DescribeGlobalNetworks.go | 83 +++++++++++++++++ .../api_op_GetCustomerGatewayAssociations.go | 84 +++++++++++++++++ service/networkmanager/api_op_GetDevices.go | 81 ++++++++++++++++ .../api_op_GetLinkAssociations.go | 83 +++++++++++++++++ service/networkmanager/api_op_GetLinks.go | 81 ++++++++++++++++ service/networkmanager/api_op_GetSites.go | 81 ++++++++++++++++ .../api_op_GetTransitGatewayRegistrations.go | 84 +++++++++++++++++ service/networkmanager/endpoints.go | 5 +- .../opsworks/api_op_DescribeEcsClusters.go | 86 +++++++++++++++++ service/opsworks/endpoints.go | 5 +- service/opsworkscm/api_op_DescribeBackups.go | 82 ++++++++++++++++ service/opsworkscm/api_op_DescribeEvents.go | 85 +++++++++++++++++ service/opsworkscm/api_op_DescribeServers.go | 82 ++++++++++++++++ .../opsworkscm/api_op_ListTagsForResource.go | 86 +++++++++++++++++ service/opsworkscm/endpoints.go | 5 +- ..._op_ListAWSServiceAccessForOrganization.go | 92 ++++++++++++++++++ service/organizations/api_op_ListAccounts.go | 89 ++++++++++++++++++ .../api_op_ListAccountsForParent.go | 91 ++++++++++++++++++ service/organizations/api_op_ListChildren.go | 89 ++++++++++++++++++ .../api_op_ListCreateAccountStatus.go | 92 ++++++++++++++++++ .../api_op_ListDelegatedAdministrators.go | 92 ++++++++++++++++++ .../api_op_ListDelegatedServicesForAccount.go | 92 ++++++++++++++++++ .../api_op_ListHandshakesForAccount.go | 92 ++++++++++++++++++ .../api_op_ListHandshakesForOrganization.go | 92 ++++++++++++++++++ ...api_op_ListOrganizationalUnitsForParent.go | 92 ++++++++++++++++++ service/organizations/api_op_ListParents.go | 89 ++++++++++++++++++ service/organizations/api_op_ListPolicies.go | 89 ++++++++++++++++++ .../api_op_ListPoliciesForTarget.go | 91 ++++++++++++++++++ service/organizations/api_op_ListRoots.go | 89 ++++++++++++++++++ .../api_op_ListTagsForResource.go | 76 +++++++++++++++ .../api_op_ListTargetsForPolicy.go | 91 ++++++++++++++++++ service/organizations/endpoints.go | 5 +- service/outposts/api_op_ListOutposts.go | 81 ++++++++++++++++ service/outposts/api_op_ListSites.go | 81 ++++++++++++++++ service/outposts/endpoints.go | 5 +- .../api_op_ListBatchInferenceJobs.go | 84 +++++++++++++++++ service/personalize/api_op_ListCampaigns.go | 81 ++++++++++++++++ .../personalize/api_op_ListDatasetGroups.go | 82 ++++++++++++++++ .../api_op_ListDatasetImportJobs.go | 83 +++++++++++++++++ service/personalize/api_op_ListDatasets.go | 81 ++++++++++++++++ .../personalize/api_op_ListEventTrackers.go | 82 ++++++++++++++++ service/personalize/api_op_ListRecipes.go | 81 ++++++++++++++++ service/personalize/api_op_ListSchemas.go | 81 ++++++++++++++++ .../api_op_ListSolutionVersions.go | 83 +++++++++++++++++ service/personalize/api_op_ListSolutions.go | 81 ++++++++++++++++ service/personalize/endpoints.go | 5 +- service/personalizeevents/endpoints.go | 5 +- service/personalizeruntime/endpoints.go | 5 +- service/pi/endpoints.go | 5 +- service/pinpoint/endpoints.go | 5 +- .../pinpointemail/api_op_GetDedicatedIps.go | 85 +++++++++++++++++ .../api_op_ListConfigurationSets.go | 86 +++++++++++++++++ .../api_op_ListDedicatedIpPools.go | 86 +++++++++++++++++ .../api_op_ListDeliverabilityTestReports.go | 88 ++++++++++++++++++ ...pi_op_ListDomainDeliverabilityCampaigns.go | 87 +++++++++++++++++ .../api_op_ListEmailIdentities.go | 87 +++++++++++++++++ service/pinpointemail/endpoints.go | 5 +- service/pinpointsmsvoice/endpoints.go | 5 +- .../polly/api_op_ListSpeechSynthesisTasks.go | 84 +++++++++++++++++ service/polly/endpoints.go | 5 +- service/pricing/api_op_DescribeServices.go | 82 ++++++++++++++++ service/pricing/api_op_GetAttributeValues.go | 83 +++++++++++++++++ service/pricing/api_op_GetProducts.go | 81 ++++++++++++++++ service/pricing/endpoints.go | 5 +- ...i_op_ListJournalKinesisStreamsForLedger.go | 86 +++++++++++++++++ service/qldb/api_op_ListJournalS3Exports.go | 84 +++++++++++++++++ .../api_op_ListJournalS3ExportsForLedger.go | 86 +++++++++++++++++ service/qldb/api_op_ListLedgers.go | 82 ++++++++++++++++ service/qldb/endpoints.go | 5 +- service/qldbsession/endpoints.go | 5 +- service/quicksight/api_op_ListAnalyses.go | 81 ++++++++++++++++ .../api_op_ListDashboardVersions.go | 83 +++++++++++++++++ service/quicksight/api_op_ListDashboards.go | 82 ++++++++++++++++ service/quicksight/api_op_ListDataSets.go | 81 ++++++++++++++++ service/quicksight/api_op_ListDataSources.go | 82 ++++++++++++++++ service/quicksight/api_op_ListIngestions.go | 82 ++++++++++++++++ service/quicksight/api_op_ListNamespaces.go | 82 ++++++++++++++++ .../quicksight/api_op_ListTemplateAliases.go | 83 +++++++++++++++++ .../quicksight/api_op_ListTemplateVersions.go | 83 +++++++++++++++++ service/quicksight/api_op_ListTemplates.go | 81 ++++++++++++++++ service/quicksight/api_op_SearchAnalyses.go | 82 ++++++++++++++++ service/quicksight/api_op_SearchDashboards.go | 82 ++++++++++++++++ service/quicksight/endpoints.go | 5 +- service/ram/api_op_GetResourcePolicies.go | 84 +++++++++++++++++ .../api_op_GetResourceShareAssociations.go | 85 +++++++++++++++++ .../ram/api_op_GetResourceShareInvitations.go | 85 +++++++++++++++++ service/ram/api_op_GetResourceShares.go | 83 +++++++++++++++++ .../api_op_ListPendingInvitationResources.go | 85 +++++++++++++++++ service/ram/api_op_ListPrincipals.go | 83 +++++++++++++++++ service/ram/api_op_ListResources.go | 82 ++++++++++++++++ service/ram/endpoints.go | 5 +- service/rds/api_op_DescribeCertificates.go | 86 +++++++++++++++++ .../api_op_DescribeCustomAvailabilityZones.go | 87 +++++++++++++++++ .../rds/api_op_DescribeDBClusterBacktracks.go | 87 +++++++++++++++++ .../rds/api_op_DescribeDBClusterEndpoints.go | 87 +++++++++++++++++ ...api_op_DescribeDBClusterParameterGroups.go | 87 +++++++++++++++++ .../rds/api_op_DescribeDBClusterParameters.go | 87 +++++++++++++++++ .../rds/api_op_DescribeDBClusterSnapshots.go | 87 +++++++++++++++++ service/rds/api_op_DescribeDBClusters.go | 86 +++++++++++++++++ .../rds/api_op_DescribeDBEngineVersions.go | 87 +++++++++++++++++ ...i_op_DescribeDBInstanceAutomatedBackups.go | 86 +++++++++++++++++ service/rds/api_op_DescribeDBInstances.go | 86 +++++++++++++++++ service/rds/api_op_DescribeDBLogFiles.go | 85 +++++++++++++++++ .../rds/api_op_DescribeDBParameterGroups.go | 87 +++++++++++++++++ service/rds/api_op_DescribeDBParameters.go | 86 +++++++++++++++++ service/rds/api_op_DescribeDBProxies.go | 85 +++++++++++++++++ .../rds/api_op_DescribeDBProxyTargetGroups.go | 87 +++++++++++++++++ service/rds/api_op_DescribeDBProxyTargets.go | 86 +++++++++++++++++ .../rds/api_op_DescribeDBSecurityGroups.go | 87 +++++++++++++++++ service/rds/api_op_DescribeDBSnapshots.go | 86 +++++++++++++++++ service/rds/api_op_DescribeDBSubnetGroups.go | 86 +++++++++++++++++ .../api_op_DescribeEngineDefaultParameters.go | 89 ++++++++++++++++++ .../rds/api_op_DescribeEventSubscriptions.go | 87 +++++++++++++++++ service/rds/api_op_DescribeEvents.go | 85 +++++++++++++++++ service/rds/api_op_DescribeExportTasks.go | 87 +++++++++++++++++ service/rds/api_op_DescribeGlobalClusters.go | 86 +++++++++++++++++ .../rds/api_op_DescribeInstallationMedia.go | 86 +++++++++++++++++ .../rds/api_op_DescribeOptionGroupOptions.go | 87 +++++++++++++++++ service/rds/api_op_DescribeOptionGroups.go | 86 +++++++++++++++++ ...i_op_DescribeOrderableDBInstanceOptions.go | 87 +++++++++++++++++ ...pi_op_DescribePendingMaintenanceActions.go | 87 +++++++++++++++++ .../rds/api_op_DescribeReservedDBInstances.go | 87 +++++++++++++++++ ...op_DescribeReservedDBInstancesOfferings.go | 87 +++++++++++++++++ service/rds/api_op_DescribeSourceRegions.go | 86 +++++++++++++++++ service/rds/endpoints.go | 5 +- service/rdsdata/endpoints.go | 5 +- .../api_op_DescribeClusterParameterGroups.go | 88 ++++++++++++++++++ .../api_op_DescribeClusterParameters.go | 88 ++++++++++++++++++ .../api_op_DescribeClusterSecurityGroups.go | 88 ++++++++++++++++++ .../api_op_DescribeClusterSnapshots.go | 88 ++++++++++++++++++ .../api_op_DescribeClusterSubnetGroups.go | 88 ++++++++++++++++++ .../api_op_DescribeClusterVersions.go | 88 ++++++++++++++++++ service/redshift/api_op_DescribeClusters.go | 86 +++++++++++++++++ ...api_op_DescribeDefaultClusterParameters.go | 90 ++++++++++++++++++ .../api_op_DescribeEventSubscriptions.go | 88 ++++++++++++++++++ service/redshift/api_op_DescribeEvents.go | 86 +++++++++++++++++ .../api_op_DescribeHsmClientCertificates.go | 88 ++++++++++++++++++ .../api_op_DescribeHsmConfigurations.go | 88 ++++++++++++++++++ ...api_op_DescribeNodeConfigurationOptions.go | 88 ++++++++++++++++++ .../api_op_DescribeOrderableClusterOptions.go | 88 ++++++++++++++++++ .../api_op_DescribeReservedNodeOfferings.go | 88 ++++++++++++++++++ .../redshift/api_op_DescribeReservedNodes.go | 87 +++++++++++++++++ .../api_op_DescribeScheduledActions.go | 88 ++++++++++++++++++ .../redshift/api_op_DescribeUsageLimits.go | 87 +++++++++++++++++ service/redshift/endpoints.go | 5 +- service/redshiftdata/api_op_DescribeTable.go | 83 +++++++++++++++++ .../redshiftdata/api_op_GetStatementResult.go | 76 +++++++++++++++ service/redshiftdata/api_op_ListDatabases.go | 83 +++++++++++++++++ service/redshiftdata/api_op_ListSchemas.go | 83 +++++++++++++++++ service/redshiftdata/api_op_ListStatements.go | 84 +++++++++++++++++ service/redshiftdata/api_op_ListTables.go | 83 +++++++++++++++++ service/redshiftdata/endpoints.go | 5 +- .../api_op_DescribeProjectVersions.go | 86 +++++++++++++++++ .../rekognition/api_op_DescribeProjects.go | 84 +++++++++++++++++ .../api_op_GetCelebrityRecognition.go | 86 +++++++++++++++++ .../api_op_GetContentModeration.go | 85 +++++++++++++++++ .../rekognition/api_op_GetFaceDetection.go | 84 +++++++++++++++++ service/rekognition/api_op_GetFaceSearch.go | 83 +++++++++++++++++ .../rekognition/api_op_GetLabelDetection.go | 84 +++++++++++++++++ .../rekognition/api_op_GetPersonTracking.go | 84 +++++++++++++++++ .../rekognition/api_op_GetSegmentDetection.go | 84 +++++++++++++++++ .../rekognition/api_op_GetTextDetection.go | 83 +++++++++++++++++ service/rekognition/api_op_ListCollections.go | 82 ++++++++++++++++ service/rekognition/api_op_ListFaces.go | 81 ++++++++++++++++ .../api_op_ListStreamProcessors.go | 84 +++++++++++++++++ service/rekognition/endpoints.go | 5 +- .../api_op_ListGroupResources.go | 91 ++++++++++++++++++ service/resourcegroups/api_op_ListGroups.go | 89 ++++++++++++++++++ .../resourcegroups/api_op_SearchResources.go | 90 ++++++++++++++++++ service/resourcegroups/endpoints.go | 5 +- .../api_op_GetComplianceSummary.go | 83 +++++++++++++++++ .../api_op_GetResources.go | 83 +++++++++++++++++ .../api_op_GetTagKeys.go | 74 +++++++++++++++ .../api_op_GetTagValues.go | 74 +++++++++++++++ service/resourcegroupstaggingapi/endpoints.go | 5 +- .../robomaker/api_op_ListDeploymentJobs.go | 88 ++++++++++++++++++ service/robomaker/api_op_ListFleets.go | 86 +++++++++++++++++ .../robomaker/api_op_ListRobotApplications.go | 88 ++++++++++++++++++ service/robomaker/api_op_ListRobots.go | 86 +++++++++++++++++ .../api_op_ListSimulationApplications.go | 90 ++++++++++++++++++ .../api_op_ListSimulationJobBatches.go | 87 +++++++++++++++++ .../robomaker/api_op_ListSimulationJobs.go | 88 ++++++++++++++++++ .../robomaker/api_op_ListWorldExportJobs.go | 88 ++++++++++++++++++ .../api_op_ListWorldGenerationJobs.go | 89 ++++++++++++++++++ .../robomaker/api_op_ListWorldTemplates.go | 88 ++++++++++++++++++ service/robomaker/api_op_ListWorlds.go | 86 +++++++++++++++++ service/robomaker/endpoints.go | 5 +- service/route53/endpoints.go | 5 +- service/route53domains/api_op_ListDomains.go | 81 ++++++++++++++++ .../route53domains/api_op_ListOperations.go | 82 ++++++++++++++++ service/route53domains/endpoints.go | 5 +- .../api_op_ListResolverEndpointIpAddresses.go | 86 +++++++++++++++++ .../api_op_ListResolverEndpoints.go | 85 +++++++++++++++++ ..._ListResolverQueryLogConfigAssociations.go | 87 +++++++++++++++++ .../api_op_ListResolverQueryLogConfigs.go | 86 +++++++++++++++++ .../api_op_ListResolverRuleAssociations.go | 86 +++++++++++++++++ .../api_op_ListResolverRules.go | 84 +++++++++++++++++ .../api_op_ListTagsForResource.go | 85 +++++++++++++++++ service/route53resolver/endpoints.go | 5 +- service/s3/api_op_ListObjectsV2.go | 83 +++++++++++++++++ service/s3control/api_op_ListAccessPoints.go | 84 +++++++++++++++++ service/s3control/api_op_ListJobs.go | 83 +++++++++++++++++ .../s3control/api_op_ListRegionalBuckets.go | 82 ++++++++++++++++ service/s3control/go.sum | 10 -- service/s3outposts/api_op_ListEndpoints.go | 81 ++++++++++++++++ service/s3outposts/endpoints.go | 5 +- service/sagemaker/api_op_ListAlgorithms.go | 82 ++++++++++++++++ service/sagemaker/api_op_ListApps.go | 81 ++++++++++++++++ service/sagemaker/api_op_ListAutoMLJobs.go | 82 ++++++++++++++++ .../api_op_ListCandidatesForAutoMLJob.go | 84 +++++++++++++++++ .../sagemaker/api_op_ListCodeRepositories.go | 83 +++++++++++++++++ .../sagemaker/api_op_ListCompilationJobs.go | 83 +++++++++++++++++ service/sagemaker/api_op_ListDomains.go | 81 ++++++++++++++++ .../sagemaker/api_op_ListEndpointConfigs.go | 83 +++++++++++++++++ service/sagemaker/api_op_ListEndpoints.go | 81 ++++++++++++++++ service/sagemaker/api_op_ListExperiments.go | 83 +++++++++++++++++ .../sagemaker/api_op_ListFlowDefinitions.go | 85 +++++++++++++++++ service/sagemaker/api_op_ListHumanTaskUis.go | 84 +++++++++++++++++ .../api_op_ListHyperParameterTuningJobs.go | 84 +++++++++++++++++ service/sagemaker/api_op_ListImageVersions.go | 83 +++++++++++++++++ service/sagemaker/api_op_ListImages.go | 81 ++++++++++++++++ service/sagemaker/api_op_ListLabelingJobs.go | 82 ++++++++++++++++ .../api_op_ListLabelingJobsForWorkteam.go | 84 +++++++++++++++++ service/sagemaker/api_op_ListModelPackages.go | 82 ++++++++++++++++ service/sagemaker/api_op_ListModels.go | 81 ++++++++++++++++ .../api_op_ListMonitoringExecutions.go | 84 +++++++++++++++++ .../api_op_ListMonitoringSchedules.go | 84 +++++++++++++++++ ...op_ListNotebookInstanceLifecycleConfigs.go | 84 +++++++++++++++++ .../sagemaker/api_op_ListNotebookInstances.go | 83 +++++++++++++++++ .../sagemaker/api_op_ListProcessingJobs.go | 83 +++++++++++++++++ .../api_op_ListSubscribedWorkteams.go | 84 +++++++++++++++++ service/sagemaker/api_op_ListTags.go | 81 ++++++++++++++++ service/sagemaker/api_op_ListTrainingJobs.go | 82 ++++++++++++++++ ...tTrainingJobsForHyperParameterTuningJob.go | 84 +++++++++++++++++ service/sagemaker/api_op_ListTransformJobs.go | 83 +++++++++++++++++ .../sagemaker/api_op_ListTrialComponents.go | 84 +++++++++++++++++ service/sagemaker/api_op_ListTrials.go | 81 ++++++++++++++++ service/sagemaker/api_op_ListUserProfiles.go | 82 ++++++++++++++++ service/sagemaker/api_op_ListWorkforces.go | 82 ++++++++++++++++ service/sagemaker/api_op_ListWorkteams.go | 81 ++++++++++++++++ service/sagemaker/api_op_Search.go | 81 ++++++++++++++++ service/sagemaker/endpoints.go | 5 +- .../api_op_ListHumanLoops.go | 84 +++++++++++++++++ service/sagemakera2iruntime/endpoints.go | 5 +- service/sagemakerruntime/endpoints.go | 5 +- service/savingsplans/endpoints.go | 5 +- service/schemas/api_op_ListDiscoverers.go | 81 ++++++++++++++++ service/schemas/api_op_ListRegistries.go | 81 ++++++++++++++++ service/schemas/api_op_ListSchemaVersions.go | 82 ++++++++++++++++ service/schemas/api_op_ListSchemas.go | 80 ++++++++++++++++ service/schemas/api_op_SearchSchemas.go | 80 ++++++++++++++++ service/schemas/endpoints.go | 5 +- .../api_op_ListSecretVersionIds.go | 91 ++++++++++++++++++ service/secretsmanager/api_op_ListSecrets.go | 89 ++++++++++++++++++ service/secretsmanager/endpoints.go | 5 +- .../api_op_DescribeActionTargets.go | 83 +++++++++++++++++ .../securityhub/api_op_DescribeProducts.go | 82 ++++++++++++++++ .../securityhub/api_op_DescribeStandards.go | 82 ++++++++++++++++ .../api_op_DescribeStandardsControls.go | 84 +++++++++++++++++ .../securityhub/api_op_GetEnabledStandards.go | 83 +++++++++++++++++ service/securityhub/api_op_GetFindings.go | 81 ++++++++++++++++ service/securityhub/api_op_GetInsights.go | 81 ++++++++++++++++ .../api_op_ListEnabledProductsForImport.go | 84 +++++++++++++++++ service/securityhub/api_op_ListInvitations.go | 82 ++++++++++++++++ service/securityhub/api_op_ListMembers.go | 81 ++++++++++++++++ service/securityhub/endpoints.go | 5 +- .../api_op_ListApplicationDependencies.go | 84 +++++++++++++++++ .../api_op_ListApplicationVersions.go | 84 +++++++++++++++++ .../api_op_ListApplications.go | 82 ++++++++++++++++ .../endpoints.go | 5 +- .../api_op_GetProvisionedProductOutputs.go | 84 +++++++++++++++++ .../api_op_ListAcceptedPortfolioShares.go | 84 +++++++++++++++++ .../api_op_ListBudgetsForResource.go | 83 +++++++++++++++++ .../api_op_ListConstraintsForPortfolio.go | 84 +++++++++++++++++ .../servicecatalog/api_op_ListLaunchPaths.go | 82 ++++++++++++++++ .../api_op_ListOrganizationPortfolioAccess.go | 84 +++++++++++++++++ .../api_op_ListPortfolioAccess.go | 83 +++++++++++++++++ .../servicecatalog/api_op_ListPortfolios.go | 82 ++++++++++++++++ .../api_op_ListPortfoliosForProduct.go | 84 +++++++++++++++++ .../api_op_ListPrincipalsForPortfolio.go | 84 +++++++++++++++++ ...stProvisioningArtifactsForServiceAction.go | 84 +++++++++++++++++ .../api_op_ListResourcesForTagOption.go | 84 +++++++++++++++++ .../api_op_ListServiceActions.go | 83 +++++++++++++++++ ...stServiceActionsForProvisioningArtifact.go | 84 +++++++++++++++++ .../servicecatalog/api_op_ListTagOptions.go | 82 ++++++++++++++++ .../servicecatalog/api_op_SearchProducts.go | 82 ++++++++++++++++ .../api_op_SearchProductsAsAdmin.go | 83 +++++++++++++++++ .../api_op_SearchProvisionedProducts.go | 84 +++++++++++++++++ service/servicecatalog/endpoints.go | 5 +- .../api_op_GetInstancesHealthStatus.go | 86 +++++++++++++++++ .../servicediscovery/api_op_ListInstances.go | 83 +++++++++++++++++ .../servicediscovery/api_op_ListNamespaces.go | 84 +++++++++++++++++ .../servicediscovery/api_op_ListOperations.go | 84 +++++++++++++++++ .../servicediscovery/api_op_ListServices.go | 83 +++++++++++++++++ service/servicediscovery/endpoints.go | 5 +- .../api_op_ListAWSDefaultServiceQuotas.go | 90 ++++++++++++++++++ ..._ListRequestedServiceQuotaChangeHistory.go | 90 ++++++++++++++++++ ...questedServiceQuotaChangeHistoryByQuota.go | 90 ++++++++++++++++++ ...tServiceQuotaIncreaseRequestsInTemplate.go | 90 ++++++++++++++++++ .../servicequotas/api_op_ListServiceQuotas.go | 88 ++++++++++++++++++ service/servicequotas/api_op_ListServices.go | 87 +++++++++++++++++ service/servicequotas/endpoints.go | 5 +- ...op_ListCustomVerificationEmailTemplates.go | 87 +++++++++++++++++ service/ses/api_op_ListIdentities.go | 82 ++++++++++++++++ service/ses/endpoints.go | 5 +- service/sesv2/api_op_GetDedicatedIps.go | 85 +++++++++++++++++ service/sesv2/api_op_ListConfigurationSets.go | 86 +++++++++++++++++ service/sesv2/api_op_ListContactLists.go | 85 +++++++++++++++++ service/sesv2/api_op_ListContacts.go | 85 +++++++++++++++++ ...op_ListCustomVerificationEmailTemplates.go | 88 ++++++++++++++++++ service/sesv2/api_op_ListDedicatedIpPools.go | 86 +++++++++++++++++ .../api_op_ListDeliverabilityTestReports.go | 88 ++++++++++++++++++ ...pi_op_ListDomainDeliverabilityCampaigns.go | 87 +++++++++++++++++ service/sesv2/api_op_ListEmailIdentities.go | 87 +++++++++++++++++ service/sesv2/api_op_ListEmailTemplates.go | 87 +++++++++++++++++ service/sesv2/api_op_ListImportJobs.go | 85 +++++++++++++++++ .../api_op_ListSuppressedDestinations.go | 87 +++++++++++++++++ service/sesv2/endpoints.go | 5 +- service/sfn/api_op_GetExecutionHistory.go | 87 +++++++++++++++++ service/sfn/api_op_ListActivities.go | 86 +++++++++++++++++ service/sfn/api_op_ListExecutions.go | 86 +++++++++++++++++ service/sfn/api_op_ListStateMachines.go | 86 +++++++++++++++++ service/sfn/endpoints.go | 5 +- service/shield/api_op_ListAttacks.go | 86 +++++++++++++++++ service/shield/api_op_ListProtections.go | 87 +++++++++++++++++ service/shield/endpoints.go | 5 +- service/signer/api_op_ListSigningJobs.go | 85 +++++++++++++++++ service/signer/api_op_ListSigningPlatforms.go | 83 +++++++++++++++++ service/signer/api_op_ListSigningProfiles.go | 83 +++++++++++++++++ service/signer/endpoints.go | 5 +- service/sms/api_op_GetConnectors.go | 83 +++++++++++++++++ service/sms/api_op_GetReplicationJobs.go | 85 +++++++++++++++++ service/sms/api_op_GetReplicationRuns.go | 85 +++++++++++++++++ service/sms/api_op_GetServers.go | 83 +++++++++++++++++ service/sms/endpoints.go | 5 +- service/snowball/api_op_DescribeAddresses.go | 82 ++++++++++++++++ service/snowball/api_op_ListJobs.go | 81 ++++++++++++++++ service/snowball/endpoints.go | 5 +- ...i_op_ListEndpointsByPlatformApplication.go | 77 +++++++++++++++ .../sns/api_op_ListPlatformApplications.go | 77 +++++++++++++++ service/sns/api_op_ListSubscriptions.go | 75 +++++++++++++++ .../sns/api_op_ListSubscriptionsByTopic.go | 77 +++++++++++++++ service/sns/api_op_ListTopics.go | 74 +++++++++++++++ service/sns/endpoints.go | 5 +- .../sqs/api_op_ListDeadLetterSourceQueues.go | 85 +++++++++++++++++ service/sqs/api_op_ListQueues.go | 82 ++++++++++++++++ service/sqs/endpoints.go | 5 +- service/ssm/api_op_DescribeActivations.go | 84 +++++++++++++++++ ..._op_DescribeAssociationExecutionTargets.go | 85 +++++++++++++++++ .../api_op_DescribeAssociationExecutions.go | 85 +++++++++++++++++ .../api_op_DescribeAutomationExecutions.go | 85 +++++++++++++++++ ...api_op_DescribeAutomationStepExecutions.go | 85 +++++++++++++++++ .../ssm/api_op_DescribeAvailablePatches.go | 84 +++++++++++++++++ ...p_DescribeEffectiveInstanceAssociations.go | 85 +++++++++++++++++ ...escribeEffectivePatchesForPatchBaseline.go | 84 +++++++++++++++++ ...i_op_DescribeInstanceAssociationsStatus.go | 85 +++++++++++++++++ .../ssm/api_op_DescribeInstanceInformation.go | 85 +++++++++++++++++ .../ssm/api_op_DescribeInstancePatchStates.go | 84 +++++++++++++++++ ...escribeInstancePatchStatesForPatchGroup.go | 84 +++++++++++++++++ service/ssm/api_op_DescribeInstancePatches.go | 84 +++++++++++++++++ .../ssm/api_op_DescribeInventoryDeletions.go | 85 +++++++++++++++++ ...intenanceWindowExecutionTaskInvocations.go | 86 +++++++++++++++++ ...DescribeMaintenanceWindowExecutionTasks.go | 85 +++++++++++++++++ ..._op_DescribeMaintenanceWindowExecutions.go | 85 +++++++++++++++++ ...pi_op_DescribeMaintenanceWindowSchedule.go | 85 +++++++++++++++++ ...api_op_DescribeMaintenanceWindowTargets.go | 85 +++++++++++++++++ .../api_op_DescribeMaintenanceWindowTasks.go | 85 +++++++++++++++++ .../ssm/api_op_DescribeMaintenanceWindows.go | 85 +++++++++++++++++ ..._op_DescribeMaintenanceWindowsForTarget.go | 85 +++++++++++++++++ service/ssm/api_op_DescribeOpsItems.go | 83 +++++++++++++++++ service/ssm/api_op_DescribeParameters.go | 84 +++++++++++++++++ service/ssm/api_op_DescribePatchBaselines.go | 83 +++++++++++++++++ service/ssm/api_op_DescribePatchGroups.go | 83 +++++++++++++++++ service/ssm/api_op_DescribePatchProperties.go | 85 +++++++++++++++++ service/ssm/api_op_DescribeSessions.go | 83 +++++++++++++++++ service/ssm/api_op_GetInventory.go | 82 ++++++++++++++++ service/ssm/api_op_GetInventorySchema.go | 84 +++++++++++++++++ service/ssm/api_op_GetOpsSummary.go | 82 ++++++++++++++++ service/ssm/api_op_GetParameterHistory.go | 84 +++++++++++++++++ service/ssm/api_op_GetParametersByPath.go | 84 +++++++++++++++++ service/ssm/api_op_ListAssociationVersions.go | 85 +++++++++++++++++ service/ssm/api_op_ListAssociations.go | 83 +++++++++++++++++ service/ssm/api_op_ListCommandInvocations.go | 85 +++++++++++++++++ service/ssm/api_op_ListCommands.go | 83 +++++++++++++++++ service/ssm/api_op_ListComplianceItems.go | 84 +++++++++++++++++ service/ssm/api_op_ListComplianceSummaries.go | 86 +++++++++++++++++ service/ssm/api_op_ListDocumentVersions.go | 84 +++++++++++++++++ service/ssm/api_op_ListDocuments.go | 82 ++++++++++++++++ .../api_op_ListResourceComplianceSummaries.go | 85 +++++++++++++++++ service/ssm/api_op_ListResourceDataSync.go | 84 +++++++++++++++++ service/ssm/endpoints.go | 5 +- service/sso/api_op_ListAccountRoles.go | 82 ++++++++++++++++ service/sso/api_op_ListAccounts.go | 81 ++++++++++++++++ service/sso/endpoints.go | 5 +- ..._op_ListAccountAssignmentCreationStatus.go | 84 +++++++++++++++++ ..._op_ListAccountAssignmentDeletionStatus.go | 84 +++++++++++++++++ .../ssoadmin/api_op_ListAccountAssignments.go | 83 +++++++++++++++++ ...ListAccountsForProvisionedPermissionSet.go | 84 +++++++++++++++++ service/ssoadmin/api_op_ListInstances.go | 81 ++++++++++++++++ ...i_op_ListManagedPoliciesInPermissionSet.go | 84 +++++++++++++++++ ..._op_ListPermissionSetProvisioningStatus.go | 84 +++++++++++++++++ service/ssoadmin/api_op_ListPermissionSets.go | 83 +++++++++++++++++ ..._ListPermissionSetsProvisionedToAccount.go | 84 +++++++++++++++++ .../ssoadmin/api_op_ListTagsForResource.go | 76 +++++++++++++++ service/ssoadmin/endpoints.go | 5 +- service/ssooidc/endpoints.go | 5 +- .../api_op_DescribeTapeArchives.go | 84 +++++++++++++++++ .../api_op_DescribeTapeRecoveryPoints.go | 85 +++++++++++++++++ .../storagegateway/api_op_DescribeTapes.go | 82 ++++++++++++++++ .../api_op_DescribeVTLDevices.go | 84 +++++++++++++++++ .../storagegateway/api_op_ListFileShares.go | 83 +++++++++++++++++ service/storagegateway/api_op_ListGateways.go | 82 ++++++++++++++++ .../api_op_ListTagsForResource.go | 84 +++++++++++++++++ service/storagegateway/api_op_ListTapes.go | 81 ++++++++++++++++ service/storagegateway/api_op_ListVolumes.go | 82 ++++++++++++++++ service/storagegateway/endpoints.go | 5 +- service/sts/endpoints.go | 5 +- service/support/api_op_DescribeCases.go | 81 ++++++++++++++++ .../support/api_op_DescribeCommunications.go | 83 +++++++++++++++++ service/support/endpoints.go | 5 +- .../swf/api_op_GetWorkflowExecutionHistory.go | 85 +++++++++++++++++ service/swf/api_op_ListActivityTypes.go | 83 +++++++++++++++++ .../api_op_ListClosedWorkflowExecutions.go | 85 +++++++++++++++++ service/swf/api_op_ListDomains.go | 82 ++++++++++++++++ .../swf/api_op_ListOpenWorkflowExecutions.go | 85 +++++++++++++++++ service/swf/api_op_ListWorkflowTypes.go | 83 +++++++++++++++++ service/swf/api_op_PollForDecisionTask.go | 85 +++++++++++++++++ service/swf/endpoints.go | 5 +- service/synthetics/api_op_DescribeCanaries.go | 84 +++++++++++++++++ .../api_op_DescribeCanariesLastRun.go | 86 +++++++++++++++++ .../api_op_DescribeRuntimeVersions.go | 86 +++++++++++++++++ service/synthetics/api_op_GetCanaryRuns.go | 82 ++++++++++++++++ service/synthetics/endpoints.go | 5 +- service/textract/endpoints.go | 5 +- service/timestreamquery/api_op_Query.go | 83 +++++++++++++++++ service/timestreamquery/endpoints.go | 5 +- .../timestreamwrite/api_op_ListDatabases.go | 84 +++++++++++++++++ service/timestreamwrite/api_op_ListTables.go | 84 +++++++++++++++++ service/timestreamwrite/endpoints.go | 5 +- .../transcribe/api_op_ListLanguageModels.go | 84 +++++++++++++++++ .../api_op_ListMedicalTranscriptionJobs.go | 86 +++++++++++++++++ .../api_op_ListMedicalVocabularies.go | 84 +++++++++++++++++ .../api_op_ListTranscriptionJobs.go | 84 +++++++++++++++++ service/transcribe/api_op_ListVocabularies.go | 83 +++++++++++++++++ .../api_op_ListVocabularyFilters.go | 84 +++++++++++++++++ service/transcribe/endpoints.go | 5 +- .../transfer/api_op_ListSecurityPolicies.go | 84 +++++++++++++++++ service/transfer/api_op_ListServers.go | 82 ++++++++++++++++ .../transfer/api_op_ListTagsForResource.go | 84 +++++++++++++++++ service/transfer/api_op_ListUsers.go | 81 ++++++++++++++++ service/transfer/endpoints.go | 5 +- service/translate/api_op_ListTerminologies.go | 82 ++++++++++++++++ .../api_op_ListTextTranslationJobs.go | 84 +++++++++++++++++ service/translate/endpoints.go | 5 +- service/waf/endpoints.go | 5 +- service/wafregional/endpoints.go | 5 +- service/wafv2/endpoints.go | 5 +- .../api_op_DescribeDocumentVersions.go | 84 +++++++++++++++++ .../workdocs/api_op_DescribeFolderContents.go | 83 +++++++++++++++++ service/workdocs/api_op_DescribeUsers.go | 81 ++++++++++++++++ service/workdocs/endpoints.go | 5 +- service/worklink/api_op_ListDevices.go | 81 ++++++++++++++++ service/worklink/api_op_ListDomains.go | 81 ++++++++++++++++ service/worklink/api_op_ListFleets.go | 81 ++++++++++++++++ ...pi_op_ListWebsiteAuthorizationProviders.go | 84 +++++++++++++++++ ...pi_op_ListWebsiteCertificateAuthorities.go | 84 +++++++++++++++++ service/worklink/endpoints.go | 5 +- service/workmail/api_op_ListAliases.go | 81 ++++++++++++++++ service/workmail/api_op_ListGroupMembers.go | 82 ++++++++++++++++ service/workmail/api_op_ListGroups.go | 81 ++++++++++++++++ .../workmail/api_op_ListMailboxExportJobs.go | 83 +++++++++++++++++ .../workmail/api_op_ListMailboxPermissions.go | 83 +++++++++++++++++ service/workmail/api_op_ListOrganizations.go | 82 ++++++++++++++++ .../workmail/api_op_ListResourceDelegates.go | 83 +++++++++++++++++ service/workmail/api_op_ListResources.go | 81 ++++++++++++++++ service/workmail/api_op_ListUsers.go | 81 ++++++++++++++++ service/workmail/endpoints.go | 5 +- service/workmailmessageflow/endpoints.go | 5 +- .../api_op_DescribeWorkspaceBundles.go | 77 +++++++++++++++ .../api_op_DescribeWorkspaceDirectories.go | 77 +++++++++++++++ .../workspaces/api_op_DescribeWorkspaces.go | 83 +++++++++++++++++ service/workspaces/endpoints.go | 5 +- service/xray/api_op_BatchGetTraces.go | 75 +++++++++++++++ service/xray/api_op_GetGroups.go | 74 +++++++++++++++ service/xray/api_op_GetSamplingRules.go | 75 +++++++++++++++ .../api_op_GetSamplingStatisticSummaries.go | 77 +++++++++++++++ service/xray/api_op_GetServiceGraph.go | 75 +++++++++++++++ .../api_op_GetTimeSeriesServiceStatistics.go | 77 +++++++++++++++ service/xray/api_op_GetTraceGraph.go | 74 +++++++++++++++ service/xray/api_op_GetTraceSummaries.go | 75 +++++++++++++++ service/xray/endpoints.go | 5 +- 1493 files changed, 104735 insertions(+), 763 deletions(-) diff --git a/internal/protocoltest/awsrestjson/api_op_JsonMaps.go b/internal/protocoltest/awsrestjson/api_op_JsonMaps.go index db640bab3e1..a9344a3c41f 100644 --- a/internal/protocoltest/awsrestjson/api_op_JsonMaps.go +++ b/internal/protocoltest/awsrestjson/api_op_JsonMaps.go @@ -27,11 +27,11 @@ func (c *Client) JsonMaps(ctx context.Context, params *JsonMapsInput, optFns ... } type JsonMapsInput struct { - MyMap map[string]types.GreetingStruct + MyMap map[string]*types.GreetingStruct } type JsonMapsOutput struct { - MyMap map[string]types.GreetingStruct + MyMap map[string]*types.GreetingStruct // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/internal/protocoltest/awsrestjson/api_op_JsonMaps_test.go b/internal/protocoltest/awsrestjson/api_op_JsonMaps_test.go index 864c66ab379..6c7990df218 100644 --- a/internal/protocoltest/awsrestjson/api_op_JsonMaps_test.go +++ b/internal/protocoltest/awsrestjson/api_op_JsonMaps_test.go @@ -39,7 +39,7 @@ func TestClient_JsonMaps_awsRestjson1Serialize(t *testing.T) { // Serializes JSON maps "RestJsonJsonMaps": { Params: &JsonMapsInput{ - MyMap: map[string]types.GreetingStruct{ + MyMap: map[string]*types.GreetingStruct{ "foo": { Hi: ptr.String("there"), }, @@ -71,8 +71,8 @@ func TestClient_JsonMaps_awsRestjson1Serialize(t *testing.T) { // Serializes null JSON map values "RestJsonSerializesNullMapValues": { Params: &JsonMapsInput{ - MyMap: map[string]types.GreetingStruct{ - "foo": func() (v types.GreetingStruct) { return v }(), + MyMap: map[string]*types.GreetingStruct{ + "foo": nil, }, }, ExpectMethod: "POST", @@ -187,7 +187,7 @@ func TestClient_JsonMaps_awsRestjson1Deserialize(t *testing.T) { } }`), ExpectResult: &JsonMapsOutput{ - MyMap: map[string]types.GreetingStruct{ + MyMap: map[string]*types.GreetingStruct{ "foo": { Hi: ptr.String("there"), }, @@ -210,8 +210,8 @@ func TestClient_JsonMaps_awsRestjson1Deserialize(t *testing.T) { } }`), ExpectResult: &JsonMapsOutput{ - MyMap: map[string]types.GreetingStruct{ - "foo": func() (v types.GreetingStruct) { return v }(), + MyMap: map[string]*types.GreetingStruct{ + "foo": nil, }, }, }, diff --git a/internal/protocoltest/awsrestjson/deserializers.go b/internal/protocoltest/awsrestjson/deserializers.go index 7ad6f917f12..00dc9090ba1 100644 --- a/internal/protocoltest/awsrestjson/deserializers.go +++ b/internal/protocoltest/awsrestjson/deserializers.go @@ -4914,7 +4914,7 @@ func awsRestjson1_deserializeDocumentInvalidGreeting(v **types.InvalidGreeting, return nil } -func awsRestjson1_deserializeDocumentJsonMapsInputOutputMap(v *map[string]types.GreetingStruct, value interface{}) error { +func awsRestjson1_deserializeDocumentJsonMapsInputOutputMap(v *map[string]*types.GreetingStruct, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4927,21 +4927,20 @@ func awsRestjson1_deserializeDocumentJsonMapsInputOutputMap(v *map[string]types. return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.GreetingStruct + var mv map[string]*types.GreetingStruct if *v == nil { - mv = map[string]types.GreetingStruct{} + mv = map[string]*types.GreetingStruct{} } else { mv = *v } for key, value := range shape { - var parsedVal types.GreetingStruct + var parsedVal *types.GreetingStruct mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentGreetingStruct(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentGreetingStruct(&mapVar, value); err != nil { return err } - parsedVal = *destAddr + parsedVal = mapVar mv[key] = parsedVal } diff --git a/internal/protocoltest/awsrestjson/endpoints.go b/internal/protocoltest/awsrestjson/endpoints.go index 741d412fb36..3b5acfbc38e 100644 --- a/internal/protocoltest/awsrestjson/endpoints.go +++ b/internal/protocoltest/awsrestjson/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/awsrestjson/serializers.go b/internal/protocoltest/awsrestjson/serializers.go index d8a74579c1d..5cc26ebf385 100644 --- a/internal/protocoltest/awsrestjson/serializers.go +++ b/internal/protocoltest/awsrestjson/serializers.go @@ -2893,14 +2893,17 @@ func awsRestjson1_serializeDocumentDocument(v smithy.Document, value smithyjson. return nil } -func awsRestjson1_serializeDocumentJsonMapsInputOutputMap(v map[string]types.GreetingStruct, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentJsonMapsInputOutputMap(v map[string]*types.GreetingStruct, value smithyjson.Value) error { object := value.Object() defer object.Close() for key := range v { om := object.Key(key) - mapVar := v[key] - if err := awsRestjson1_serializeDocumentGreetingStruct(&mapVar, om); err != nil { + if vv := v[key]; vv == nil { + om.Null() + continue + } + if err := awsRestjson1_serializeDocumentGreetingStruct(v[key], om); err != nil { return err } } diff --git a/internal/protocoltest/awsrestjson/types/enums.go b/internal/protocoltest/awsrestjson/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/awsrestjson/types/enums.go +++ b/internal/protocoltest/awsrestjson/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/ec2query/endpoints.go b/internal/protocoltest/ec2query/endpoints.go index 7db349a64b2..0c29b9a4245 100644 --- a/internal/protocoltest/ec2query/endpoints.go +++ b/internal/protocoltest/ec2query/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/ec2query/types/enums.go b/internal/protocoltest/ec2query/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/ec2query/types/enums.go +++ b/internal/protocoltest/ec2query/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/jsonrpc/endpoints.go b/internal/protocoltest/jsonrpc/endpoints.go index 26c2825f9d7..0a81b1027fd 100644 --- a/internal/protocoltest/jsonrpc/endpoints.go +++ b/internal/protocoltest/jsonrpc/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/jsonrpc/types/enums.go b/internal/protocoltest/jsonrpc/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/jsonrpc/types/enums.go +++ b/internal/protocoltest/jsonrpc/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/jsonrpc10/endpoints.go b/internal/protocoltest/jsonrpc10/endpoints.go index 5cdfd590df1..85c00d95639 100644 --- a/internal/protocoltest/jsonrpc10/endpoints.go +++ b/internal/protocoltest/jsonrpc10/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/jsonrpc10/types/enums.go b/internal/protocoltest/jsonrpc10/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/jsonrpc10/types/enums.go +++ b/internal/protocoltest/jsonrpc10/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/query/endpoints.go b/internal/protocoltest/query/endpoints.go index 8ab32ef2011..50dabcd23ad 100644 --- a/internal/protocoltest/query/endpoints.go +++ b/internal/protocoltest/query/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/query/types/enums.go b/internal/protocoltest/query/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/query/types/enums.go +++ b/internal/protocoltest/query/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/internal/protocoltest/restxml/endpoints.go b/internal/protocoltest/restxml/endpoints.go index e39785eb327..5a73879fc31 100644 --- a/internal/protocoltest/restxml/endpoints.go +++ b/internal/protocoltest/restxml/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/internal/protocoltest/restxml/types/enums.go b/internal/protocoltest/restxml/types/enums.go index 0cd80d8cc7a..a0088b218b8 100644 --- a/internal/protocoltest/restxml/types/enums.go +++ b/internal/protocoltest/restxml/types/enums.go @@ -6,11 +6,11 @@ type FooEnum string // Enum values for FooEnum const ( - FooEnumFoo FooEnum = "Foo" - FooEnumBaz FooEnum = "Baz" - FooEnumBar FooEnum = "Bar" - FooEnum1 FooEnum = "1" - FooEnum0 FooEnum = "0" + FooEnumFoo FooEnum = "Foo" + FooEnumBaz FooEnum = "Baz" + FooEnumBar FooEnum = "Bar" + FooEnumOne FooEnum = "1" + FooEnumZero FooEnum = "0" ) // Values returns all known values for FooEnum. Note that this can be expanded in diff --git a/service/accessanalyzer/api_op_ListAnalyzedResources.go b/service/accessanalyzer/api_op_ListAnalyzedResources.go index 25aaebe41ab..e2e8976c7f4 100644 --- a/service/accessanalyzer/api_op_ListAnalyzedResources.go +++ b/service/accessanalyzer/api_op_ListAnalyzedResources.go @@ -4,6 +4,7 @@ package accessanalyzer 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/accessanalyzer/types" @@ -121,6 +122,88 @@ func addOperationListAnalyzedResourcesMiddlewares(stack *middleware.Stack, optio return nil } +// ListAnalyzedResourcesAPIClient is a client that implements the +// ListAnalyzedResources operation. +type ListAnalyzedResourcesAPIClient interface { + ListAnalyzedResources(context.Context, *ListAnalyzedResourcesInput, ...func(*Options)) (*ListAnalyzedResourcesOutput, error) +} + +var _ ListAnalyzedResourcesAPIClient = (*Client)(nil) + +// ListAnalyzedResourcesPaginatorOptions is the paginator options for +// ListAnalyzedResources +type ListAnalyzedResourcesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListAnalyzedResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListAnalyzedResources +type ListAnalyzedResourcesPaginator struct { + options ListAnalyzedResourcesPaginatorOptions + client ListAnalyzedResourcesAPIClient + params *ListAnalyzedResourcesInput + nextToken *string + firstPage bool +} + +// NewListAnalyzedResourcesPaginator returns a new ListAnalyzedResourcesPaginator +func NewListAnalyzedResourcesPaginator(client ListAnalyzedResourcesAPIClient, params *ListAnalyzedResourcesInput, optFns ...func(*ListAnalyzedResourcesPaginatorOptions)) *ListAnalyzedResourcesPaginator { + options := ListAnalyzedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalyzedResourcesInput{} + } + + return &ListAnalyzedResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalyzedResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAnalyzedResources page. +func (p *ListAnalyzedResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalyzedResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAnalyzedResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAnalyzedResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/accessanalyzer/api_op_ListAnalyzers.go b/service/accessanalyzer/api_op_ListAnalyzers.go index 067448529e6..fac57905479 100644 --- a/service/accessanalyzer/api_op_ListAnalyzers.go +++ b/service/accessanalyzer/api_op_ListAnalyzers.go @@ -4,6 +4,7 @@ package accessanalyzer 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/accessanalyzer/types" @@ -108,3 +109,83 @@ func addOperationListAnalyzersMiddlewares(stack *middleware.Stack, options Optio } return nil } + +// ListAnalyzersAPIClient is a client that implements the ListAnalyzers operation. +type ListAnalyzersAPIClient interface { + ListAnalyzers(context.Context, *ListAnalyzersInput, ...func(*Options)) (*ListAnalyzersOutput, error) +} + +var _ ListAnalyzersAPIClient = (*Client)(nil) + +// ListAnalyzersPaginatorOptions is the paginator options for ListAnalyzers +type ListAnalyzersPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListAnalyzersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListAnalyzers +type ListAnalyzersPaginator struct { + options ListAnalyzersPaginatorOptions + client ListAnalyzersAPIClient + params *ListAnalyzersInput + nextToken *string + firstPage bool +} + +// NewListAnalyzersPaginator returns a new ListAnalyzersPaginator +func NewListAnalyzersPaginator(client ListAnalyzersAPIClient, params *ListAnalyzersInput, optFns ...func(*ListAnalyzersPaginatorOptions)) *ListAnalyzersPaginator { + options := ListAnalyzersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalyzersInput{} + } + + return &ListAnalyzersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalyzersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAnalyzers page. +func (p *ListAnalyzersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalyzersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAnalyzers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/accessanalyzer/api_op_ListArchiveRules.go b/service/accessanalyzer/api_op_ListArchiveRules.go index 9538c57050a..05883488914 100644 --- a/service/accessanalyzer/api_op_ListArchiveRules.go +++ b/service/accessanalyzer/api_op_ListArchiveRules.go @@ -4,6 +4,7 @@ package accessanalyzer 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/accessanalyzer/types" @@ -113,3 +114,84 @@ func addOperationListArchiveRulesMiddlewares(stack *middleware.Stack, options Op } return nil } + +// ListArchiveRulesAPIClient is a client that implements the ListArchiveRules +// operation. +type ListArchiveRulesAPIClient interface { + ListArchiveRules(context.Context, *ListArchiveRulesInput, ...func(*Options)) (*ListArchiveRulesOutput, error) +} + +var _ ListArchiveRulesAPIClient = (*Client)(nil) + +// ListArchiveRulesPaginatorOptions is the paginator options for ListArchiveRules +type ListArchiveRulesPaginatorOptions struct { + // The maximum number of results to return in the request. + 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 +} + +// ListArchiveRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListArchiveRules +type ListArchiveRulesPaginator struct { + options ListArchiveRulesPaginatorOptions + client ListArchiveRulesAPIClient + params *ListArchiveRulesInput + nextToken *string + firstPage bool +} + +// NewListArchiveRulesPaginator returns a new ListArchiveRulesPaginator +func NewListArchiveRulesPaginator(client ListArchiveRulesAPIClient, params *ListArchiveRulesInput, optFns ...func(*ListArchiveRulesPaginatorOptions)) *ListArchiveRulesPaginator { + options := ListArchiveRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListArchiveRulesInput{} + } + + return &ListArchiveRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListArchiveRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListArchiveRules page. +func (p *ListArchiveRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListArchiveRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListArchiveRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/accessanalyzer/api_op_ListFindings.go b/service/accessanalyzer/api_op_ListFindings.go index fa7c106df92..cf36b2f558b 100644 --- a/service/accessanalyzer/api_op_ListFindings.go +++ b/service/accessanalyzer/api_op_ListFindings.go @@ -4,6 +4,7 @@ package accessanalyzer 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/accessanalyzer/types" @@ -124,6 +125,86 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/accessanalyzer.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/accessanalyzer/endpoints.go b/service/accessanalyzer/endpoints.go index 22d7bd4ce99..9d3cd4facdf 100644 --- a/service/accessanalyzer/endpoints.go +++ b/service/accessanalyzer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/acm/api_op_ListCertificates.go b/service/acm/api_op_ListCertificates.go index 662db8986ed..867aa66c1c3 100644 --- a/service/acm/api_op_ListCertificates.go +++ b/service/acm/api_op_ListCertificates.go @@ -4,6 +4,7 @@ package acm 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/acm/types" @@ -120,6 +121,90 @@ func addOperationListCertificatesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListCertificatesAPIClient is a client that implements the ListCertificates +// operation. +type ListCertificatesAPIClient interface { + ListCertificates(context.Context, *ListCertificatesInput, ...func(*Options)) (*ListCertificatesOutput, error) +} + +var _ ListCertificatesAPIClient = (*Client)(nil) + +// ListCertificatesPaginatorOptions is the paginator options for ListCertificates +type ListCertificatesPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + 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 +} + +// ListCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acm.ListCertificates +type ListCertificatesPaginator struct { + options ListCertificatesPaginatorOptions + client ListCertificatesAPIClient + params *ListCertificatesInput + nextToken *string + firstPage bool +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesInput{} + } + + return &ListCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCertificates page. +func (p *ListCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acm/endpoints.go b/service/acm/endpoints.go index b612c627b67..aecc05e83e1 100644 --- a/service/acm/endpoints.go +++ b/service/acm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/acmpca/api_op_ListCertificateAuthorities.go b/service/acmpca/api_op_ListCertificateAuthorities.go index 79e81ae48e0..e56bb972472 100644 --- a/service/acmpca/api_op_ListCertificateAuthorities.go +++ b/service/acmpca/api_op_ListCertificateAuthorities.go @@ -4,6 +4,7 @@ package acmpca 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/acmpca/types" @@ -118,6 +119,92 @@ func addOperationListCertificateAuthoritiesMiddlewares(stack *middleware.Stack, return nil } +// ListCertificateAuthoritiesAPIClient is a client that implements the +// ListCertificateAuthorities operation. +type ListCertificateAuthoritiesAPIClient interface { + ListCertificateAuthorities(context.Context, *ListCertificateAuthoritiesInput, ...func(*Options)) (*ListCertificateAuthoritiesOutput, error) +} + +var _ ListCertificateAuthoritiesAPIClient = (*Client)(nil) + +// ListCertificateAuthoritiesPaginatorOptions is the paginator options for +// ListCertificateAuthorities +type ListCertificateAuthoritiesPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response on each page. If additional items exist beyond + // the number you specify, the NextToken element is sent in the response. Use this + // NextToken value in a subsequent request to retrieve additional items. + 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 +} + +// ListCertificateAuthoritiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListCertificateAuthorities +type ListCertificateAuthoritiesPaginator struct { + options ListCertificateAuthoritiesPaginatorOptions + client ListCertificateAuthoritiesAPIClient + params *ListCertificateAuthoritiesInput + nextToken *string + firstPage bool +} + +// NewListCertificateAuthoritiesPaginator returns a new +// ListCertificateAuthoritiesPaginator +func NewListCertificateAuthoritiesPaginator(client ListCertificateAuthoritiesAPIClient, params *ListCertificateAuthoritiesInput, optFns ...func(*ListCertificateAuthoritiesPaginatorOptions)) *ListCertificateAuthoritiesPaginator { + options := ListCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificateAuthoritiesInput{} + } + + return &ListCertificateAuthoritiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificateAuthoritiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCertificateAuthorities page. +func (p *ListCertificateAuthoritiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificateAuthoritiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCertificateAuthorities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificateAuthorities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/api_op_ListPermissions.go b/service/acmpca/api_op_ListPermissions.go index e4f131c8f62..e387847d81c 100644 --- a/service/acmpca/api_op_ListPermissions.go +++ b/service/acmpca/api_op_ListPermissions.go @@ -4,6 +4,7 @@ package acmpca 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/acmpca/types" @@ -148,6 +149,90 @@ func addOperationListPermissionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListPermissionsAPIClient is a client that implements the ListPermissions +// operation. +type ListPermissionsAPIClient interface { + ListPermissions(context.Context, *ListPermissionsInput, ...func(*Options)) (*ListPermissionsOutput, error) +} + +var _ ListPermissionsAPIClient = (*Client)(nil) + +// ListPermissionsPaginatorOptions is the paginator options for ListPermissions +type ListPermissionsPaginatorOptions struct { + // When paginating results, use this parameter to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + 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 +} + +// ListPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListPermissions +type ListPermissionsPaginator struct { + options ListPermissionsPaginatorOptions + client ListPermissionsAPIClient + params *ListPermissionsInput + nextToken *string + firstPage bool +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionsInput{} + } + + return &ListPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPermissions page. +func (p *ListPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/api_op_ListTags.go b/service/acmpca/api_op_ListTags.go index 30f3e13adfc..ae4bc45cdd7 100644 --- a/service/acmpca/api_op_ListTags.go +++ b/service/acmpca/api_op_ListTags.go @@ -4,6 +4,7 @@ package acmpca 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/acmpca/types" @@ -130,6 +131,89 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // Use this parameter when paginating results to specify the maximum number of + // items to return in the response. If additional items exist beyond the number you + // specify, the NextToken element is sent in the response. Use this NextToken value + // in a subsequent request to retrieve additional items. + 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/acmpca.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/acmpca/endpoints.go b/service/acmpca/endpoints.go index f7271d15da9..2dab1dc5641 100644 --- a/service/acmpca/endpoints.go +++ b/service/acmpca/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go b/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go index 38b5d1733a0..5ff52fba9b6 100644 --- a/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go +++ b/service/alexaforbusiness/api_op_ListBusinessReportSchedules.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -107,6 +108,89 @@ func addOperationListBusinessReportSchedulesMiddlewares(stack *middleware.Stack, return nil } +// ListBusinessReportSchedulesAPIClient is a client that implements the +// ListBusinessReportSchedules operation. +type ListBusinessReportSchedulesAPIClient interface { + ListBusinessReportSchedules(context.Context, *ListBusinessReportSchedulesInput, ...func(*Options)) (*ListBusinessReportSchedulesOutput, error) +} + +var _ ListBusinessReportSchedulesAPIClient = (*Client)(nil) + +// ListBusinessReportSchedulesPaginatorOptions is the paginator options for +// ListBusinessReportSchedules +type ListBusinessReportSchedulesPaginatorOptions struct { + // The maximum number of schedules listed in the call. + 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 +} + +// ListBusinessReportSchedulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListBusinessReportSchedules +type ListBusinessReportSchedulesPaginator struct { + options ListBusinessReportSchedulesPaginatorOptions + client ListBusinessReportSchedulesAPIClient + params *ListBusinessReportSchedulesInput + nextToken *string + firstPage bool +} + +// NewListBusinessReportSchedulesPaginator returns a new +// ListBusinessReportSchedulesPaginator +func NewListBusinessReportSchedulesPaginator(client ListBusinessReportSchedulesAPIClient, params *ListBusinessReportSchedulesInput, optFns ...func(*ListBusinessReportSchedulesPaginatorOptions)) *ListBusinessReportSchedulesPaginator { + options := ListBusinessReportSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBusinessReportSchedulesInput{} + } + + return &ListBusinessReportSchedulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBusinessReportSchedulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBusinessReportSchedules page. +func (p *ListBusinessReportSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBusinessReportSchedulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBusinessReportSchedules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBusinessReportSchedules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListConferenceProviders.go b/service/alexaforbusiness/api_op_ListConferenceProviders.go index f561d0e9448..287548784d8 100644 --- a/service/alexaforbusiness/api_op_ListConferenceProviders.go +++ b/service/alexaforbusiness/api_op_ListConferenceProviders.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -105,6 +106,89 @@ func addOperationListConferenceProvidersMiddlewares(stack *middleware.Stack, opt return nil } +// ListConferenceProvidersAPIClient is a client that implements the +// ListConferenceProviders operation. +type ListConferenceProvidersAPIClient interface { + ListConferenceProviders(context.Context, *ListConferenceProvidersInput, ...func(*Options)) (*ListConferenceProvidersOutput, error) +} + +var _ ListConferenceProvidersAPIClient = (*Client)(nil) + +// ListConferenceProvidersPaginatorOptions is the paginator options for +// ListConferenceProviders +type ListConferenceProvidersPaginatorOptions struct { + // The maximum number of conference providers to be returned, per paginated calls. + 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 +} + +// ListConferenceProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListConferenceProviders +type ListConferenceProvidersPaginator struct { + options ListConferenceProvidersPaginatorOptions + client ListConferenceProvidersAPIClient + params *ListConferenceProvidersInput + nextToken *string + firstPage bool +} + +// NewListConferenceProvidersPaginator returns a new +// ListConferenceProvidersPaginator +func NewListConferenceProvidersPaginator(client ListConferenceProvidersAPIClient, params *ListConferenceProvidersInput, optFns ...func(*ListConferenceProvidersPaginatorOptions)) *ListConferenceProvidersPaginator { + options := ListConferenceProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConferenceProvidersInput{} + } + + return &ListConferenceProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConferenceProvidersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConferenceProviders page. +func (p *ListConferenceProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConferenceProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListConferenceProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConferenceProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListDeviceEvents.go b/service/alexaforbusiness/api_op_ListDeviceEvents.go index 263f28f0a2b..4818fd2a88e 100644 --- a/service/alexaforbusiness/api_op_ListDeviceEvents.go +++ b/service/alexaforbusiness/api_op_ListDeviceEvents.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -125,6 +126,89 @@ func addOperationListDeviceEventsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListDeviceEventsAPIClient is a client that implements the ListDeviceEvents +// operation. +type ListDeviceEventsAPIClient interface { + ListDeviceEvents(context.Context, *ListDeviceEventsInput, ...func(*Options)) (*ListDeviceEventsOutput, error) +} + +var _ ListDeviceEventsAPIClient = (*Client)(nil) + +// ListDeviceEventsPaginatorOptions is the paginator options for ListDeviceEvents +type ListDeviceEventsPaginatorOptions struct { + // The maximum number of results to include in the response. The default value is + // 50. If more results exist than the specified MaxResults value, a token is + // included in the response so that the remaining results can be retrieved. + 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 +} + +// ListDeviceEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListDeviceEvents +type ListDeviceEventsPaginator struct { + options ListDeviceEventsPaginatorOptions + client ListDeviceEventsAPIClient + params *ListDeviceEventsInput + nextToken *string + firstPage bool +} + +// NewListDeviceEventsPaginator returns a new ListDeviceEventsPaginator +func NewListDeviceEventsPaginator(client ListDeviceEventsAPIClient, params *ListDeviceEventsInput, optFns ...func(*ListDeviceEventsPaginatorOptions)) *ListDeviceEventsPaginator { + options := ListDeviceEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeviceEventsInput{} + } + + return &ListDeviceEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeviceEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeviceEvents page. +func (p *ListDeviceEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeviceEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDeviceEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeviceEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListGatewayGroups.go b/service/alexaforbusiness/api_op_ListGatewayGroups.go index 1fcb7b87afb..4213e404eeb 100644 --- a/service/alexaforbusiness/api_op_ListGatewayGroups.go +++ b/service/alexaforbusiness/api_op_ListGatewayGroups.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -106,6 +107,87 @@ func addOperationListGatewayGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// ListGatewayGroupsAPIClient is a client that implements the ListGatewayGroups +// operation. +type ListGatewayGroupsAPIClient interface { + ListGatewayGroups(context.Context, *ListGatewayGroupsInput, ...func(*Options)) (*ListGatewayGroupsOutput, error) +} + +var _ ListGatewayGroupsAPIClient = (*Client)(nil) + +// ListGatewayGroupsPaginatorOptions is the paginator options for ListGatewayGroups +type ListGatewayGroupsPaginatorOptions struct { + // The maximum number of gateway group summaries to return. The default is 50. + 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 +} + +// ListGatewayGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListGatewayGroups +type ListGatewayGroupsPaginator struct { + options ListGatewayGroupsPaginatorOptions + client ListGatewayGroupsAPIClient + params *ListGatewayGroupsInput + nextToken *string + firstPage bool +} + +// NewListGatewayGroupsPaginator returns a new ListGatewayGroupsPaginator +func NewListGatewayGroupsPaginator(client ListGatewayGroupsAPIClient, params *ListGatewayGroupsInput, optFns ...func(*ListGatewayGroupsPaginatorOptions)) *ListGatewayGroupsPaginator { + options := ListGatewayGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewayGroupsInput{} + } + + return &ListGatewayGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewayGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGatewayGroups page. +func (p *ListGatewayGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewayGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGatewayGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGatewayGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListGateways.go b/service/alexaforbusiness/api_op_ListGateways.go index 0736128da8a..974008882d6 100644 --- a/service/alexaforbusiness/api_op_ListGateways.go +++ b/service/alexaforbusiness/api_op_ListGateways.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -110,6 +111,86 @@ func addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Option return nil } +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // The maximum number of gateway summaries to return. The default is 50. + 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 +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkills.go b/service/alexaforbusiness/api_op_ListSkills.go index f5c6bada777..03e829847d6 100644 --- a/service/alexaforbusiness/api_op_ListSkills.go +++ b/service/alexaforbusiness/api_op_ListSkills.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -118,6 +119,88 @@ func addOperationListSkillsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListSkillsAPIClient is a client that implements the ListSkills operation. +type ListSkillsAPIClient interface { + ListSkills(context.Context, *ListSkillsInput, ...func(*Options)) (*ListSkillsOutput, error) +} + +var _ ListSkillsAPIClient = (*Client)(nil) + +// ListSkillsPaginatorOptions is the paginator options for ListSkills +type ListSkillsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// ListSkillsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkills +type ListSkillsPaginator struct { + options ListSkillsPaginatorOptions + client ListSkillsAPIClient + params *ListSkillsInput + nextToken *string + firstPage bool +} + +// NewListSkillsPaginator returns a new ListSkillsPaginator +func NewListSkillsPaginator(client ListSkillsAPIClient, params *ListSkillsInput, optFns ...func(*ListSkillsPaginatorOptions)) *ListSkillsPaginator { + options := ListSkillsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsInput{} + } + + return &ListSkillsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSkills page. +func (p *ListSkillsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSkills(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkills(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go b/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go index 8d0e586be3c..ad24959d789 100644 --- a/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go +++ b/service/alexaforbusiness/api_op_ListSkillsStoreCategories.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -105,6 +106,89 @@ func addOperationListSkillsStoreCategoriesMiddlewares(stack *middleware.Stack, o return nil } +// ListSkillsStoreCategoriesAPIClient is a client that implements the +// ListSkillsStoreCategories operation. +type ListSkillsStoreCategoriesAPIClient interface { + ListSkillsStoreCategories(context.Context, *ListSkillsStoreCategoriesInput, ...func(*Options)) (*ListSkillsStoreCategoriesOutput, error) +} + +var _ ListSkillsStoreCategoriesAPIClient = (*Client)(nil) + +// ListSkillsStoreCategoriesPaginatorOptions is the paginator options for +// ListSkillsStoreCategories +type ListSkillsStoreCategoriesPaginatorOptions struct { + // The maximum number of categories returned, per paginated calls. + 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 +} + +// ListSkillsStoreCategoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkillsStoreCategories +type ListSkillsStoreCategoriesPaginator struct { + options ListSkillsStoreCategoriesPaginatorOptions + client ListSkillsStoreCategoriesAPIClient + params *ListSkillsStoreCategoriesInput + nextToken *string + firstPage bool +} + +// NewListSkillsStoreCategoriesPaginator returns a new +// ListSkillsStoreCategoriesPaginator +func NewListSkillsStoreCategoriesPaginator(client ListSkillsStoreCategoriesAPIClient, params *ListSkillsStoreCategoriesInput, optFns ...func(*ListSkillsStoreCategoriesPaginatorOptions)) *ListSkillsStoreCategoriesPaginator { + options := ListSkillsStoreCategoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsStoreCategoriesInput{} + } + + return &ListSkillsStoreCategoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsStoreCategoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSkillsStoreCategories page. +func (p *ListSkillsStoreCategoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsStoreCategoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSkillsStoreCategories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkillsStoreCategories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go b/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go index acf4e5fedc3..a93af906eaa 100644 --- a/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go +++ b/service/alexaforbusiness/api_op_ListSkillsStoreSkillsByCategory.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -113,6 +114,89 @@ func addOperationListSkillsStoreSkillsByCategoryMiddlewares(stack *middleware.St return nil } +// ListSkillsStoreSkillsByCategoryAPIClient is a client that implements the +// ListSkillsStoreSkillsByCategory operation. +type ListSkillsStoreSkillsByCategoryAPIClient interface { + ListSkillsStoreSkillsByCategory(context.Context, *ListSkillsStoreSkillsByCategoryInput, ...func(*Options)) (*ListSkillsStoreSkillsByCategoryOutput, error) +} + +var _ ListSkillsStoreSkillsByCategoryAPIClient = (*Client)(nil) + +// ListSkillsStoreSkillsByCategoryPaginatorOptions is the paginator options for +// ListSkillsStoreSkillsByCategory +type ListSkillsStoreSkillsByCategoryPaginatorOptions struct { + // The maximum number of skills returned per paginated calls. + 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 +} + +// ListSkillsStoreSkillsByCategoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSkillsStoreSkillsByCategory +type ListSkillsStoreSkillsByCategoryPaginator struct { + options ListSkillsStoreSkillsByCategoryPaginatorOptions + client ListSkillsStoreSkillsByCategoryAPIClient + params *ListSkillsStoreSkillsByCategoryInput + nextToken *string + firstPage bool +} + +// NewListSkillsStoreSkillsByCategoryPaginator returns a new +// ListSkillsStoreSkillsByCategoryPaginator +func NewListSkillsStoreSkillsByCategoryPaginator(client ListSkillsStoreSkillsByCategoryAPIClient, params *ListSkillsStoreSkillsByCategoryInput, optFns ...func(*ListSkillsStoreSkillsByCategoryPaginatorOptions)) *ListSkillsStoreSkillsByCategoryPaginator { + options := ListSkillsStoreSkillsByCategoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSkillsStoreSkillsByCategoryInput{} + } + + return &ListSkillsStoreSkillsByCategoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSkillsStoreSkillsByCategoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSkillsStoreSkillsByCategory page. +func (p *ListSkillsStoreSkillsByCategoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSkillsStoreSkillsByCategoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSkillsStoreSkillsByCategory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSkillsStoreSkillsByCategory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go b/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go index cd641b60f02..0102bd617fd 100644 --- a/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go +++ b/service/alexaforbusiness/api_op_ListSmartHomeAppliances.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -113,6 +114,89 @@ func addOperationListSmartHomeAppliancesMiddlewares(stack *middleware.Stack, opt return nil } +// ListSmartHomeAppliancesAPIClient is a client that implements the +// ListSmartHomeAppliances operation. +type ListSmartHomeAppliancesAPIClient interface { + ListSmartHomeAppliances(context.Context, *ListSmartHomeAppliancesInput, ...func(*Options)) (*ListSmartHomeAppliancesOutput, error) +} + +var _ ListSmartHomeAppliancesAPIClient = (*Client)(nil) + +// ListSmartHomeAppliancesPaginatorOptions is the paginator options for +// ListSmartHomeAppliances +type ListSmartHomeAppliancesPaginatorOptions struct { + // The maximum number of appliances to be returned, per paginated calls. + 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 +} + +// ListSmartHomeAppliancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListSmartHomeAppliances +type ListSmartHomeAppliancesPaginator struct { + options ListSmartHomeAppliancesPaginatorOptions + client ListSmartHomeAppliancesAPIClient + params *ListSmartHomeAppliancesInput + nextToken *string + firstPage bool +} + +// NewListSmartHomeAppliancesPaginator returns a new +// ListSmartHomeAppliancesPaginator +func NewListSmartHomeAppliancesPaginator(client ListSmartHomeAppliancesAPIClient, params *ListSmartHomeAppliancesInput, optFns ...func(*ListSmartHomeAppliancesPaginatorOptions)) *ListSmartHomeAppliancesPaginator { + options := ListSmartHomeAppliancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSmartHomeAppliancesInput{} + } + + return &ListSmartHomeAppliancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSmartHomeAppliancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSmartHomeAppliances page. +func (p *ListSmartHomeAppliancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSmartHomeAppliancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSmartHomeAppliances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSmartHomeAppliances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_ListTags.go b/service/alexaforbusiness/api_op_ListTags.go index 0a58640df79..183164b2442 100644 --- a/service/alexaforbusiness/api_op_ListTags.go +++ b/service/alexaforbusiness/api_op_ListTags.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -117,6 +118,88 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchAddressBooks.go b/service/alexaforbusiness/api_op_SearchAddressBooks.go index 70a46b4b119..865983807b5 100644 --- a/service/alexaforbusiness/api_op_SearchAddressBooks.go +++ b/service/alexaforbusiness/api_op_SearchAddressBooks.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -124,6 +125,90 @@ func addOperationSearchAddressBooksMiddlewares(stack *middleware.Stack, options return nil } +// SearchAddressBooksAPIClient is a client that implements the SearchAddressBooks +// operation. +type SearchAddressBooksAPIClient interface { + SearchAddressBooks(context.Context, *SearchAddressBooksInput, ...func(*Options)) (*SearchAddressBooksOutput, error) +} + +var _ SearchAddressBooksAPIClient = (*Client)(nil) + +// SearchAddressBooksPaginatorOptions is the paginator options for +// SearchAddressBooks +type SearchAddressBooksPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchAddressBooksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchAddressBooks +type SearchAddressBooksPaginator struct { + options SearchAddressBooksPaginatorOptions + client SearchAddressBooksAPIClient + params *SearchAddressBooksInput + nextToken *string + firstPage bool +} + +// NewSearchAddressBooksPaginator returns a new SearchAddressBooksPaginator +func NewSearchAddressBooksPaginator(client SearchAddressBooksAPIClient, params *SearchAddressBooksInput, optFns ...func(*SearchAddressBooksPaginatorOptions)) *SearchAddressBooksPaginator { + options := SearchAddressBooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchAddressBooksInput{} + } + + return &SearchAddressBooksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchAddressBooksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchAddressBooks page. +func (p *SearchAddressBooksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchAddressBooksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchAddressBooks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchAddressBooks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchContacts.go b/service/alexaforbusiness/api_op_SearchContacts.go index 582d3da3c1d..b73c57a69e3 100644 --- a/service/alexaforbusiness/api_op_SearchContacts.go +++ b/service/alexaforbusiness/api_op_SearchContacts.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -124,6 +125,89 @@ func addOperationSearchContactsMiddlewares(stack *middleware.Stack, options Opti return nil } +// SearchContactsAPIClient is a client that implements the SearchContacts +// operation. +type SearchContactsAPIClient interface { + SearchContacts(context.Context, *SearchContactsInput, ...func(*Options)) (*SearchContactsOutput, error) +} + +var _ SearchContactsAPIClient = (*Client)(nil) + +// SearchContactsPaginatorOptions is the paginator options for SearchContacts +type SearchContactsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchContacts +type SearchContactsPaginator struct { + options SearchContactsPaginatorOptions + client SearchContactsAPIClient + params *SearchContactsInput + nextToken *string + firstPage bool +} + +// NewSearchContactsPaginator returns a new SearchContactsPaginator +func NewSearchContactsPaginator(client SearchContactsAPIClient, params *SearchContactsInput, optFns ...func(*SearchContactsPaginatorOptions)) *SearchContactsPaginator { + options := SearchContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchContactsInput{} + } + + return &SearchContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchContactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchContacts page. +func (p *SearchContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchContacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchDevices.go b/service/alexaforbusiness/api_op_SearchDevices.go index a8e91acc7d1..5b2a006eef4 100644 --- a/service/alexaforbusiness/api_op_SearchDevices.go +++ b/service/alexaforbusiness/api_op_SearchDevices.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -127,6 +128,88 @@ func addOperationSearchDevicesMiddlewares(stack *middleware.Stack, options Optio return nil } +// SearchDevicesAPIClient is a client that implements the SearchDevices operation. +type SearchDevicesAPIClient interface { + SearchDevices(context.Context, *SearchDevicesInput, ...func(*Options)) (*SearchDevicesOutput, error) +} + +var _ SearchDevicesAPIClient = (*Client)(nil) + +// SearchDevicesPaginatorOptions is the paginator options for SearchDevices +type SearchDevicesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchDevices +type SearchDevicesPaginator struct { + options SearchDevicesPaginatorOptions + client SearchDevicesAPIClient + params *SearchDevicesInput + nextToken *string + firstPage bool +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDevicesInput{} + } + + return &SearchDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchDevices page. +func (p *SearchDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchNetworkProfiles.go b/service/alexaforbusiness/api_op_SearchNetworkProfiles.go index e8fc994012d..24d1ae34f25 100644 --- a/service/alexaforbusiness/api_op_SearchNetworkProfiles.go +++ b/service/alexaforbusiness/api_op_SearchNetworkProfiles.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -127,6 +128,90 @@ func addOperationSearchNetworkProfilesMiddlewares(stack *middleware.Stack, optio return nil } +// SearchNetworkProfilesAPIClient is a client that implements the +// SearchNetworkProfiles operation. +type SearchNetworkProfilesAPIClient interface { + SearchNetworkProfiles(context.Context, *SearchNetworkProfilesInput, ...func(*Options)) (*SearchNetworkProfilesOutput, error) +} + +var _ SearchNetworkProfilesAPIClient = (*Client)(nil) + +// SearchNetworkProfilesPaginatorOptions is the paginator options for +// SearchNetworkProfiles +type SearchNetworkProfilesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchNetworkProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchNetworkProfiles +type SearchNetworkProfilesPaginator struct { + options SearchNetworkProfilesPaginatorOptions + client SearchNetworkProfilesAPIClient + params *SearchNetworkProfilesInput + nextToken *string + firstPage bool +} + +// NewSearchNetworkProfilesPaginator returns a new SearchNetworkProfilesPaginator +func NewSearchNetworkProfilesPaginator(client SearchNetworkProfilesAPIClient, params *SearchNetworkProfilesInput, optFns ...func(*SearchNetworkProfilesPaginatorOptions)) *SearchNetworkProfilesPaginator { + options := SearchNetworkProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchNetworkProfilesInput{} + } + + return &SearchNetworkProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchNetworkProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchNetworkProfiles page. +func (p *SearchNetworkProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchNetworkProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchNetworkProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchNetworkProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchProfiles.go b/service/alexaforbusiness/api_op_SearchProfiles.go index 441b9c7bb60..bf793374e02 100644 --- a/service/alexaforbusiness/api_op_SearchProfiles.go +++ b/service/alexaforbusiness/api_op_SearchProfiles.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -123,6 +124,89 @@ func addOperationSearchProfilesMiddlewares(stack *middleware.Stack, options Opti return nil } +// SearchProfilesAPIClient is a client that implements the SearchProfiles +// operation. +type SearchProfilesAPIClient interface { + SearchProfiles(context.Context, *SearchProfilesInput, ...func(*Options)) (*SearchProfilesOutput, error) +} + +var _ SearchProfilesAPIClient = (*Client)(nil) + +// SearchProfilesPaginatorOptions is the paginator options for SearchProfiles +type SearchProfilesPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchProfiles +type SearchProfilesPaginator struct { + options SearchProfilesPaginatorOptions + client SearchProfilesAPIClient + params *SearchProfilesInput + nextToken *string + firstPage bool +} + +// NewSearchProfilesPaginator returns a new SearchProfilesPaginator +func NewSearchProfilesPaginator(client SearchProfilesAPIClient, params *SearchProfilesInput, optFns ...func(*SearchProfilesPaginatorOptions)) *SearchProfilesPaginator { + options := SearchProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProfilesInput{} + } + + return &SearchProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchProfiles page. +func (p *SearchProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchRooms.go b/service/alexaforbusiness/api_op_SearchRooms.go index f0d71387c26..8fb643a0296 100644 --- a/service/alexaforbusiness/api_op_SearchRooms.go +++ b/service/alexaforbusiness/api_op_SearchRooms.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -123,6 +124,88 @@ func addOperationSearchRoomsMiddlewares(stack *middleware.Stack, options Options return nil } +// SearchRoomsAPIClient is a client that implements the SearchRooms operation. +type SearchRoomsAPIClient interface { + SearchRooms(context.Context, *SearchRoomsInput, ...func(*Options)) (*SearchRoomsOutput, error) +} + +var _ SearchRoomsAPIClient = (*Client)(nil) + +// SearchRoomsPaginatorOptions is the paginator options for SearchRooms +type SearchRoomsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchRoomsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchRooms +type SearchRoomsPaginator struct { + options SearchRoomsPaginatorOptions + client SearchRoomsAPIClient + params *SearchRoomsInput + nextToken *string + firstPage bool +} + +// NewSearchRoomsPaginator returns a new SearchRoomsPaginator +func NewSearchRoomsPaginator(client SearchRoomsAPIClient, params *SearchRoomsInput, optFns ...func(*SearchRoomsPaginatorOptions)) *SearchRoomsPaginator { + options := SearchRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchRoomsInput{} + } + + return &SearchRoomsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchRoomsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchRooms page. +func (p *SearchRoomsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchRoomsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchRooms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchRooms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchSkillGroups.go b/service/alexaforbusiness/api_op_SearchSkillGroups.go index f55f1ce9094..30b65677da7 100644 --- a/service/alexaforbusiness/api_op_SearchSkillGroups.go +++ b/service/alexaforbusiness/api_op_SearchSkillGroups.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -125,6 +126,89 @@ func addOperationSearchSkillGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// SearchSkillGroupsAPIClient is a client that implements the SearchSkillGroups +// operation. +type SearchSkillGroupsAPIClient interface { + SearchSkillGroups(context.Context, *SearchSkillGroupsInput, ...func(*Options)) (*SearchSkillGroupsOutput, error) +} + +var _ SearchSkillGroupsAPIClient = (*Client)(nil) + +// SearchSkillGroupsPaginatorOptions is the paginator options for SearchSkillGroups +type SearchSkillGroupsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// SearchSkillGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchSkillGroups +type SearchSkillGroupsPaginator struct { + options SearchSkillGroupsPaginatorOptions + client SearchSkillGroupsAPIClient + params *SearchSkillGroupsInput + nextToken *string + firstPage bool +} + +// NewSearchSkillGroupsPaginator returns a new SearchSkillGroupsPaginator +func NewSearchSkillGroupsPaginator(client SearchSkillGroupsAPIClient, params *SearchSkillGroupsInput, optFns ...func(*SearchSkillGroupsPaginatorOptions)) *SearchSkillGroupsPaginator { + options := SearchSkillGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSkillGroupsInput{} + } + + return &SearchSkillGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSkillGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchSkillGroups page. +func (p *SearchSkillGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSkillGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchSkillGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSkillGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/api_op_SearchUsers.go b/service/alexaforbusiness/api_op_SearchUsers.go index 0f07d06b223..e4e4e374780 100644 --- a/service/alexaforbusiness/api_op_SearchUsers.go +++ b/service/alexaforbusiness/api_op_SearchUsers.go @@ -4,6 +4,7 @@ package alexaforbusiness 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/alexaforbusiness/types" @@ -124,6 +125,88 @@ func addOperationSearchUsersMiddlewares(stack *middleware.Stack, options Options return nil } +// SearchUsersAPIClient is a client that implements the SearchUsers operation. +type SearchUsersAPIClient interface { + SearchUsers(context.Context, *SearchUsersInput, ...func(*Options)) (*SearchUsersOutput, error) +} + +var _ SearchUsersAPIClient = (*Client)(nil) + +// SearchUsersPaginatorOptions is the paginator options for SearchUsers +type SearchUsersPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. Required. + 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 +} + +// SearchUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/alexaforbusiness.SearchUsers +type SearchUsersPaginator struct { + options SearchUsersPaginatorOptions + client SearchUsersAPIClient + params *SearchUsersInput + nextToken *string + firstPage bool +} + +// NewSearchUsersPaginator returns a new SearchUsersPaginator +func NewSearchUsersPaginator(client SearchUsersAPIClient, params *SearchUsersInput, optFns ...func(*SearchUsersPaginatorOptions)) *SearchUsersPaginator { + options := SearchUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchUsersInput{} + } + + return &SearchUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchUsers page. +func (p *SearchUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/alexaforbusiness/endpoints.go b/service/alexaforbusiness/endpoints.go index 8989e977800..da3a833e383 100644 --- a/service/alexaforbusiness/endpoints.go +++ b/service/alexaforbusiness/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/amplify/endpoints.go b/service/amplify/endpoints.go index e7a2c4598de..2bd5cb12813 100644 --- a/service/amplify/endpoints.go +++ b/service/amplify/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/apigateway/api_op_GetApiKeys.go b/service/apigateway/api_op_GetApiKeys.go index 6425db29e36..b511f372ab9 100644 --- a/service/apigateway/api_op_GetApiKeys.go +++ b/service/apigateway/api_op_GetApiKeys.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -128,6 +129,87 @@ func addOperationGetApiKeysMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetApiKeysAPIClient is a client that implements the GetApiKeys operation. +type GetApiKeysAPIClient interface { + GetApiKeys(context.Context, *GetApiKeysInput, ...func(*Options)) (*GetApiKeysOutput, error) +} + +var _ GetApiKeysAPIClient = (*Client)(nil) + +// GetApiKeysPaginatorOptions is the paginator options for GetApiKeys +type GetApiKeysPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetApiKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetApiKeys +type GetApiKeysPaginator struct { + options GetApiKeysPaginatorOptions + client GetApiKeysAPIClient + params *GetApiKeysInput + nextToken *string + firstPage bool +} + +// NewGetApiKeysPaginator returns a new GetApiKeysPaginator +func NewGetApiKeysPaginator(client GetApiKeysAPIClient, params *GetApiKeysInput, optFns ...func(*GetApiKeysPaginatorOptions)) *GetApiKeysPaginator { + options := GetApiKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetApiKeysInput{} + } + + return &GetApiKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetApiKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetApiKeys page. +func (p *GetApiKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetApiKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetApiKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetApiKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetBasePathMappings.go b/service/apigateway/api_op_GetBasePathMappings.go index 0f393e69cf8..cbf182b3ece 100644 --- a/service/apigateway/api_op_GetBasePathMappings.go +++ b/service/apigateway/api_op_GetBasePathMappings.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -120,6 +121,89 @@ func addOperationGetBasePathMappingsMiddlewares(stack *middleware.Stack, options return nil } +// GetBasePathMappingsAPIClient is a client that implements the GetBasePathMappings +// operation. +type GetBasePathMappingsAPIClient interface { + GetBasePathMappings(context.Context, *GetBasePathMappingsInput, ...func(*Options)) (*GetBasePathMappingsOutput, error) +} + +var _ GetBasePathMappingsAPIClient = (*Client)(nil) + +// GetBasePathMappingsPaginatorOptions is the paginator options for +// GetBasePathMappings +type GetBasePathMappingsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetBasePathMappingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetBasePathMappings +type GetBasePathMappingsPaginator struct { + options GetBasePathMappingsPaginatorOptions + client GetBasePathMappingsAPIClient + params *GetBasePathMappingsInput + nextToken *string + firstPage bool +} + +// NewGetBasePathMappingsPaginator returns a new GetBasePathMappingsPaginator +func NewGetBasePathMappingsPaginator(client GetBasePathMappingsAPIClient, params *GetBasePathMappingsInput, optFns ...func(*GetBasePathMappingsPaginatorOptions)) *GetBasePathMappingsPaginator { + options := GetBasePathMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBasePathMappingsInput{} + } + + return &GetBasePathMappingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBasePathMappingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBasePathMappings page. +func (p *GetBasePathMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBasePathMappingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetBasePathMappings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBasePathMappings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetClientCertificates.go b/service/apigateway/api_op_GetClientCertificates.go index 6f97712107e..742c7ef9ac9 100644 --- a/service/apigateway/api_op_GetClientCertificates.go +++ b/service/apigateway/api_op_GetClientCertificates.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -113,6 +114,89 @@ func addOperationGetClientCertificatesMiddlewares(stack *middleware.Stack, optio return nil } +// GetClientCertificatesAPIClient is a client that implements the +// GetClientCertificates operation. +type GetClientCertificatesAPIClient interface { + GetClientCertificates(context.Context, *GetClientCertificatesInput, ...func(*Options)) (*GetClientCertificatesOutput, error) +} + +var _ GetClientCertificatesAPIClient = (*Client)(nil) + +// GetClientCertificatesPaginatorOptions is the paginator options for +// GetClientCertificates +type GetClientCertificatesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetClientCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetClientCertificates +type GetClientCertificatesPaginator struct { + options GetClientCertificatesPaginatorOptions + client GetClientCertificatesAPIClient + params *GetClientCertificatesInput + nextToken *string + firstPage bool +} + +// NewGetClientCertificatesPaginator returns a new GetClientCertificatesPaginator +func NewGetClientCertificatesPaginator(client GetClientCertificatesAPIClient, params *GetClientCertificatesInput, optFns ...func(*GetClientCertificatesPaginatorOptions)) *GetClientCertificatesPaginator { + options := GetClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetClientCertificatesInput{} + } + + return &GetClientCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetClientCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetClientCertificates page. +func (p *GetClientCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetClientCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetClientCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetClientCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetDeployments.go b/service/apigateway/api_op_GetDeployments.go index 16421939f1c..41a4f781874 100644 --- a/service/apigateway/api_op_GetDeployments.go +++ b/service/apigateway/api_op_GetDeployments.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -129,6 +130,88 @@ func addOperationGetDeploymentsMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetDeploymentsAPIClient is a client that implements the GetDeployments +// operation. +type GetDeploymentsAPIClient interface { + GetDeployments(context.Context, *GetDeploymentsInput, ...func(*Options)) (*GetDeploymentsOutput, error) +} + +var _ GetDeploymentsAPIClient = (*Client)(nil) + +// GetDeploymentsPaginatorOptions is the paginator options for GetDeployments +type GetDeploymentsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetDeployments +type GetDeploymentsPaginator struct { + options GetDeploymentsPaginatorOptions + client GetDeploymentsAPIClient + params *GetDeploymentsInput + nextToken *string + firstPage bool +} + +// NewGetDeploymentsPaginator returns a new GetDeploymentsPaginator +func NewGetDeploymentsPaginator(client GetDeploymentsAPIClient, params *GetDeploymentsInput, optFns ...func(*GetDeploymentsPaginatorOptions)) *GetDeploymentsPaginator { + options := GetDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDeploymentsInput{} + } + + return &GetDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDeployments page. +func (p *GetDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetDomainNames.go b/service/apigateway/api_op_GetDomainNames.go index c69db1dbe6b..5c589d81dfc 100644 --- a/service/apigateway/api_op_GetDomainNames.go +++ b/service/apigateway/api_op_GetDomainNames.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -112,6 +113,88 @@ func addOperationGetDomainNamesMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetDomainNamesAPIClient is a client that implements the GetDomainNames +// operation. +type GetDomainNamesAPIClient interface { + GetDomainNames(context.Context, *GetDomainNamesInput, ...func(*Options)) (*GetDomainNamesOutput, error) +} + +var _ GetDomainNamesAPIClient = (*Client)(nil) + +// GetDomainNamesPaginatorOptions is the paginator options for GetDomainNames +type GetDomainNamesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetDomainNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetDomainNames +type GetDomainNamesPaginator struct { + options GetDomainNamesPaginatorOptions + client GetDomainNamesAPIClient + params *GetDomainNamesInput + nextToken *string + firstPage bool +} + +// NewGetDomainNamesPaginator returns a new GetDomainNamesPaginator +func NewGetDomainNamesPaginator(client GetDomainNamesAPIClient, params *GetDomainNamesInput, optFns ...func(*GetDomainNamesPaginatorOptions)) *GetDomainNamesPaginator { + options := GetDomainNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDomainNamesInput{} + } + + return &GetDomainNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDomainNamesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDomainNames page. +func (p *GetDomainNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDomainNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetDomainNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDomainNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetModels.go b/service/apigateway/api_op_GetModels.go index e901ed39c1b..c6e8c06a61e 100644 --- a/service/apigateway/api_op_GetModels.go +++ b/service/apigateway/api_op_GetModels.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -121,6 +122,87 @@ func addOperationGetModelsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetModelsAPIClient is a client that implements the GetModels operation. +type GetModelsAPIClient interface { + GetModels(context.Context, *GetModelsInput, ...func(*Options)) (*GetModelsOutput, error) +} + +var _ GetModelsAPIClient = (*Client)(nil) + +// GetModelsPaginatorOptions is the paginator options for GetModels +type GetModelsPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetModels +type GetModelsPaginator struct { + options GetModelsPaginatorOptions + client GetModelsAPIClient + params *GetModelsInput + nextToken *string + firstPage bool +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetModelsInput{} + } + + return &GetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetModels page. +func (p *GetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetResources.go b/service/apigateway/api_op_GetResources.go index 241683e69df..f57668ce9c5 100644 --- a/service/apigateway/api_op_GetResources.go +++ b/service/apigateway/api_op_GetResources.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -128,6 +129,87 @@ func addOperationGetResourcesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetResourcesAPIClient is a client that implements the GetResources operation. +type GetResourcesAPIClient interface { + GetResources(context.Context, *GetResourcesInput, ...func(*Options)) (*GetResourcesOutput, error) +} + +var _ GetResourcesAPIClient = (*Client)(nil) + +// GetResourcesPaginatorOptions is the paginator options for GetResources +type GetResourcesPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetResources +type GetResourcesPaginator struct { + options GetResourcesPaginatorOptions + client GetResourcesAPIClient + params *GetResourcesInput + nextToken *string + firstPage bool +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcesInput{} + } + + return &GetResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResources page. +func (p *GetResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetRestApis.go b/service/apigateway/api_op_GetRestApis.go index 98ea66f5c8f..a8bec66e72f 100644 --- a/service/apigateway/api_op_GetRestApis.go +++ b/service/apigateway/api_op_GetRestApis.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -114,6 +115,87 @@ func addOperationGetRestApisMiddlewares(stack *middleware.Stack, options Options return nil } +// GetRestApisAPIClient is a client that implements the GetRestApis operation. +type GetRestApisAPIClient interface { + GetRestApis(context.Context, *GetRestApisInput, ...func(*Options)) (*GetRestApisOutput, error) +} + +var _ GetRestApisAPIClient = (*Client)(nil) + +// GetRestApisPaginatorOptions is the paginator options for GetRestApis +type GetRestApisPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetRestApisPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetRestApis +type GetRestApisPaginator struct { + options GetRestApisPaginatorOptions + client GetRestApisAPIClient + params *GetRestApisInput + nextToken *string + firstPage bool +} + +// NewGetRestApisPaginator returns a new GetRestApisPaginator +func NewGetRestApisPaginator(client GetRestApisAPIClient, params *GetRestApisInput, optFns ...func(*GetRestApisPaginatorOptions)) *GetRestApisPaginator { + options := GetRestApisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetRestApisInput{} + } + + return &GetRestApisPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetRestApisPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetRestApis page. +func (p *GetRestApisPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRestApisOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetRestApis(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetRestApis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsage.go b/service/apigateway/api_op_GetUsage.go index 48550ed4dc8..c9f927ebdc4 100644 --- a/service/apigateway/api_op_GetUsage.go +++ b/service/apigateway/api_op_GetUsage.go @@ -4,6 +4,7 @@ package apigateway 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/awslabs/smithy-go/middleware" @@ -148,6 +149,87 @@ func addOperationGetUsageMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// GetUsageAPIClient is a client that implements the GetUsage operation. +type GetUsageAPIClient interface { + GetUsage(context.Context, *GetUsageInput, ...func(*Options)) (*GetUsageOutput, error) +} + +var _ GetUsageAPIClient = (*Client)(nil) + +// GetUsagePaginatorOptions is the paginator options for GetUsage +type GetUsagePaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetUsagePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsage +type GetUsagePaginator struct { + options GetUsagePaginatorOptions + client GetUsageAPIClient + params *GetUsageInput + nextToken *string + firstPage bool +} + +// NewGetUsagePaginator returns a new GetUsagePaginator +func NewGetUsagePaginator(client GetUsageAPIClient, params *GetUsageInput, optFns ...func(*GetUsagePaginatorOptions)) *GetUsagePaginator { + options := GetUsagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageInput{} + } + + return &GetUsagePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUsage page. +func (p *GetUsagePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetUsage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsagePlanKeys.go b/service/apigateway/api_op_GetUsagePlanKeys.go index c2b4d6053f2..25d65a82de8 100644 --- a/service/apigateway/api_op_GetUsagePlanKeys.go +++ b/service/apigateway/api_op_GetUsagePlanKeys.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -129,6 +130,88 @@ func addOperationGetUsagePlanKeysMiddlewares(stack *middleware.Stack, options Op return nil } +// GetUsagePlanKeysAPIClient is a client that implements the GetUsagePlanKeys +// operation. +type GetUsagePlanKeysAPIClient interface { + GetUsagePlanKeys(context.Context, *GetUsagePlanKeysInput, ...func(*Options)) (*GetUsagePlanKeysOutput, error) +} + +var _ GetUsagePlanKeysAPIClient = (*Client)(nil) + +// GetUsagePlanKeysPaginatorOptions is the paginator options for GetUsagePlanKeys +type GetUsagePlanKeysPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetUsagePlanKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsagePlanKeys +type GetUsagePlanKeysPaginator struct { + options GetUsagePlanKeysPaginatorOptions + client GetUsagePlanKeysAPIClient + params *GetUsagePlanKeysInput + nextToken *string + firstPage bool +} + +// NewGetUsagePlanKeysPaginator returns a new GetUsagePlanKeysPaginator +func NewGetUsagePlanKeysPaginator(client GetUsagePlanKeysAPIClient, params *GetUsagePlanKeysInput, optFns ...func(*GetUsagePlanKeysPaginatorOptions)) *GetUsagePlanKeysPaginator { + options := GetUsagePlanKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsagePlanKeysInput{} + } + + return &GetUsagePlanKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePlanKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUsagePlanKeys page. +func (p *GetUsagePlanKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsagePlanKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetUsagePlanKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsagePlanKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetUsagePlans.go b/service/apigateway/api_op_GetUsagePlans.go index 14fc5339103..bc81363307c 100644 --- a/service/apigateway/api_op_GetUsagePlans.go +++ b/service/apigateway/api_op_GetUsagePlans.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -116,6 +117,87 @@ func addOperationGetUsagePlansMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetUsagePlansAPIClient is a client that implements the GetUsagePlans operation. +type GetUsagePlansAPIClient interface { + GetUsagePlans(context.Context, *GetUsagePlansInput, ...func(*Options)) (*GetUsagePlansOutput, error) +} + +var _ GetUsagePlansAPIClient = (*Client)(nil) + +// GetUsagePlansPaginatorOptions is the paginator options for GetUsagePlans +type GetUsagePlansPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetUsagePlansPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetUsagePlans +type GetUsagePlansPaginator struct { + options GetUsagePlansPaginatorOptions + client GetUsagePlansAPIClient + params *GetUsagePlansInput + nextToken *string + firstPage bool +} + +// NewGetUsagePlansPaginator returns a new GetUsagePlansPaginator +func NewGetUsagePlansPaginator(client GetUsagePlansAPIClient, params *GetUsagePlansInput, optFns ...func(*GetUsagePlansPaginatorOptions)) *GetUsagePlansPaginator { + options := GetUsagePlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsagePlansInput{} + } + + return &GetUsagePlansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsagePlansPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUsagePlans page. +func (p *GetUsagePlansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsagePlansOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetUsagePlans(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsagePlans(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/api_op_GetVpcLinks.go b/service/apigateway/api_op_GetVpcLinks.go index 39f1193acf9..bedab0992cb 100644 --- a/service/apigateway/api_op_GetVpcLinks.go +++ b/service/apigateway/api_op_GetVpcLinks.go @@ -4,6 +4,7 @@ package apigateway 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/apigateway/types" @@ -115,6 +116,87 @@ func addOperationGetVpcLinksMiddlewares(stack *middleware.Stack, options Options return nil } +// GetVpcLinksAPIClient is a client that implements the GetVpcLinks operation. +type GetVpcLinksAPIClient interface { + GetVpcLinks(context.Context, *GetVpcLinksInput, ...func(*Options)) (*GetVpcLinksOutput, error) +} + +var _ GetVpcLinksAPIClient = (*Client)(nil) + +// GetVpcLinksPaginatorOptions is the paginator options for GetVpcLinks +type GetVpcLinksPaginatorOptions struct { + // The maximum number of returned results per page. The default value is 25 and the + // maximum value is 500. + 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 +} + +// GetVpcLinksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/apigateway.GetVpcLinks +type GetVpcLinksPaginator struct { + options GetVpcLinksPaginatorOptions + client GetVpcLinksAPIClient + params *GetVpcLinksInput + nextToken *string + firstPage bool +} + +// NewGetVpcLinksPaginator returns a new GetVpcLinksPaginator +func NewGetVpcLinksPaginator(client GetVpcLinksAPIClient, params *GetVpcLinksInput, optFns ...func(*GetVpcLinksPaginatorOptions)) *GetVpcLinksPaginator { + options := GetVpcLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetVpcLinksInput{} + } + + return &GetVpcLinksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetVpcLinksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetVpcLinks page. +func (p *GetVpcLinksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetVpcLinksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Position = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetVpcLinks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Position + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetVpcLinks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/apigateway/endpoints.go b/service/apigateway/endpoints.go index a4ca771d499..5cfa739ffff 100644 --- a/service/apigateway/endpoints.go +++ b/service/apigateway/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/apigatewaymanagementapi/endpoints.go b/service/apigatewaymanagementapi/endpoints.go index be57c436c78..762a031cff7 100644 --- a/service/apigatewaymanagementapi/endpoints.go +++ b/service/apigatewaymanagementapi/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/apigatewayv2/endpoints.go b/service/apigatewayv2/endpoints.go index 6e4f6fb016b..ee63b46f553 100644 --- a/service/apigatewayv2/endpoints.go +++ b/service/apigatewayv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/appconfig/api_op_ListApplications.go b/service/appconfig/api_op_ListApplications.go index 0a9114177e5..7bab3c5db68 100644 --- a/service/appconfig/api_op_ListApplications.go +++ b/service/appconfig/api_op_ListApplications.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -107,6 +108,88 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListConfigurationProfiles.go b/service/appconfig/api_op_ListConfigurationProfiles.go index d5401678e0b..e6b9c6fc4ce 100644 --- a/service/appconfig/api_op_ListConfigurationProfiles.go +++ b/service/appconfig/api_op_ListConfigurationProfiles.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -115,6 +116,90 @@ func addOperationListConfigurationProfilesMiddlewares(stack *middleware.Stack, o return nil } +// ListConfigurationProfilesAPIClient is a client that implements the +// ListConfigurationProfiles operation. +type ListConfigurationProfilesAPIClient interface { + ListConfigurationProfiles(context.Context, *ListConfigurationProfilesInput, ...func(*Options)) (*ListConfigurationProfilesOutput, error) +} + +var _ ListConfigurationProfilesAPIClient = (*Client)(nil) + +// ListConfigurationProfilesPaginatorOptions is the paginator options for +// ListConfigurationProfiles +type ListConfigurationProfilesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListConfigurationProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListConfigurationProfiles +type ListConfigurationProfilesPaginator struct { + options ListConfigurationProfilesPaginatorOptions + client ListConfigurationProfilesAPIClient + params *ListConfigurationProfilesInput + nextToken *string + firstPage bool +} + +// NewListConfigurationProfilesPaginator returns a new +// ListConfigurationProfilesPaginator +func NewListConfigurationProfilesPaginator(client ListConfigurationProfilesAPIClient, params *ListConfigurationProfilesInput, optFns ...func(*ListConfigurationProfilesPaginatorOptions)) *ListConfigurationProfilesPaginator { + options := ListConfigurationProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationProfilesInput{} + } + + return &ListConfigurationProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurationProfiles page. +func (p *ListConfigurationProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListConfigurationProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListDeploymentStrategies.go b/service/appconfig/api_op_ListDeploymentStrategies.go index 49b55866316..8885b99327e 100644 --- a/service/appconfig/api_op_ListDeploymentStrategies.go +++ b/service/appconfig/api_op_ListDeploymentStrategies.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -107,6 +108,90 @@ func addOperationListDeploymentStrategiesMiddlewares(stack *middleware.Stack, op return nil } +// ListDeploymentStrategiesAPIClient is a client that implements the +// ListDeploymentStrategies operation. +type ListDeploymentStrategiesAPIClient interface { + ListDeploymentStrategies(context.Context, *ListDeploymentStrategiesInput, ...func(*Options)) (*ListDeploymentStrategiesOutput, error) +} + +var _ ListDeploymentStrategiesAPIClient = (*Client)(nil) + +// ListDeploymentStrategiesPaginatorOptions is the paginator options for +// ListDeploymentStrategies +type ListDeploymentStrategiesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListDeploymentStrategiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListDeploymentStrategies +type ListDeploymentStrategiesPaginator struct { + options ListDeploymentStrategiesPaginatorOptions + client ListDeploymentStrategiesAPIClient + params *ListDeploymentStrategiesInput + nextToken *string + firstPage bool +} + +// NewListDeploymentStrategiesPaginator returns a new +// ListDeploymentStrategiesPaginator +func NewListDeploymentStrategiesPaginator(client ListDeploymentStrategiesAPIClient, params *ListDeploymentStrategiesInput, optFns ...func(*ListDeploymentStrategiesPaginatorOptions)) *ListDeploymentStrategiesPaginator { + options := ListDeploymentStrategiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentStrategiesInput{} + } + + return &ListDeploymentStrategiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentStrategiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeploymentStrategies page. +func (p *ListDeploymentStrategiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentStrategiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDeploymentStrategies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentStrategies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListDeployments.go b/service/appconfig/api_op_ListDeployments.go index a9d6eb53599..1db041b6b7d 100644 --- a/service/appconfig/api_op_ListDeployments.go +++ b/service/appconfig/api_op_ListDeployments.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -120,6 +121,88 @@ func addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDeploymentsAPIClient is a client that implements the ListDeployments +// operation. +type ListDeploymentsAPIClient interface { + ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) +} + +var _ ListDeploymentsAPIClient = (*Client)(nil) + +// ListDeploymentsPaginatorOptions is the paginator options for ListDeployments +type ListDeploymentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListDeployments +type ListDeploymentsPaginator struct { + options ListDeploymentsPaginatorOptions + client ListDeploymentsAPIClient + params *ListDeploymentsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentsInput{} + } + + return &ListDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeployments page. +func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListEnvironments.go b/service/appconfig/api_op_ListEnvironments.go index 01117a9e337..70d12f56b6d 100644 --- a/service/appconfig/api_op_ListEnvironments.go +++ b/service/appconfig/api_op_ListEnvironments.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -115,6 +116,88 @@ func addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListEnvironmentsAPIClient is a client that implements the ListEnvironments +// operation. +type ListEnvironmentsAPIClient interface { + ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) +} + +var _ ListEnvironmentsAPIClient = (*Client)(nil) + +// ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments +type ListEnvironmentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListEnvironments +type ListEnvironmentsPaginator struct { + options ListEnvironmentsPaginatorOptions + client ListEnvironmentsAPIClient + params *ListEnvironmentsInput + nextToken *string + firstPage bool +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnvironmentsInput{} + } + + return &ListEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnvironmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEnvironments page. +func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/api_op_ListHostedConfigurationVersions.go b/service/appconfig/api_op_ListHostedConfigurationVersions.go index 0dcc267fe6d..ba55cc22760 100644 --- a/service/appconfig/api_op_ListHostedConfigurationVersions.go +++ b/service/appconfig/api_op_ListHostedConfigurationVersions.go @@ -4,6 +4,7 @@ package appconfig 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/appconfig/types" @@ -121,6 +122,90 @@ func addOperationListHostedConfigurationVersionsMiddlewares(stack *middleware.St return nil } +// ListHostedConfigurationVersionsAPIClient is a client that implements the +// ListHostedConfigurationVersions operation. +type ListHostedConfigurationVersionsAPIClient interface { + ListHostedConfigurationVersions(context.Context, *ListHostedConfigurationVersionsInput, ...func(*Options)) (*ListHostedConfigurationVersionsOutput, error) +} + +var _ ListHostedConfigurationVersionsAPIClient = (*Client)(nil) + +// ListHostedConfigurationVersionsPaginatorOptions is the paginator options for +// ListHostedConfigurationVersions +type ListHostedConfigurationVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListHostedConfigurationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appconfig.ListHostedConfigurationVersions +type ListHostedConfigurationVersionsPaginator struct { + options ListHostedConfigurationVersionsPaginatorOptions + client ListHostedConfigurationVersionsAPIClient + params *ListHostedConfigurationVersionsInput + nextToken *string + firstPage bool +} + +// NewListHostedConfigurationVersionsPaginator returns a new +// ListHostedConfigurationVersionsPaginator +func NewListHostedConfigurationVersionsPaginator(client ListHostedConfigurationVersionsAPIClient, params *ListHostedConfigurationVersionsInput, optFns ...func(*ListHostedConfigurationVersionsPaginatorOptions)) *ListHostedConfigurationVersionsPaginator { + options := ListHostedConfigurationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHostedConfigurationVersionsInput{} + } + + return &ListHostedConfigurationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHostedConfigurationVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHostedConfigurationVersions page. +func (p *ListHostedConfigurationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHostedConfigurationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListHostedConfigurationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHostedConfigurationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appconfig/endpoints.go b/service/appconfig/endpoints.go index 1b1315c4f3c..9c3351f5487 100644 --- a/service/appconfig/endpoints.go +++ b/service/appconfig/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/appflow/api_op_DescribeConnectorProfiles.go b/service/appflow/api_op_DescribeConnectorProfiles.go index 3995b4f8fbf..dd1d23460cd 100644 --- a/service/appflow/api_op_DescribeConnectorProfiles.go +++ b/service/appflow/api_op_DescribeConnectorProfiles.go @@ -4,6 +4,7 @@ package appflow 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/appflow/types" @@ -118,6 +119,90 @@ func addOperationDescribeConnectorProfilesMiddlewares(stack *middleware.Stack, o return nil } +// DescribeConnectorProfilesAPIClient is a client that implements the +// DescribeConnectorProfiles operation. +type DescribeConnectorProfilesAPIClient interface { + DescribeConnectorProfiles(context.Context, *DescribeConnectorProfilesInput, ...func(*Options)) (*DescribeConnectorProfilesOutput, error) +} + +var _ DescribeConnectorProfilesAPIClient = (*Client)(nil) + +// DescribeConnectorProfilesPaginatorOptions is the paginator options for +// DescribeConnectorProfiles +type DescribeConnectorProfilesPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + // The default for maxResults is 20 (for all paginated API operations). + 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 +} + +// DescribeConnectorProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeConnectorProfiles +type DescribeConnectorProfilesPaginator struct { + options DescribeConnectorProfilesPaginatorOptions + client DescribeConnectorProfilesAPIClient + params *DescribeConnectorProfilesInput + nextToken *string + firstPage bool +} + +// NewDescribeConnectorProfilesPaginator returns a new +// DescribeConnectorProfilesPaginator +func NewDescribeConnectorProfilesPaginator(client DescribeConnectorProfilesAPIClient, params *DescribeConnectorProfilesInput, optFns ...func(*DescribeConnectorProfilesPaginatorOptions)) *DescribeConnectorProfilesPaginator { + options := DescribeConnectorProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectorProfilesInput{} + } + + return &DescribeConnectorProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectorProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeConnectorProfiles page. +func (p *DescribeConnectorProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectorProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeConnectorProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnectorProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_DescribeConnectors.go b/service/appflow/api_op_DescribeConnectors.go index f18064d6b0b..315b7f94009 100644 --- a/service/appflow/api_op_DescribeConnectors.go +++ b/service/appflow/api_op_DescribeConnectors.go @@ -4,6 +4,7 @@ package appflow 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/appflow/types" @@ -109,6 +110,81 @@ func addOperationDescribeConnectorsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeConnectorsAPIClient is a client that implements the DescribeConnectors +// operation. +type DescribeConnectorsAPIClient interface { + DescribeConnectors(context.Context, *DescribeConnectorsInput, ...func(*Options)) (*DescribeConnectorsOutput, error) +} + +var _ DescribeConnectorsAPIClient = (*Client)(nil) + +// DescribeConnectorsPaginatorOptions is the paginator options for +// DescribeConnectors +type DescribeConnectorsPaginatorOptions struct { + // 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 +} + +// DescribeConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeConnectors +type DescribeConnectorsPaginator struct { + options DescribeConnectorsPaginatorOptions + client DescribeConnectorsAPIClient + params *DescribeConnectorsInput + nextToken *string + firstPage bool +} + +// NewDescribeConnectorsPaginator returns a new DescribeConnectorsPaginator +func NewDescribeConnectorsPaginator(client DescribeConnectorsAPIClient, params *DescribeConnectorsInput, optFns ...func(*DescribeConnectorsPaginatorOptions)) *DescribeConnectorsPaginator { + options := DescribeConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectorsInput{} + } + + return &DescribeConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeConnectors page. +func (p *DescribeConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_DescribeFlowExecutionRecords.go b/service/appflow/api_op_DescribeFlowExecutionRecords.go index 03d34c5b5a8..202c2ef0c2d 100644 --- a/service/appflow/api_op_DescribeFlowExecutionRecords.go +++ b/service/appflow/api_op_DescribeFlowExecutionRecords.go @@ -4,6 +4,7 @@ package appflow 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/appflow/types" @@ -115,6 +116,90 @@ func addOperationDescribeFlowExecutionRecordsMiddlewares(stack *middleware.Stack return nil } +// DescribeFlowExecutionRecordsAPIClient is a client that implements the +// DescribeFlowExecutionRecords operation. +type DescribeFlowExecutionRecordsAPIClient interface { + DescribeFlowExecutionRecords(context.Context, *DescribeFlowExecutionRecordsInput, ...func(*Options)) (*DescribeFlowExecutionRecordsOutput, error) +} + +var _ DescribeFlowExecutionRecordsAPIClient = (*Client)(nil) + +// DescribeFlowExecutionRecordsPaginatorOptions is the paginator options for +// DescribeFlowExecutionRecords +type DescribeFlowExecutionRecordsPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + // The default for maxResults is 20 (for all paginated API operations). + 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 +} + +// DescribeFlowExecutionRecordsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.DescribeFlowExecutionRecords +type DescribeFlowExecutionRecordsPaginator struct { + options DescribeFlowExecutionRecordsPaginatorOptions + client DescribeFlowExecutionRecordsAPIClient + params *DescribeFlowExecutionRecordsInput + nextToken *string + firstPage bool +} + +// NewDescribeFlowExecutionRecordsPaginator returns a new +// DescribeFlowExecutionRecordsPaginator +func NewDescribeFlowExecutionRecordsPaginator(client DescribeFlowExecutionRecordsAPIClient, params *DescribeFlowExecutionRecordsInput, optFns ...func(*DescribeFlowExecutionRecordsPaginatorOptions)) *DescribeFlowExecutionRecordsPaginator { + options := DescribeFlowExecutionRecordsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFlowExecutionRecordsInput{} + } + + return &DescribeFlowExecutionRecordsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFlowExecutionRecordsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFlowExecutionRecords page. +func (p *DescribeFlowExecutionRecordsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFlowExecutionRecordsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeFlowExecutionRecords(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFlowExecutionRecords(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/api_op_ListFlows.go b/service/appflow/api_op_ListFlows.go index 15becc7bef5..ac3c1af315b 100644 --- a/service/appflow/api_op_ListFlows.go +++ b/service/appflow/api_op_ListFlows.go @@ -4,6 +4,7 @@ package appflow 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/appflow/types" @@ -105,6 +106,86 @@ func addOperationListFlowsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFlowsAPIClient is a client that implements the ListFlows operation. +type ListFlowsAPIClient interface { + ListFlows(context.Context, *ListFlowsInput, ...func(*Options)) (*ListFlowsOutput, error) +} + +var _ ListFlowsAPIClient = (*Client)(nil) + +// ListFlowsPaginatorOptions is the paginator options for ListFlows +type ListFlowsPaginatorOptions struct { + // Specifies the maximum number of items that should be returned in the result set. + 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 +} + +// ListFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appflow.ListFlows +type ListFlowsPaginator struct { + options ListFlowsPaginatorOptions + client ListFlowsAPIClient + params *ListFlowsInput + nextToken *string + firstPage bool +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowsInput{} + } + + return &ListFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFlows page. +func (p *ListFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appflow/endpoints.go b/service/appflow/endpoints.go index e54ac442964..bbd6c6ae4e0 100644 --- a/service/appflow/endpoints.go +++ b/service/appflow/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/applicationautoscaling/api_op_DescribeScalableTargets.go b/service/applicationautoscaling/api_op_DescribeScalableTargets.go index 8b3145c6463..185c4e729c8 100644 --- a/service/applicationautoscaling/api_op_DescribeScalableTargets.go +++ b/service/applicationautoscaling/api_op_DescribeScalableTargets.go @@ -4,6 +4,7 @@ package applicationautoscaling 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/applicationautoscaling/types" @@ -254,6 +255,94 @@ func addOperationDescribeScalableTargetsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeScalableTargetsAPIClient is a client that implements the +// DescribeScalableTargets operation. +type DescribeScalableTargetsAPIClient interface { + DescribeScalableTargets(context.Context, *DescribeScalableTargetsInput, ...func(*Options)) (*DescribeScalableTargetsOutput, error) +} + +var _ DescribeScalableTargetsAPIClient = (*Client)(nil) + +// DescribeScalableTargetsPaginatorOptions is the paginator options for +// DescribeScalableTargets +type DescribeScalableTargetsPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + 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 +} + +// DescribeScalableTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalableTargets +type DescribeScalableTargetsPaginator struct { + options DescribeScalableTargetsPaginatorOptions + client DescribeScalableTargetsAPIClient + params *DescribeScalableTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeScalableTargetsPaginator returns a new +// DescribeScalableTargetsPaginator +func NewDescribeScalableTargetsPaginator(client DescribeScalableTargetsAPIClient, params *DescribeScalableTargetsInput, optFns ...func(*DescribeScalableTargetsPaginatorOptions)) *DescribeScalableTargetsPaginator { + options := DescribeScalableTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalableTargetsInput{} + } + + return &DescribeScalableTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalableTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScalableTargets page. +func (p *DescribeScalableTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalableTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeScalableTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalableTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScalingActivities.go b/service/applicationautoscaling/api_op_DescribeScalingActivities.go index 673cac01cdd..d0caacd8be5 100644 --- a/service/applicationautoscaling/api_op_DescribeScalingActivities.go +++ b/service/applicationautoscaling/api_op_DescribeScalingActivities.go @@ -4,6 +4,7 @@ package applicationautoscaling 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/applicationautoscaling/types" @@ -255,6 +256,94 @@ func addOperationDescribeScalingActivitiesMiddlewares(stack *middleware.Stack, o return nil } +// DescribeScalingActivitiesAPIClient is a client that implements the +// DescribeScalingActivities operation. +type DescribeScalingActivitiesAPIClient interface { + DescribeScalingActivities(context.Context, *DescribeScalingActivitiesInput, ...func(*Options)) (*DescribeScalingActivitiesOutput, error) +} + +var _ DescribeScalingActivitiesAPIClient = (*Client)(nil) + +// DescribeScalingActivitiesPaginatorOptions is the paginator options for +// DescribeScalingActivities +type DescribeScalingActivitiesPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + 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 +} + +// DescribeScalingActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalingActivities +type DescribeScalingActivitiesPaginator struct { + options DescribeScalingActivitiesPaginatorOptions + client DescribeScalingActivitiesAPIClient + params *DescribeScalingActivitiesInput + nextToken *string + firstPage bool +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingActivitiesInput{} + } + + return &DescribeScalingActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingActivitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScalingActivities page. +func (p *DescribeScalingActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeScalingActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScalingPolicies.go b/service/applicationautoscaling/api_op_DescribeScalingPolicies.go index a3cfa43c341..35b22138d5f 100644 --- a/service/applicationautoscaling/api_op_DescribeScalingPolicies.go +++ b/service/applicationautoscaling/api_op_DescribeScalingPolicies.go @@ -4,6 +4,7 @@ package applicationautoscaling 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/applicationautoscaling/types" @@ -263,6 +264,94 @@ func addOperationDescribeScalingPoliciesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeScalingPoliciesAPIClient is a client that implements the +// DescribeScalingPolicies operation. +type DescribeScalingPoliciesAPIClient interface { + DescribeScalingPolicies(context.Context, *DescribeScalingPoliciesInput, ...func(*Options)) (*DescribeScalingPoliciesOutput, error) +} + +var _ DescribeScalingPoliciesAPIClient = (*Client)(nil) + +// DescribeScalingPoliciesPaginatorOptions is the paginator options for +// DescribeScalingPolicies +type DescribeScalingPoliciesPaginatorOptions struct { + // The maximum number of scalable targets. This value can be between 1 and 50. The + // default value is 50. If this parameter is used, the operation returns up to + // MaxResults results at a time, along with a NextToken value. To get the next set + // of results, include the NextToken value in a subsequent call. If this parameter + // is not used, the operation returns up to 50 results and a NextToken value, if + // applicable. + 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 +} + +// DescribeScalingPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScalingPolicies +type DescribeScalingPoliciesPaginator struct { + options DescribeScalingPoliciesPaginatorOptions + client DescribeScalingPoliciesAPIClient + params *DescribeScalingPoliciesInput + nextToken *string + firstPage bool +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingPoliciesInput{} + } + + return &DescribeScalingPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScalingPolicies page. +func (p *DescribeScalingPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeScalingPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/api_op_DescribeScheduledActions.go b/service/applicationautoscaling/api_op_DescribeScheduledActions.go index 23cc5f4d3ef..fa0f274cebe 100644 --- a/service/applicationautoscaling/api_op_DescribeScheduledActions.go +++ b/service/applicationautoscaling/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package applicationautoscaling 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/applicationautoscaling/types" @@ -261,6 +262,94 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of scheduled action results. This value can be between 1 and + // 50. The default value is 50. If this parameter is used, the operation returns up + // to MaxResults results at a time, along with a NextToken value. To get the next + // set of results, include the NextToken value in a subsequent call. If this + // parameter is not used, the operation returns up to 50 results and a NextToken + // value, if applicable. + 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 +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationautoscaling.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationautoscaling/endpoints.go b/service/applicationautoscaling/endpoints.go index 5eee70b6cd5..55e8b8bd3d8 100644 --- a/service/applicationautoscaling/endpoints.go +++ b/service/applicationautoscaling/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go b/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go index 3ee5c3b5684..704fa68326d 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go +++ b/service/applicationdiscoveryservice/api_op_DescribeContinuousExports.go @@ -4,6 +4,7 @@ package applicationdiscoveryservice 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/applicationdiscoveryservice/types" @@ -111,6 +112,90 @@ func addOperationDescribeContinuousExportsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeContinuousExportsAPIClient is a client that implements the +// DescribeContinuousExports operation. +type DescribeContinuousExportsAPIClient interface { + DescribeContinuousExports(context.Context, *DescribeContinuousExportsInput, ...func(*Options)) (*DescribeContinuousExportsOutput, error) +} + +var _ DescribeContinuousExportsAPIClient = (*Client)(nil) + +// DescribeContinuousExportsPaginatorOptions is the paginator options for +// DescribeContinuousExports +type DescribeContinuousExportsPaginatorOptions struct { + // A number between 1 and 100 specifying the maximum number of continuous export + // descriptions returned. + 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 +} + +// DescribeContinuousExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice.DescribeContinuousExports +type DescribeContinuousExportsPaginator struct { + options DescribeContinuousExportsPaginatorOptions + client DescribeContinuousExportsAPIClient + params *DescribeContinuousExportsInput + nextToken *string + firstPage bool +} + +// NewDescribeContinuousExportsPaginator returns a new +// DescribeContinuousExportsPaginator +func NewDescribeContinuousExportsPaginator(client DescribeContinuousExportsAPIClient, params *DescribeContinuousExportsInput, optFns ...func(*DescribeContinuousExportsPaginatorOptions)) *DescribeContinuousExportsPaginator { + options := DescribeContinuousExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeContinuousExportsInput{} + } + + return &DescribeContinuousExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeContinuousExportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeContinuousExports page. +func (p *DescribeContinuousExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeContinuousExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeContinuousExports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeContinuousExports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go b/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go index 94d5c62ded3..9eb5c68b0ab 100644 --- a/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go +++ b/service/applicationdiscoveryservice/api_op_DescribeImportTasks.go @@ -4,6 +4,7 @@ package applicationdiscoveryservice 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/applicationdiscoveryservice/types" @@ -112,6 +113,88 @@ func addOperationDescribeImportTasksMiddlewares(stack *middleware.Stack, options return nil } +// DescribeImportTasksAPIClient is a client that implements the DescribeImportTasks +// operation. +type DescribeImportTasksAPIClient interface { + DescribeImportTasks(context.Context, *DescribeImportTasksInput, ...func(*Options)) (*DescribeImportTasksOutput, error) +} + +var _ DescribeImportTasksAPIClient = (*Client)(nil) + +// DescribeImportTasksPaginatorOptions is the paginator options for +// DescribeImportTasks +type DescribeImportTasksPaginatorOptions struct { + // The maximum number of results that you want this request to return, up to 100. + 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 +} + +// DescribeImportTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationdiscoveryservice.DescribeImportTasks +type DescribeImportTasksPaginator struct { + options DescribeImportTasksPaginatorOptions + client DescribeImportTasksAPIClient + params *DescribeImportTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeImportTasksPaginator returns a new DescribeImportTasksPaginator +func NewDescribeImportTasksPaginator(client DescribeImportTasksAPIClient, params *DescribeImportTasksInput, optFns ...func(*DescribeImportTasksPaginatorOptions)) *DescribeImportTasksPaginator { + options := DescribeImportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportTasksInput{} + } + + return &DescribeImportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImportTasks page. +func (p *DescribeImportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeImportTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationdiscoveryservice/endpoints.go b/service/applicationdiscoveryservice/endpoints.go index 129d6aebbd3..dda6c5f4964 100644 --- a/service/applicationdiscoveryservice/endpoints.go +++ b/service/applicationdiscoveryservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/applicationinsights/api_op_ListApplications.go b/service/applicationinsights/api_op_ListApplications.go index e6a83533a35..f7a4b532598 100644 --- a/service/applicationinsights/api_op_ListApplications.go +++ b/service/applicationinsights/api_op_ListApplications.go @@ -4,6 +4,7 @@ package applicationinsights 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/applicationinsights/types" @@ -107,6 +108,88 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListComponents.go b/service/applicationinsights/api_op_ListComponents.go index 5828696ade7..81df8742301 100644 --- a/service/applicationinsights/api_op_ListComponents.go +++ b/service/applicationinsights/api_op_ListComponents.go @@ -4,6 +4,7 @@ package applicationinsights 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/applicationinsights/types" @@ -114,6 +115,88 @@ func addOperationListComponentsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// ListComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentsInput{} + } + + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListConfigurationHistory.go b/service/applicationinsights/api_op_ListConfigurationHistory.go index 056e622f45e..ee70318bc88 100644 --- a/service/applicationinsights/api_op_ListConfigurationHistory.go +++ b/service/applicationinsights/api_op_ListConfigurationHistory.go @@ -4,6 +4,7 @@ package applicationinsights 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/applicationinsights/types" @@ -141,6 +142,94 @@ func addOperationListConfigurationHistoryMiddlewares(stack *middleware.Stack, op return nil } +// ListConfigurationHistoryAPIClient is a client that implements the +// ListConfigurationHistory operation. +type ListConfigurationHistoryAPIClient interface { + ListConfigurationHistory(context.Context, *ListConfigurationHistoryInput, ...func(*Options)) (*ListConfigurationHistoryOutput, error) +} + +var _ ListConfigurationHistoryAPIClient = (*Client)(nil) + +// ListConfigurationHistoryPaginatorOptions is the paginator options for +// ListConfigurationHistory +type ListConfigurationHistoryPaginatorOptions struct { + // The maximum number of results returned by ListConfigurationHistory in paginated + // output. When this parameter is used, ListConfigurationHistory returns only + // MaxResults in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListConfigurationHistory request with the returned NextToken value. If this + // parameter is not used, then ListConfigurationHistory returns all results. + 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 +} + +// ListConfigurationHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListConfigurationHistory +type ListConfigurationHistoryPaginator struct { + options ListConfigurationHistoryPaginatorOptions + client ListConfigurationHistoryAPIClient + params *ListConfigurationHistoryInput + nextToken *string + firstPage bool +} + +// NewListConfigurationHistoryPaginator returns a new +// ListConfigurationHistoryPaginator +func NewListConfigurationHistoryPaginator(client ListConfigurationHistoryAPIClient, params *ListConfigurationHistoryInput, optFns ...func(*ListConfigurationHistoryPaginatorOptions)) *ListConfigurationHistoryPaginator { + options := ListConfigurationHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationHistoryInput{} + } + + return &ListConfigurationHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurationHistory page. +func (p *ListConfigurationHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListConfigurationHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListLogPatternSets.go b/service/applicationinsights/api_op_ListLogPatternSets.go index d33384e7d94..e07e32c38bc 100644 --- a/service/applicationinsights/api_op_ListLogPatternSets.go +++ b/service/applicationinsights/api_op_ListLogPatternSets.go @@ -4,6 +4,7 @@ package applicationinsights 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/awslabs/smithy-go/middleware" @@ -117,6 +118,89 @@ func addOperationListLogPatternSetsMiddlewares(stack *middleware.Stack, options return nil } +// ListLogPatternSetsAPIClient is a client that implements the ListLogPatternSets +// operation. +type ListLogPatternSetsAPIClient interface { + ListLogPatternSets(context.Context, *ListLogPatternSetsInput, ...func(*Options)) (*ListLogPatternSetsOutput, error) +} + +var _ ListLogPatternSetsAPIClient = (*Client)(nil) + +// ListLogPatternSetsPaginatorOptions is the paginator options for +// ListLogPatternSets +type ListLogPatternSetsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// ListLogPatternSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListLogPatternSets +type ListLogPatternSetsPaginator struct { + options ListLogPatternSetsPaginatorOptions + client ListLogPatternSetsAPIClient + params *ListLogPatternSetsInput + nextToken *string + firstPage bool +} + +// NewListLogPatternSetsPaginator returns a new ListLogPatternSetsPaginator +func NewListLogPatternSetsPaginator(client ListLogPatternSetsAPIClient, params *ListLogPatternSetsInput, optFns ...func(*ListLogPatternSetsPaginatorOptions)) *ListLogPatternSetsPaginator { + options := ListLogPatternSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLogPatternSetsInput{} + } + + return &ListLogPatternSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogPatternSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLogPatternSets page. +func (p *ListLogPatternSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogPatternSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLogPatternSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLogPatternSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListLogPatterns.go b/service/applicationinsights/api_op_ListLogPatterns.go index 495028ac6eb..6933b1f4575 100644 --- a/service/applicationinsights/api_op_ListLogPatterns.go +++ b/service/applicationinsights/api_op_ListLogPatterns.go @@ -4,6 +4,7 @@ package applicationinsights 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/applicationinsights/types" @@ -121,6 +122,88 @@ func addOperationListLogPatternsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListLogPatternsAPIClient is a client that implements the ListLogPatterns +// operation. +type ListLogPatternsAPIClient interface { + ListLogPatterns(context.Context, *ListLogPatternsInput, ...func(*Options)) (*ListLogPatternsOutput, error) +} + +var _ ListLogPatternsAPIClient = (*Client)(nil) + +// ListLogPatternsPaginatorOptions is the paginator options for ListLogPatterns +type ListLogPatternsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// ListLogPatternsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListLogPatterns +type ListLogPatternsPaginator struct { + options ListLogPatternsPaginatorOptions + client ListLogPatternsAPIClient + params *ListLogPatternsInput + nextToken *string + firstPage bool +} + +// NewListLogPatternsPaginator returns a new ListLogPatternsPaginator +func NewListLogPatternsPaginator(client ListLogPatternsAPIClient, params *ListLogPatternsInput, optFns ...func(*ListLogPatternsPaginatorOptions)) *ListLogPatternsPaginator { + options := ListLogPatternsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLogPatternsInput{} + } + + return &ListLogPatternsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogPatternsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLogPatterns page. +func (p *ListLogPatternsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogPatternsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLogPatterns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLogPatterns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/api_op_ListProblems.go b/service/applicationinsights/api_op_ListProblems.go index 42a9ca5dd13..e12ba2d39d6 100644 --- a/service/applicationinsights/api_op_ListProblems.go +++ b/service/applicationinsights/api_op_ListProblems.go @@ -4,6 +4,7 @@ package applicationinsights 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/applicationinsights/types" @@ -119,6 +120,87 @@ func addOperationListProblemsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListProblemsAPIClient is a client that implements the ListProblems operation. +type ListProblemsAPIClient interface { + ListProblems(context.Context, *ListProblemsInput, ...func(*Options)) (*ListProblemsOutput, error) +} + +var _ ListProblemsAPIClient = (*Client)(nil) + +// ListProblemsPaginatorOptions is the paginator options for ListProblems +type ListProblemsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// ListProblemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/applicationinsights.ListProblems +type ListProblemsPaginator struct { + options ListProblemsPaginatorOptions + client ListProblemsAPIClient + params *ListProblemsInput + nextToken *string + firstPage bool +} + +// NewListProblemsPaginator returns a new ListProblemsPaginator +func NewListProblemsPaginator(client ListProblemsAPIClient, params *ListProblemsInput, optFns ...func(*ListProblemsPaginatorOptions)) *ListProblemsPaginator { + options := ListProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProblemsInput{} + } + + return &ListProblemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProblemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProblems page. +func (p *ListProblemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProblemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProblems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProblems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/applicationinsights/endpoints.go b/service/applicationinsights/endpoints.go index b1d0c75ded8..9b6770eb2ca 100644 --- a/service/applicationinsights/endpoints.go +++ b/service/applicationinsights/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/appmesh/api_op_ListGatewayRoutes.go b/service/appmesh/api_op_ListGatewayRoutes.go index 6285f4ab439..0dcf9a71d8f 100644 --- a/service/appmesh/api_op_ListGatewayRoutes.go +++ b/service/appmesh/api_op_ListGatewayRoutes.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -136,3 +137,90 @@ func addOperationListGatewayRoutesMiddlewares(stack *middleware.Stack, options O } return nil } + +// ListGatewayRoutesAPIClient is a client that implements the ListGatewayRoutes +// operation. +type ListGatewayRoutesAPIClient interface { + ListGatewayRoutes(context.Context, *ListGatewayRoutesInput, ...func(*Options)) (*ListGatewayRoutesOutput, error) +} + +var _ ListGatewayRoutesAPIClient = (*Client)(nil) + +// ListGatewayRoutesPaginatorOptions is the paginator options for ListGatewayRoutes +type ListGatewayRoutesPaginatorOptions struct { + // The maximum number of results returned by ListGatewayRoutes in paginated output. + // When you use this parameter, ListGatewayRoutes returns only limit results in a + // single page along with a nextToken response element. You can see the remaining + // results of the initial request by sending another ListGatewayRoutes request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListGatewayRoutes returns up to 100 results and a nextToken + // value if applicable. + 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 +} + +// ListGatewayRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListGatewayRoutes +type ListGatewayRoutesPaginator struct { + options ListGatewayRoutesPaginatorOptions + client ListGatewayRoutesAPIClient + params *ListGatewayRoutesInput + nextToken *string + firstPage bool +} + +// NewListGatewayRoutesPaginator returns a new ListGatewayRoutesPaginator +func NewListGatewayRoutesPaginator(client ListGatewayRoutesAPIClient, params *ListGatewayRoutesInput, optFns ...func(*ListGatewayRoutesPaginatorOptions)) *ListGatewayRoutesPaginator { + options := ListGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewayRoutesInput{} + } + + return &ListGatewayRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewayRoutesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGatewayRoutes page. +func (p *ListGatewayRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewayRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGatewayRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListMeshes.go b/service/appmesh/api_op_ListMeshes.go index cb8461b8c2e..2486d7ebb57 100644 --- a/service/appmesh/api_op_ListMeshes.go +++ b/service/appmesh/api_op_ListMeshes.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -118,3 +119,89 @@ func addOperationListMeshesMiddlewares(stack *middleware.Stack, options Options) } return nil } + +// ListMeshesAPIClient is a client that implements the ListMeshes operation. +type ListMeshesAPIClient interface { + ListMeshes(context.Context, *ListMeshesInput, ...func(*Options)) (*ListMeshesOutput, error) +} + +var _ ListMeshesAPIClient = (*Client)(nil) + +// ListMeshesPaginatorOptions is the paginator options for ListMeshes +type ListMeshesPaginatorOptions struct { + // The maximum number of results returned by ListMeshes in paginated output. When + // you use this parameter, ListMeshes returns only limit results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListMeshes request with the returned + // nextToken value. This value can be between 1 and 100. If you don't use this + // parameter, ListMeshes returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListMeshesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListMeshes +type ListMeshesPaginator struct { + options ListMeshesPaginatorOptions + client ListMeshesAPIClient + params *ListMeshesInput + nextToken *string + firstPage bool +} + +// NewListMeshesPaginator returns a new ListMeshesPaginator +func NewListMeshesPaginator(client ListMeshesAPIClient, params *ListMeshesInput, optFns ...func(*ListMeshesPaginatorOptions)) *ListMeshesPaginator { + options := ListMeshesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMeshesInput{} + } + + return &ListMeshesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMeshesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMeshes page. +func (p *ListMeshesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMeshesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListMeshes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListRoutes.go b/service/appmesh/api_op_ListRoutes.go index 8be462bcbf1..781a4c06092 100644 --- a/service/appmesh/api_op_ListRoutes.go +++ b/service/appmesh/api_op_ListRoutes.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -136,3 +137,89 @@ func addOperationListRoutesMiddlewares(stack *middleware.Stack, options Options) } return nil } + +// ListRoutesAPIClient is a client that implements the ListRoutes operation. +type ListRoutesAPIClient interface { + ListRoutes(context.Context, *ListRoutesInput, ...func(*Options)) (*ListRoutesOutput, error) +} + +var _ ListRoutesAPIClient = (*Client)(nil) + +// ListRoutesPaginatorOptions is the paginator options for ListRoutes +type ListRoutesPaginatorOptions struct { + // The maximum number of results returned by ListRoutes in paginated output. When + // you use this parameter, ListRoutes returns only limit results in a single page + // along with a nextToken response element. You can see the remaining results of + // the initial request by sending another ListRoutes request with the returned + // nextToken value. This value can be between 1 and 100. If you don't use this + // parameter, ListRoutes returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListRoutes +type ListRoutesPaginator struct { + options ListRoutesPaginatorOptions + client ListRoutesAPIClient + params *ListRoutesInput + nextToken *string + firstPage bool +} + +// NewListRoutesPaginator returns a new ListRoutesPaginator +func NewListRoutesPaginator(client ListRoutesAPIClient, params *ListRoutesInput, optFns ...func(*ListRoutesPaginatorOptions)) *ListRoutesPaginator { + options := ListRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutesInput{} + } + + return &ListRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoutes page. +func (p *ListRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListTagsForResource.go b/service/appmesh/api_op_ListTagsForResource.go index 44161be6a6a..c451e36f950 100644 --- a/service/appmesh/api_op_ListTagsForResource.go +++ b/service/appmesh/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -130,6 +131,94 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tag results returned by ListTagsForResource in paginated + // output. When this parameter is used, ListTagsForResource returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListTagsForResource request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListTagsForResource returns + // up to 100 results and a nextToken value if applicable. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appmesh/api_op_ListVirtualGateways.go b/service/appmesh/api_op_ListVirtualGateways.go index 5cf6a03532a..80d520d324d 100644 --- a/service/appmesh/api_op_ListVirtualGateways.go +++ b/service/appmesh/api_op_ListVirtualGateways.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -129,3 +130,91 @@ func addOperationListVirtualGatewaysMiddlewares(stack *middleware.Stack, options } return nil } + +// ListVirtualGatewaysAPIClient is a client that implements the ListVirtualGateways +// operation. +type ListVirtualGatewaysAPIClient interface { + ListVirtualGateways(context.Context, *ListVirtualGatewaysInput, ...func(*Options)) (*ListVirtualGatewaysOutput, error) +} + +var _ ListVirtualGatewaysAPIClient = (*Client)(nil) + +// ListVirtualGatewaysPaginatorOptions is the paginator options for +// ListVirtualGateways +type ListVirtualGatewaysPaginatorOptions struct { + // The maximum number of results returned by ListVirtualGateways in paginated + // output. When you use this parameter, ListVirtualGateways returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualGateways request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualGateways returns + // up to 100 results and a nextToken value if applicable. + 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 +} + +// ListVirtualGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualGateways +type ListVirtualGatewaysPaginator struct { + options ListVirtualGatewaysPaginatorOptions + client ListVirtualGatewaysAPIClient + params *ListVirtualGatewaysInput + nextToken *string + firstPage bool +} + +// NewListVirtualGatewaysPaginator returns a new ListVirtualGatewaysPaginator +func NewListVirtualGatewaysPaginator(client ListVirtualGatewaysAPIClient, params *ListVirtualGatewaysInput, optFns ...func(*ListVirtualGatewaysPaginatorOptions)) *ListVirtualGatewaysPaginator { + options := ListVirtualGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualGatewaysInput{} + } + + return &ListVirtualGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVirtualGateways page. +func (p *ListVirtualGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListVirtualGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualNodes.go b/service/appmesh/api_op_ListVirtualNodes.go index 3c27e6e5122..ea05ab6bf3c 100644 --- a/service/appmesh/api_op_ListVirtualNodes.go +++ b/service/appmesh/api_op_ListVirtualNodes.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -131,3 +132,90 @@ func addOperationListVirtualNodesMiddlewares(stack *middleware.Stack, options Op } return nil } + +// ListVirtualNodesAPIClient is a client that implements the ListVirtualNodes +// operation. +type ListVirtualNodesAPIClient interface { + ListVirtualNodes(context.Context, *ListVirtualNodesInput, ...func(*Options)) (*ListVirtualNodesOutput, error) +} + +var _ ListVirtualNodesAPIClient = (*Client)(nil) + +// ListVirtualNodesPaginatorOptions is the paginator options for ListVirtualNodes +type ListVirtualNodesPaginatorOptions struct { + // The maximum number of results returned by ListVirtualNodes in paginated output. + // When you use this parameter, ListVirtualNodes returns only limit results in a + // single page along with a nextToken response element. You can see the remaining + // results of the initial request by sending another ListVirtualNodes request with + // the returned nextToken value. This value can be between 1 and 100. If you don't + // use this parameter, ListVirtualNodes returns up to 100 results and a nextToken + // value if applicable. + 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 +} + +// ListVirtualNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualNodes +type ListVirtualNodesPaginator struct { + options ListVirtualNodesPaginatorOptions + client ListVirtualNodesAPIClient + params *ListVirtualNodesInput + nextToken *string + firstPage bool +} + +// NewListVirtualNodesPaginator returns a new ListVirtualNodesPaginator +func NewListVirtualNodesPaginator(client ListVirtualNodesAPIClient, params *ListVirtualNodesInput, optFns ...func(*ListVirtualNodesPaginatorOptions)) *ListVirtualNodesPaginator { + options := ListVirtualNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualNodesInput{} + } + + return &ListVirtualNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualNodesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVirtualNodes page. +func (p *ListVirtualNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListVirtualNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualRouters.go b/service/appmesh/api_op_ListVirtualRouters.go index 58bcc0e3836..dff984d37b0 100644 --- a/service/appmesh/api_op_ListVirtualRouters.go +++ b/service/appmesh/api_op_ListVirtualRouters.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -131,3 +132,91 @@ func addOperationListVirtualRoutersMiddlewares(stack *middleware.Stack, options } return nil } + +// ListVirtualRoutersAPIClient is a client that implements the ListVirtualRouters +// operation. +type ListVirtualRoutersAPIClient interface { + ListVirtualRouters(context.Context, *ListVirtualRoutersInput, ...func(*Options)) (*ListVirtualRoutersOutput, error) +} + +var _ ListVirtualRoutersAPIClient = (*Client)(nil) + +// ListVirtualRoutersPaginatorOptions is the paginator options for +// ListVirtualRouters +type ListVirtualRoutersPaginatorOptions struct { + // The maximum number of results returned by ListVirtualRouters in paginated + // output. When you use this parameter, ListVirtualRouters returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualRouters request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualRouters returns + // up to 100 results and a nextToken value if applicable. + 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 +} + +// ListVirtualRoutersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualRouters +type ListVirtualRoutersPaginator struct { + options ListVirtualRoutersPaginatorOptions + client ListVirtualRoutersAPIClient + params *ListVirtualRoutersInput + nextToken *string + firstPage bool +} + +// NewListVirtualRoutersPaginator returns a new ListVirtualRoutersPaginator +func NewListVirtualRoutersPaginator(client ListVirtualRoutersAPIClient, params *ListVirtualRoutersInput, optFns ...func(*ListVirtualRoutersPaginatorOptions)) *ListVirtualRoutersPaginator { + options := ListVirtualRoutersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualRoutersInput{} + } + + return &ListVirtualRoutersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualRoutersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVirtualRouters page. +func (p *ListVirtualRoutersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualRoutersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListVirtualRouters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/api_op_ListVirtualServices.go b/service/appmesh/api_op_ListVirtualServices.go index 8b74b0b6069..066f9b44bbb 100644 --- a/service/appmesh/api_op_ListVirtualServices.go +++ b/service/appmesh/api_op_ListVirtualServices.go @@ -4,6 +4,7 @@ package appmesh 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/appmesh/types" @@ -131,3 +132,91 @@ func addOperationListVirtualServicesMiddlewares(stack *middleware.Stack, options } return nil } + +// ListVirtualServicesAPIClient is a client that implements the ListVirtualServices +// operation. +type ListVirtualServicesAPIClient interface { + ListVirtualServices(context.Context, *ListVirtualServicesInput, ...func(*Options)) (*ListVirtualServicesOutput, error) +} + +var _ ListVirtualServicesAPIClient = (*Client)(nil) + +// ListVirtualServicesPaginatorOptions is the paginator options for +// ListVirtualServices +type ListVirtualServicesPaginatorOptions struct { + // The maximum number of results returned by ListVirtualServices in paginated + // output. When you use this parameter, ListVirtualServices returns only limit + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another + // ListVirtualServices request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListVirtualServices returns + // up to 100 results and a nextToken value if applicable. + 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 +} + +// ListVirtualServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appmesh.ListVirtualServices +type ListVirtualServicesPaginator struct { + options ListVirtualServicesPaginatorOptions + client ListVirtualServicesAPIClient + params *ListVirtualServicesInput + nextToken *string + firstPage bool +} + +// NewListVirtualServicesPaginator returns a new ListVirtualServicesPaginator +func NewListVirtualServicesPaginator(client ListVirtualServicesAPIClient, params *ListVirtualServicesInput, optFns ...func(*ListVirtualServicesPaginatorOptions)) *ListVirtualServicesPaginator { + options := ListVirtualServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualServicesInput{} + } + + return &ListVirtualServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualServicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVirtualServices page. +func (p *ListVirtualServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListVirtualServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/appmesh/endpoints.go b/service/appmesh/endpoints.go index 6353d0fe828..83c611c1bd3 100644 --- a/service/appmesh/endpoints.go +++ b/service/appmesh/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/appstream/api_op_DescribeImagePermissions.go b/service/appstream/api_op_DescribeImagePermissions.go index 0839e37ddbd..85affa6abad 100644 --- a/service/appstream/api_op_DescribeImagePermissions.go +++ b/service/appstream/api_op_DescribeImagePermissions.go @@ -4,6 +4,7 @@ package appstream 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/appstream/types" @@ -124,6 +125,89 @@ func addOperationDescribeImagePermissionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeImagePermissionsAPIClient is a client that implements the +// DescribeImagePermissions operation. +type DescribeImagePermissionsAPIClient interface { + DescribeImagePermissions(context.Context, *DescribeImagePermissionsInput, ...func(*Options)) (*DescribeImagePermissionsOutput, error) +} + +var _ DescribeImagePermissionsAPIClient = (*Client)(nil) + +// DescribeImagePermissionsPaginatorOptions is the paginator options for +// DescribeImagePermissions +type DescribeImagePermissionsPaginatorOptions struct { + // The maximum size of each page of results. + 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 +} + +// DescribeImagePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appstream.DescribeImagePermissions +type DescribeImagePermissionsPaginator struct { + options DescribeImagePermissionsPaginatorOptions + client DescribeImagePermissionsAPIClient + params *DescribeImagePermissionsInput + nextToken *string + firstPage bool +} + +// NewDescribeImagePermissionsPaginator returns a new +// DescribeImagePermissionsPaginator +func NewDescribeImagePermissionsPaginator(client DescribeImagePermissionsAPIClient, params *DescribeImagePermissionsInput, optFns ...func(*DescribeImagePermissionsPaginatorOptions)) *DescribeImagePermissionsPaginator { + options := DescribeImagePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagePermissionsInput{} + } + + return &DescribeImagePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagePermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImagePermissions page. +func (p *DescribeImagePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeImagePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImagePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appstream/api_op_DescribeImages.go b/service/appstream/api_op_DescribeImages.go index fd283f2ca61..cc29cb055cc 100644 --- a/service/appstream/api_op_DescribeImages.go +++ b/service/appstream/api_op_DescribeImages.go @@ -4,6 +4,7 @@ package appstream 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/appstream/types" @@ -117,6 +118,87 @@ func addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeImagesAPIClient is a client that implements the DescribeImages +// operation. +type DescribeImagesAPIClient interface { + DescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error) +} + +var _ DescribeImagesAPIClient = (*Client)(nil) + +// DescribeImagesPaginatorOptions is the paginator options for DescribeImages +type DescribeImagesPaginatorOptions struct { + // The maximum size of each page of results. + 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 +} + +// DescribeImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/appstream.DescribeImages +type DescribeImagesPaginator struct { + options DescribeImagesPaginatorOptions + client DescribeImagesAPIClient + params *DescribeImagesInput + nextToken *string + firstPage bool +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagesInput{} + } + + return &DescribeImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImages page. +func (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/appstream/endpoints.go b/service/appstream/endpoints.go index 8fe7aaa0aa1..b8dd03f5f63 100644 --- a/service/appstream/endpoints.go +++ b/service/appstream/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/appsync/endpoints.go b/service/appsync/endpoints.go index 26cf4870f75..f4b0770bb06 100644 --- a/service/appsync/endpoints.go +++ b/service/appsync/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/athena/api_op_GetQueryResults.go b/service/athena/api_op_GetQueryResults.go index 7ce9a9af21d..206e333ff9c 100644 --- a/service/athena/api_op_GetQueryResults.go +++ b/service/athena/api_op_GetQueryResults.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -131,6 +132,87 @@ func addOperationGetQueryResultsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetQueryResultsAPIClient is a client that implements the GetQueryResults +// operation. +type GetQueryResultsAPIClient interface { + GetQueryResults(context.Context, *GetQueryResultsInput, ...func(*Options)) (*GetQueryResultsOutput, error) +} + +var _ GetQueryResultsAPIClient = (*Client)(nil) + +// GetQueryResultsPaginatorOptions is the paginator options for GetQueryResults +type GetQueryResultsPaginatorOptions struct { + // The maximum number of results (rows) to return in this request. + 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 +} + +// GetQueryResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.GetQueryResults +type GetQueryResultsPaginator struct { + options GetQueryResultsPaginatorOptions + client GetQueryResultsAPIClient + params *GetQueryResultsInput + nextToken *string + firstPage bool +} + +// NewGetQueryResultsPaginator returns a new GetQueryResultsPaginator +func NewGetQueryResultsPaginator(client GetQueryResultsAPIClient, params *GetQueryResultsInput, optFns ...func(*GetQueryResultsPaginatorOptions)) *GetQueryResultsPaginator { + options := GetQueryResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetQueryResultsInput{} + } + + return &GetQueryResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetQueryResultsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetQueryResults page. +func (p *GetQueryResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetQueryResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetQueryResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetQueryResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListDataCatalogs.go b/service/athena/api_op_ListDataCatalogs.go index 0d9026f7404..3a98bb60d65 100644 --- a/service/athena/api_op_ListDataCatalogs.go +++ b/service/athena/api_op_ListDataCatalogs.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -109,6 +110,87 @@ func addOperationListDataCatalogsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListDataCatalogsAPIClient is a client that implements the ListDataCatalogs +// operation. +type ListDataCatalogsAPIClient interface { + ListDataCatalogs(context.Context, *ListDataCatalogsInput, ...func(*Options)) (*ListDataCatalogsOutput, error) +} + +var _ ListDataCatalogsAPIClient = (*Client)(nil) + +// ListDataCatalogsPaginatorOptions is the paginator options for ListDataCatalogs +type ListDataCatalogsPaginatorOptions struct { + // Specifies the maximum number of data catalogs 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 +} + +// ListDataCatalogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListDataCatalogs +type ListDataCatalogsPaginator struct { + options ListDataCatalogsPaginatorOptions + client ListDataCatalogsAPIClient + params *ListDataCatalogsInput + nextToken *string + firstPage bool +} + +// NewListDataCatalogsPaginator returns a new ListDataCatalogsPaginator +func NewListDataCatalogsPaginator(client ListDataCatalogsAPIClient, params *ListDataCatalogsInput, optFns ...func(*ListDataCatalogsPaginatorOptions)) *ListDataCatalogsPaginator { + options := ListDataCatalogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataCatalogsInput{} + } + + return &ListDataCatalogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataCatalogsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataCatalogs page. +func (p *ListDataCatalogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataCatalogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDataCatalogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataCatalogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListDatabases.go b/service/athena/api_op_ListDatabases.go index be9ae4b9910..99113841893 100644 --- a/service/athena/api_op_ListDatabases.go +++ b/service/athena/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -117,6 +118,86 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // Specifies the maximum number of results 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 +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListNamedQueries.go b/service/athena/api_op_ListNamedQueries.go index f60c3f6a7e9..6fe443a7adc 100644 --- a/service/athena/api_op_ListNamedQueries.go +++ b/service/athena/api_op_ListNamedQueries.go @@ -4,6 +4,7 @@ package athena 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/awslabs/smithy-go/middleware" @@ -118,6 +119,87 @@ func addOperationListNamedQueriesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListNamedQueriesAPIClient is a client that implements the ListNamedQueries +// operation. +type ListNamedQueriesAPIClient interface { + ListNamedQueries(context.Context, *ListNamedQueriesInput, ...func(*Options)) (*ListNamedQueriesOutput, error) +} + +var _ ListNamedQueriesAPIClient = (*Client)(nil) + +// ListNamedQueriesPaginatorOptions is the paginator options for ListNamedQueries +type ListNamedQueriesPaginatorOptions struct { + // The maximum number of queries to return in this request. + 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 +} + +// ListNamedQueriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListNamedQueries +type ListNamedQueriesPaginator struct { + options ListNamedQueriesPaginatorOptions + client ListNamedQueriesAPIClient + params *ListNamedQueriesInput + nextToken *string + firstPage bool +} + +// NewListNamedQueriesPaginator returns a new ListNamedQueriesPaginator +func NewListNamedQueriesPaginator(client ListNamedQueriesAPIClient, params *ListNamedQueriesInput, optFns ...func(*ListNamedQueriesPaginatorOptions)) *ListNamedQueriesPaginator { + options := ListNamedQueriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamedQueriesInput{} + } + + return &ListNamedQueriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamedQueriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNamedQueries page. +func (p *ListNamedQueriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamedQueriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNamedQueries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamedQueries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListQueryExecutions.go b/service/athena/api_op_ListQueryExecutions.go index fa3317efe31..15fa8001201 100644 --- a/service/athena/api_op_ListQueryExecutions.go +++ b/service/athena/api_op_ListQueryExecutions.go @@ -4,6 +4,7 @@ package athena 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/awslabs/smithy-go/middleware" @@ -117,6 +118,88 @@ func addOperationListQueryExecutionsMiddlewares(stack *middleware.Stack, options return nil } +// ListQueryExecutionsAPIClient is a client that implements the ListQueryExecutions +// operation. +type ListQueryExecutionsAPIClient interface { + ListQueryExecutions(context.Context, *ListQueryExecutionsInput, ...func(*Options)) (*ListQueryExecutionsOutput, error) +} + +var _ ListQueryExecutionsAPIClient = (*Client)(nil) + +// ListQueryExecutionsPaginatorOptions is the paginator options for +// ListQueryExecutions +type ListQueryExecutionsPaginatorOptions struct { + // The maximum number of query executions to return in this request. + 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 +} + +// ListQueryExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListQueryExecutions +type ListQueryExecutionsPaginator struct { + options ListQueryExecutionsPaginatorOptions + client ListQueryExecutionsAPIClient + params *ListQueryExecutionsInput + nextToken *string + firstPage bool +} + +// NewListQueryExecutionsPaginator returns a new ListQueryExecutionsPaginator +func NewListQueryExecutionsPaginator(client ListQueryExecutionsAPIClient, params *ListQueryExecutionsInput, optFns ...func(*ListQueryExecutionsPaginatorOptions)) *ListQueryExecutionsPaginator { + options := ListQueryExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueryExecutionsInput{} + } + + return &ListQueryExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueryExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQueryExecutions page. +func (p *ListQueryExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueryExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListQueryExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueryExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListTableMetadata.go b/service/athena/api_op_ListTableMetadata.go index 7d6a063ddc5..e69b28b2651 100644 --- a/service/athena/api_op_ListTableMetadata.go +++ b/service/athena/api_op_ListTableMetadata.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -126,6 +127,87 @@ func addOperationListTableMetadataMiddlewares(stack *middleware.Stack, options O return nil } +// ListTableMetadataAPIClient is a client that implements the ListTableMetadata +// operation. +type ListTableMetadataAPIClient interface { + ListTableMetadata(context.Context, *ListTableMetadataInput, ...func(*Options)) (*ListTableMetadataOutput, error) +} + +var _ ListTableMetadataAPIClient = (*Client)(nil) + +// ListTableMetadataPaginatorOptions is the paginator options for ListTableMetadata +type ListTableMetadataPaginatorOptions struct { + // Specifies the maximum number of results 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 +} + +// ListTableMetadataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListTableMetadata +type ListTableMetadataPaginator struct { + options ListTableMetadataPaginatorOptions + client ListTableMetadataAPIClient + params *ListTableMetadataInput + nextToken *string + firstPage bool +} + +// NewListTableMetadataPaginator returns a new ListTableMetadataPaginator +func NewListTableMetadataPaginator(client ListTableMetadataAPIClient, params *ListTableMetadataInput, optFns ...func(*ListTableMetadataPaginatorOptions)) *ListTableMetadataPaginator { + options := ListTableMetadataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTableMetadataInput{} + } + + return &ListTableMetadataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTableMetadataPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTableMetadata page. +func (p *ListTableMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTableMetadataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTableMetadata(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTableMetadata(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListTagsForResource.go b/service/athena/api_op_ListTagsForResource.go index 704753c45bb..20460178da1 100644 --- a/service/athena/api_op_ListTagsForResource.go +++ b/service/athena/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -116,6 +117,89 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of results to be returned per request that lists the tags for + // the resource. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/api_op_ListWorkGroups.go b/service/athena/api_op_ListWorkGroups.go index a2b0b25d6d0..895b95d828c 100644 --- a/service/athena/api_op_ListWorkGroups.go +++ b/service/athena/api_op_ListWorkGroups.go @@ -4,6 +4,7 @@ package athena 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/athena/types" @@ -110,6 +111,87 @@ func addOperationListWorkGroupsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListWorkGroupsAPIClient is a client that implements the ListWorkGroups +// operation. +type ListWorkGroupsAPIClient interface { + ListWorkGroups(context.Context, *ListWorkGroupsInput, ...func(*Options)) (*ListWorkGroupsOutput, error) +} + +var _ ListWorkGroupsAPIClient = (*Client)(nil) + +// ListWorkGroupsPaginatorOptions is the paginator options for ListWorkGroups +type ListWorkGroupsPaginatorOptions struct { + // The maximum number of workgroups to return in this request. + 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 +} + +// ListWorkGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/athena.ListWorkGroups +type ListWorkGroupsPaginator struct { + options ListWorkGroupsPaginatorOptions + client ListWorkGroupsAPIClient + params *ListWorkGroupsInput + nextToken *string + firstPage bool +} + +// NewListWorkGroupsPaginator returns a new ListWorkGroupsPaginator +func NewListWorkGroupsPaginator(client ListWorkGroupsAPIClient, params *ListWorkGroupsInput, optFns ...func(*ListWorkGroupsPaginatorOptions)) *ListWorkGroupsPaginator { + options := ListWorkGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkGroupsInput{} + } + + return &ListWorkGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkGroups page. +func (p *ListWorkGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/athena/endpoints.go b/service/athena/endpoints.go index a313eced6ea..3e8f8635010 100644 --- a/service/athena/endpoints.go +++ b/service/athena/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/autoscaling/api_op_DescribeAutoScalingGroups.go b/service/autoscaling/api_op_DescribeAutoScalingGroups.go index c302bffe34c..89944f85fc7 100644 --- a/service/autoscaling/api_op_DescribeAutoScalingGroups.go +++ b/service/autoscaling/api_op_DescribeAutoScalingGroups.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -118,6 +119,90 @@ func addOperationDescribeAutoScalingGroupsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeAutoScalingGroupsAPIClient is a client that implements the +// DescribeAutoScalingGroups operation. +type DescribeAutoScalingGroupsAPIClient interface { + DescribeAutoScalingGroups(context.Context, *DescribeAutoScalingGroupsInput, ...func(*Options)) (*DescribeAutoScalingGroupsOutput, error) +} + +var _ DescribeAutoScalingGroupsAPIClient = (*Client)(nil) + +// DescribeAutoScalingGroupsPaginatorOptions is the paginator options for +// DescribeAutoScalingGroups +type DescribeAutoScalingGroupsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + 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 +} + +// DescribeAutoScalingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeAutoScalingGroups +type DescribeAutoScalingGroupsPaginator struct { + options DescribeAutoScalingGroupsPaginatorOptions + client DescribeAutoScalingGroupsAPIClient + params *DescribeAutoScalingGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeAutoScalingGroupsPaginator returns a new +// DescribeAutoScalingGroupsPaginator +func NewDescribeAutoScalingGroupsPaginator(client DescribeAutoScalingGroupsAPIClient, params *DescribeAutoScalingGroupsInput, optFns ...func(*DescribeAutoScalingGroupsPaginatorOptions)) *DescribeAutoScalingGroupsPaginator { + options := DescribeAutoScalingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutoScalingGroupsInput{} + } + + return &DescribeAutoScalingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutoScalingGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAutoScalingGroups page. +func (p *DescribeAutoScalingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutoScalingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeAutoScalingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutoScalingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeAutoScalingInstances.go b/service/autoscaling/api_op_DescribeAutoScalingInstances.go index c3b212502a7..ddf9b39153a 100644 --- a/service/autoscaling/api_op_DescribeAutoScalingInstances.go +++ b/service/autoscaling/api_op_DescribeAutoScalingInstances.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -115,6 +116,90 @@ func addOperationDescribeAutoScalingInstancesMiddlewares(stack *middleware.Stack return nil } +// DescribeAutoScalingInstancesAPIClient is a client that implements the +// DescribeAutoScalingInstances operation. +type DescribeAutoScalingInstancesAPIClient interface { + DescribeAutoScalingInstances(context.Context, *DescribeAutoScalingInstancesInput, ...func(*Options)) (*DescribeAutoScalingInstancesOutput, error) +} + +var _ DescribeAutoScalingInstancesAPIClient = (*Client)(nil) + +// DescribeAutoScalingInstancesPaginatorOptions is the paginator options for +// DescribeAutoScalingInstances +type DescribeAutoScalingInstancesPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 50. + 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 +} + +// DescribeAutoScalingInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeAutoScalingInstances +type DescribeAutoScalingInstancesPaginator struct { + options DescribeAutoScalingInstancesPaginatorOptions + client DescribeAutoScalingInstancesAPIClient + params *DescribeAutoScalingInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeAutoScalingInstancesPaginator returns a new +// DescribeAutoScalingInstancesPaginator +func NewDescribeAutoScalingInstancesPaginator(client DescribeAutoScalingInstancesAPIClient, params *DescribeAutoScalingInstancesInput, optFns ...func(*DescribeAutoScalingInstancesPaginatorOptions)) *DescribeAutoScalingInstancesPaginator { + options := DescribeAutoScalingInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutoScalingInstancesInput{} + } + + return &DescribeAutoScalingInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutoScalingInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAutoScalingInstances page. +func (p *DescribeAutoScalingInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutoScalingInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeAutoScalingInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutoScalingInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeLaunchConfigurations.go b/service/autoscaling/api_op_DescribeLaunchConfigurations.go index b87e9f5e97f..6e1496a2208 100644 --- a/service/autoscaling/api_op_DescribeLaunchConfigurations.go +++ b/service/autoscaling/api_op_DescribeLaunchConfigurations.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -116,6 +117,90 @@ func addOperationDescribeLaunchConfigurationsMiddlewares(stack *middleware.Stack return nil } +// DescribeLaunchConfigurationsAPIClient is a client that implements the +// DescribeLaunchConfigurations operation. +type DescribeLaunchConfigurationsAPIClient interface { + DescribeLaunchConfigurations(context.Context, *DescribeLaunchConfigurationsInput, ...func(*Options)) (*DescribeLaunchConfigurationsOutput, error) +} + +var _ DescribeLaunchConfigurationsAPIClient = (*Client)(nil) + +// DescribeLaunchConfigurationsPaginatorOptions is the paginator options for +// DescribeLaunchConfigurations +type DescribeLaunchConfigurationsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + 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 +} + +// DescribeLaunchConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeLaunchConfigurations +type DescribeLaunchConfigurationsPaginator struct { + options DescribeLaunchConfigurationsPaginatorOptions + client DescribeLaunchConfigurationsAPIClient + params *DescribeLaunchConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeLaunchConfigurationsPaginator returns a new +// DescribeLaunchConfigurationsPaginator +func NewDescribeLaunchConfigurationsPaginator(client DescribeLaunchConfigurationsAPIClient, params *DescribeLaunchConfigurationsInput, optFns ...func(*DescribeLaunchConfigurationsPaginatorOptions)) *DescribeLaunchConfigurationsPaginator { + options := DescribeLaunchConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchConfigurationsInput{} + } + + return &DescribeLaunchConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLaunchConfigurations page. +func (p *DescribeLaunchConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeLaunchConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeNotificationConfigurations.go b/service/autoscaling/api_op_DescribeNotificationConfigurations.go index 94556be0a50..6a02af7d4a6 100644 --- a/service/autoscaling/api_op_DescribeNotificationConfigurations.go +++ b/service/autoscaling/api_op_DescribeNotificationConfigurations.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -116,6 +117,90 @@ func addOperationDescribeNotificationConfigurationsMiddlewares(stack *middleware return nil } +// DescribeNotificationConfigurationsAPIClient is a client that implements the +// DescribeNotificationConfigurations operation. +type DescribeNotificationConfigurationsAPIClient interface { + DescribeNotificationConfigurations(context.Context, *DescribeNotificationConfigurationsInput, ...func(*Options)) (*DescribeNotificationConfigurationsOutput, error) +} + +var _ DescribeNotificationConfigurationsAPIClient = (*Client)(nil) + +// DescribeNotificationConfigurationsPaginatorOptions is the paginator options for +// DescribeNotificationConfigurations +type DescribeNotificationConfigurationsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + 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 +} + +// DescribeNotificationConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeNotificationConfigurations +type DescribeNotificationConfigurationsPaginator struct { + options DescribeNotificationConfigurationsPaginatorOptions + client DescribeNotificationConfigurationsAPIClient + params *DescribeNotificationConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeNotificationConfigurationsPaginator returns a new +// DescribeNotificationConfigurationsPaginator +func NewDescribeNotificationConfigurationsPaginator(client DescribeNotificationConfigurationsAPIClient, params *DescribeNotificationConfigurationsInput, optFns ...func(*DescribeNotificationConfigurationsPaginatorOptions)) *DescribeNotificationConfigurationsPaginator { + options := DescribeNotificationConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNotificationConfigurationsInput{} + } + + return &DescribeNotificationConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNotificationConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNotificationConfigurations page. +func (p *DescribeNotificationConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNotificationConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeNotificationConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNotificationConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribePolicies.go b/service/autoscaling/api_op_DescribePolicies.go index 242e12233fc..9b23ffd87cc 100644 --- a/service/autoscaling/api_op_DescribePolicies.go +++ b/service/autoscaling/api_op_DescribePolicies.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -123,6 +124,88 @@ func addOperationDescribePoliciesMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribePoliciesAPIClient is a client that implements the DescribePolicies +// operation. +type DescribePoliciesAPIClient interface { + DescribePolicies(context.Context, *DescribePoliciesInput, ...func(*Options)) (*DescribePoliciesOutput, error) +} + +var _ DescribePoliciesAPIClient = (*Client)(nil) + +// DescribePoliciesPaginatorOptions is the paginator options for DescribePolicies +type DescribePoliciesPaginatorOptions struct { + // The maximum number of items to be returned with each call. The default value is + // 50 and the maximum value is 100. + 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 +} + +// DescribePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribePolicies +type DescribePoliciesPaginator struct { + options DescribePoliciesPaginatorOptions + client DescribePoliciesAPIClient + params *DescribePoliciesInput + nextToken *string + firstPage bool +} + +// NewDescribePoliciesPaginator returns a new DescribePoliciesPaginator +func NewDescribePoliciesPaginator(client DescribePoliciesAPIClient, params *DescribePoliciesInput, optFns ...func(*DescribePoliciesPaginatorOptions)) *DescribePoliciesPaginator { + options := DescribePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePoliciesInput{} + } + + return &DescribePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePolicies page. +func (p *DescribePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeScalingActivities.go b/service/autoscaling/api_op_DescribeScalingActivities.go index e445289fd5e..a1570817b82 100644 --- a/service/autoscaling/api_op_DescribeScalingActivities.go +++ b/service/autoscaling/api_op_DescribeScalingActivities.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -122,6 +123,90 @@ func addOperationDescribeScalingActivitiesMiddlewares(stack *middleware.Stack, o return nil } +// DescribeScalingActivitiesAPIClient is a client that implements the +// DescribeScalingActivities operation. +type DescribeScalingActivitiesAPIClient interface { + DescribeScalingActivities(context.Context, *DescribeScalingActivitiesInput, ...func(*Options)) (*DescribeScalingActivitiesOutput, error) +} + +var _ DescribeScalingActivitiesAPIClient = (*Client)(nil) + +// DescribeScalingActivitiesPaginatorOptions is the paginator options for +// DescribeScalingActivities +type DescribeScalingActivitiesPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 100 + // and the maximum value is 100. + 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 +} + +// DescribeScalingActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeScalingActivities +type DescribeScalingActivitiesPaginator struct { + options DescribeScalingActivitiesPaginatorOptions + client DescribeScalingActivitiesAPIClient + params *DescribeScalingActivitiesInput + nextToken *string + firstPage bool +} + +// NewDescribeScalingActivitiesPaginator returns a new +// DescribeScalingActivitiesPaginator +func NewDescribeScalingActivitiesPaginator(client DescribeScalingActivitiesAPIClient, params *DescribeScalingActivitiesInput, optFns ...func(*DescribeScalingActivitiesPaginatorOptions)) *DescribeScalingActivitiesPaginator { + options := DescribeScalingActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingActivitiesInput{} + } + + return &DescribeScalingActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingActivitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScalingActivities page. +func (p *DescribeScalingActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeScalingActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeScheduledActions.go b/service/autoscaling/api_op_DescribeScheduledActions.go index fb741f3e2ff..e9850a19be8 100644 --- a/service/autoscaling/api_op_DescribeScheduledActions.go +++ b/service/autoscaling/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -129,6 +130,90 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + 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 +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/api_op_DescribeTags.go b/service/autoscaling/api_op_DescribeTags.go index ebb820e0914..70961f9db32 100644 --- a/service/autoscaling/api_op_DescribeTags.go +++ b/service/autoscaling/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package autoscaling 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/autoscaling/types" @@ -122,6 +123,87 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return nil } +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // The maximum number of items to return with this call. The default value is 50 + // and the maximum value is 100. + 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 +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/autoscaling.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/autoscaling/endpoints.go b/service/autoscaling/endpoints.go index f4453cf1df8..025cffc1368 100644 --- a/service/autoscaling/endpoints.go +++ b/service/autoscaling/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/autoscalingplans/endpoints.go b/service/autoscalingplans/endpoints.go index e86c9ab84b0..3536a0cdcc0 100644 --- a/service/autoscalingplans/endpoints.go +++ b/service/autoscalingplans/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/backup/api_op_ListBackupJobs.go b/service/backup/api_op_ListBackupJobs.go index 31fd60de0dc..ee627289c63 100644 --- a/service/backup/api_op_ListBackupJobs.go +++ b/service/backup/api_op_ListBackupJobs.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -154,6 +155,87 @@ func addOperationListBackupJobsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListBackupJobsAPIClient is a client that implements the ListBackupJobs +// operation. +type ListBackupJobsAPIClient interface { + ListBackupJobs(context.Context, *ListBackupJobsInput, ...func(*Options)) (*ListBackupJobsOutput, error) +} + +var _ ListBackupJobsAPIClient = (*Client)(nil) + +// ListBackupJobsPaginatorOptions is the paginator options for ListBackupJobs +type ListBackupJobsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupJobs +type ListBackupJobsPaginator struct { + options ListBackupJobsPaginatorOptions + client ListBackupJobsAPIClient + params *ListBackupJobsInput + nextToken *string + firstPage bool +} + +// NewListBackupJobsPaginator returns a new ListBackupJobsPaginator +func NewListBackupJobsPaginator(client ListBackupJobsAPIClient, params *ListBackupJobsInput, optFns ...func(*ListBackupJobsPaginatorOptions)) *ListBackupJobsPaginator { + options := ListBackupJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupJobsInput{} + } + + return &ListBackupJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupJobs page. +func (p *ListBackupJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlanTemplates.go b/service/backup/api_op_ListBackupPlanTemplates.go index a91df82b113..daa6f69f4f6 100644 --- a/service/backup/api_op_ListBackupPlanTemplates.go +++ b/service/backup/api_op_ListBackupPlanTemplates.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -112,6 +113,89 @@ func addOperationListBackupPlanTemplatesMiddlewares(stack *middleware.Stack, opt return nil } +// ListBackupPlanTemplatesAPIClient is a client that implements the +// ListBackupPlanTemplates operation. +type ListBackupPlanTemplatesAPIClient interface { + ListBackupPlanTemplates(context.Context, *ListBackupPlanTemplatesInput, ...func(*Options)) (*ListBackupPlanTemplatesOutput, error) +} + +var _ ListBackupPlanTemplatesAPIClient = (*Client)(nil) + +// ListBackupPlanTemplatesPaginatorOptions is the paginator options for +// ListBackupPlanTemplates +type ListBackupPlanTemplatesPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupPlanTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlanTemplates +type ListBackupPlanTemplatesPaginator struct { + options ListBackupPlanTemplatesPaginatorOptions + client ListBackupPlanTemplatesAPIClient + params *ListBackupPlanTemplatesInput + nextToken *string + firstPage bool +} + +// NewListBackupPlanTemplatesPaginator returns a new +// ListBackupPlanTemplatesPaginator +func NewListBackupPlanTemplatesPaginator(client ListBackupPlanTemplatesAPIClient, params *ListBackupPlanTemplatesInput, optFns ...func(*ListBackupPlanTemplatesPaginatorOptions)) *ListBackupPlanTemplatesPaginator { + options := ListBackupPlanTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlanTemplatesInput{} + } + + return &ListBackupPlanTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlanTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupPlanTemplates page. +func (p *ListBackupPlanTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlanTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupPlanTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlanTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlanVersions.go b/service/backup/api_op_ListBackupPlanVersions.go index d07bbe13c28..d7d36d6b5db 100644 --- a/service/backup/api_op_ListBackupPlanVersions.go +++ b/service/backup/api_op_ListBackupPlanVersions.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -121,6 +122,88 @@ func addOperationListBackupPlanVersionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListBackupPlanVersionsAPIClient is a client that implements the +// ListBackupPlanVersions operation. +type ListBackupPlanVersionsAPIClient interface { + ListBackupPlanVersions(context.Context, *ListBackupPlanVersionsInput, ...func(*Options)) (*ListBackupPlanVersionsOutput, error) +} + +var _ ListBackupPlanVersionsAPIClient = (*Client)(nil) + +// ListBackupPlanVersionsPaginatorOptions is the paginator options for +// ListBackupPlanVersions +type ListBackupPlanVersionsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupPlanVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlanVersions +type ListBackupPlanVersionsPaginator struct { + options ListBackupPlanVersionsPaginatorOptions + client ListBackupPlanVersionsAPIClient + params *ListBackupPlanVersionsInput + nextToken *string + firstPage bool +} + +// NewListBackupPlanVersionsPaginator returns a new ListBackupPlanVersionsPaginator +func NewListBackupPlanVersionsPaginator(client ListBackupPlanVersionsAPIClient, params *ListBackupPlanVersionsInput, optFns ...func(*ListBackupPlanVersionsPaginatorOptions)) *ListBackupPlanVersionsPaginator { + options := ListBackupPlanVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlanVersionsInput{} + } + + return &ListBackupPlanVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlanVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupPlanVersions page. +func (p *ListBackupPlanVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlanVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupPlanVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlanVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupPlans.go b/service/backup/api_op_ListBackupPlans.go index 6f8ac11112e..092ee726653 100644 --- a/service/backup/api_op_ListBackupPlans.go +++ b/service/backup/api_op_ListBackupPlans.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -119,6 +120,87 @@ func addOperationListBackupPlansMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListBackupPlansAPIClient is a client that implements the ListBackupPlans +// operation. +type ListBackupPlansAPIClient interface { + ListBackupPlans(context.Context, *ListBackupPlansInput, ...func(*Options)) (*ListBackupPlansOutput, error) +} + +var _ ListBackupPlansAPIClient = (*Client)(nil) + +// ListBackupPlansPaginatorOptions is the paginator options for ListBackupPlans +type ListBackupPlansPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupPlansPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupPlans +type ListBackupPlansPaginator struct { + options ListBackupPlansPaginatorOptions + client ListBackupPlansAPIClient + params *ListBackupPlansInput + nextToken *string + firstPage bool +} + +// NewListBackupPlansPaginator returns a new ListBackupPlansPaginator +func NewListBackupPlansPaginator(client ListBackupPlansAPIClient, params *ListBackupPlansInput, optFns ...func(*ListBackupPlansPaginatorOptions)) *ListBackupPlansPaginator { + options := ListBackupPlansPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupPlansInput{} + } + + return &ListBackupPlansPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupPlansPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupPlans page. +func (p *ListBackupPlansPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupPlansOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupPlans(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupPlans(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupSelections.go b/service/backup/api_op_ListBackupSelections.go index 459e989c57a..4b00fa95677 100644 --- a/service/backup/api_op_ListBackupSelections.go +++ b/service/backup/api_op_ListBackupSelections.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -121,6 +122,88 @@ func addOperationListBackupSelectionsMiddlewares(stack *middleware.Stack, option return nil } +// ListBackupSelectionsAPIClient is a client that implements the +// ListBackupSelections operation. +type ListBackupSelectionsAPIClient interface { + ListBackupSelections(context.Context, *ListBackupSelectionsInput, ...func(*Options)) (*ListBackupSelectionsOutput, error) +} + +var _ ListBackupSelectionsAPIClient = (*Client)(nil) + +// ListBackupSelectionsPaginatorOptions is the paginator options for +// ListBackupSelections +type ListBackupSelectionsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupSelectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupSelections +type ListBackupSelectionsPaginator struct { + options ListBackupSelectionsPaginatorOptions + client ListBackupSelectionsAPIClient + params *ListBackupSelectionsInput + nextToken *string + firstPage bool +} + +// NewListBackupSelectionsPaginator returns a new ListBackupSelectionsPaginator +func NewListBackupSelectionsPaginator(client ListBackupSelectionsAPIClient, params *ListBackupSelectionsInput, optFns ...func(*ListBackupSelectionsPaginatorOptions)) *ListBackupSelectionsPaginator { + options := ListBackupSelectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupSelectionsInput{} + } + + return &ListBackupSelectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupSelectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupSelections page. +func (p *ListBackupSelectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupSelectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupSelections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupSelections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListBackupVaults.go b/service/backup/api_op_ListBackupVaults.go index f5575c01c34..d7949334053 100644 --- a/service/backup/api_op_ListBackupVaults.go +++ b/service/backup/api_op_ListBackupVaults.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -115,6 +116,87 @@ func addOperationListBackupVaultsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListBackupVaultsAPIClient is a client that implements the ListBackupVaults +// operation. +type ListBackupVaultsAPIClient interface { + ListBackupVaults(context.Context, *ListBackupVaultsInput, ...func(*Options)) (*ListBackupVaultsOutput, error) +} + +var _ ListBackupVaultsAPIClient = (*Client)(nil) + +// ListBackupVaultsPaginatorOptions is the paginator options for ListBackupVaults +type ListBackupVaultsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListBackupVaultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListBackupVaults +type ListBackupVaultsPaginator struct { + options ListBackupVaultsPaginatorOptions + client ListBackupVaultsAPIClient + params *ListBackupVaultsInput + nextToken *string + firstPage bool +} + +// NewListBackupVaultsPaginator returns a new ListBackupVaultsPaginator +func NewListBackupVaultsPaginator(client ListBackupVaultsAPIClient, params *ListBackupVaultsInput, optFns ...func(*ListBackupVaultsPaginatorOptions)) *ListBackupVaultsPaginator { + options := ListBackupVaultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBackupVaultsInput{} + } + + return &ListBackupVaultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBackupVaultsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBackupVaults page. +func (p *ListBackupVaultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBackupVaultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBackupVaults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBackupVaults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListCopyJobs.go b/service/backup/api_op_ListCopyJobs.go index 6ad7a2e1c56..d273a28253d 100644 --- a/service/backup/api_op_ListCopyJobs.go +++ b/service/backup/api_op_ListCopyJobs.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -153,6 +154,86 @@ func addOperationListCopyJobsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListCopyJobsAPIClient is a client that implements the ListCopyJobs operation. +type ListCopyJobsAPIClient interface { + ListCopyJobs(context.Context, *ListCopyJobsInput, ...func(*Options)) (*ListCopyJobsOutput, error) +} + +var _ ListCopyJobsAPIClient = (*Client)(nil) + +// ListCopyJobsPaginatorOptions is the paginator options for ListCopyJobs +type ListCopyJobsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListCopyJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListCopyJobs +type ListCopyJobsPaginator struct { + options ListCopyJobsPaginatorOptions + client ListCopyJobsAPIClient + params *ListCopyJobsInput + nextToken *string + firstPage bool +} + +// NewListCopyJobsPaginator returns a new ListCopyJobsPaginator +func NewListCopyJobsPaginator(client ListCopyJobsAPIClient, params *ListCopyJobsInput, optFns ...func(*ListCopyJobsPaginatorOptions)) *ListCopyJobsPaginator { + options := ListCopyJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCopyJobsInput{} + } + + return &ListCopyJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCopyJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCopyJobs page. +func (p *ListCopyJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCopyJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCopyJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCopyJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListProtectedResources.go b/service/backup/api_op_ListProtectedResources.go index 029e7bd33ba..de2105c8c71 100644 --- a/service/backup/api_op_ListProtectedResources.go +++ b/service/backup/api_op_ListProtectedResources.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -115,6 +116,88 @@ func addOperationListProtectedResourcesMiddlewares(stack *middleware.Stack, opti return nil } +// ListProtectedResourcesAPIClient is a client that implements the +// ListProtectedResources operation. +type ListProtectedResourcesAPIClient interface { + ListProtectedResources(context.Context, *ListProtectedResourcesInput, ...func(*Options)) (*ListProtectedResourcesOutput, error) +} + +var _ ListProtectedResourcesAPIClient = (*Client)(nil) + +// ListProtectedResourcesPaginatorOptions is the paginator options for +// ListProtectedResources +type ListProtectedResourcesPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListProtectedResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListProtectedResources +type ListProtectedResourcesPaginator struct { + options ListProtectedResourcesPaginatorOptions + client ListProtectedResourcesAPIClient + params *ListProtectedResourcesInput + nextToken *string + firstPage bool +} + +// NewListProtectedResourcesPaginator returns a new ListProtectedResourcesPaginator +func NewListProtectedResourcesPaginator(client ListProtectedResourcesAPIClient, params *ListProtectedResourcesInput, optFns ...func(*ListProtectedResourcesPaginatorOptions)) *ListProtectedResourcesPaginator { + options := ListProtectedResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProtectedResourcesInput{} + } + + return &ListProtectedResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProtectedResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProtectedResources page. +func (p *ListProtectedResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectedResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProtectedResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProtectedResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRecoveryPointsByBackupVault.go b/service/backup/api_op_ListRecoveryPointsByBackupVault.go index 98372effed2..ed22130eeaa 100644 --- a/service/backup/api_op_ListRecoveryPointsByBackupVault.go +++ b/service/backup/api_op_ListRecoveryPointsByBackupVault.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -140,6 +141,89 @@ func addOperationListRecoveryPointsByBackupVaultMiddlewares(stack *middleware.St return nil } +// ListRecoveryPointsByBackupVaultAPIClient is a client that implements the +// ListRecoveryPointsByBackupVault operation. +type ListRecoveryPointsByBackupVaultAPIClient interface { + ListRecoveryPointsByBackupVault(context.Context, *ListRecoveryPointsByBackupVaultInput, ...func(*Options)) (*ListRecoveryPointsByBackupVaultOutput, error) +} + +var _ ListRecoveryPointsByBackupVaultAPIClient = (*Client)(nil) + +// ListRecoveryPointsByBackupVaultPaginatorOptions is the paginator options for +// ListRecoveryPointsByBackupVault +type ListRecoveryPointsByBackupVaultPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListRecoveryPointsByBackupVaultPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRecoveryPointsByBackupVault +type ListRecoveryPointsByBackupVaultPaginator struct { + options ListRecoveryPointsByBackupVaultPaginatorOptions + client ListRecoveryPointsByBackupVaultAPIClient + params *ListRecoveryPointsByBackupVaultInput + nextToken *string + firstPage bool +} + +// NewListRecoveryPointsByBackupVaultPaginator returns a new +// ListRecoveryPointsByBackupVaultPaginator +func NewListRecoveryPointsByBackupVaultPaginator(client ListRecoveryPointsByBackupVaultAPIClient, params *ListRecoveryPointsByBackupVaultInput, optFns ...func(*ListRecoveryPointsByBackupVaultPaginatorOptions)) *ListRecoveryPointsByBackupVaultPaginator { + options := ListRecoveryPointsByBackupVaultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecoveryPointsByBackupVaultInput{} + } + + return &ListRecoveryPointsByBackupVaultPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecoveryPointsByBackupVaultPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRecoveryPointsByBackupVault page. +func (p *ListRecoveryPointsByBackupVaultPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecoveryPointsByBackupVaultOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRecoveryPointsByBackupVault(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecoveryPointsByBackupVault(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRecoveryPointsByResource.go b/service/backup/api_op_ListRecoveryPointsByResource.go index 63bd3afd9b8..459168b1cd7 100644 --- a/service/backup/api_op_ListRecoveryPointsByResource.go +++ b/service/backup/api_op_ListRecoveryPointsByResource.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -122,6 +123,89 @@ func addOperationListRecoveryPointsByResourceMiddlewares(stack *middleware.Stack return nil } +// ListRecoveryPointsByResourceAPIClient is a client that implements the +// ListRecoveryPointsByResource operation. +type ListRecoveryPointsByResourceAPIClient interface { + ListRecoveryPointsByResource(context.Context, *ListRecoveryPointsByResourceInput, ...func(*Options)) (*ListRecoveryPointsByResourceOutput, error) +} + +var _ ListRecoveryPointsByResourceAPIClient = (*Client)(nil) + +// ListRecoveryPointsByResourcePaginatorOptions is the paginator options for +// ListRecoveryPointsByResource +type ListRecoveryPointsByResourcePaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListRecoveryPointsByResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRecoveryPointsByResource +type ListRecoveryPointsByResourcePaginator struct { + options ListRecoveryPointsByResourcePaginatorOptions + client ListRecoveryPointsByResourceAPIClient + params *ListRecoveryPointsByResourceInput + nextToken *string + firstPage bool +} + +// NewListRecoveryPointsByResourcePaginator returns a new +// ListRecoveryPointsByResourcePaginator +func NewListRecoveryPointsByResourcePaginator(client ListRecoveryPointsByResourceAPIClient, params *ListRecoveryPointsByResourceInput, optFns ...func(*ListRecoveryPointsByResourcePaginatorOptions)) *ListRecoveryPointsByResourcePaginator { + options := ListRecoveryPointsByResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecoveryPointsByResourceInput{} + } + + return &ListRecoveryPointsByResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecoveryPointsByResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRecoveryPointsByResource page. +func (p *ListRecoveryPointsByResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecoveryPointsByResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRecoveryPointsByResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecoveryPointsByResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListRestoreJobs.go b/service/backup/api_op_ListRestoreJobs.go index fdc160aa021..8f33fa5d882 100644 --- a/service/backup/api_op_ListRestoreJobs.go +++ b/service/backup/api_op_ListRestoreJobs.go @@ -4,6 +4,7 @@ package backup 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/backup/types" @@ -127,6 +128,87 @@ func addOperationListRestoreJobsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListRestoreJobsAPIClient is a client that implements the ListRestoreJobs +// operation. +type ListRestoreJobsAPIClient interface { + ListRestoreJobs(context.Context, *ListRestoreJobsInput, ...func(*Options)) (*ListRestoreJobsOutput, error) +} + +var _ ListRestoreJobsAPIClient = (*Client)(nil) + +// ListRestoreJobsPaginatorOptions is the paginator options for ListRestoreJobs +type ListRestoreJobsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListRestoreJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListRestoreJobs +type ListRestoreJobsPaginator struct { + options ListRestoreJobsPaginatorOptions + client ListRestoreJobsAPIClient + params *ListRestoreJobsInput + nextToken *string + firstPage bool +} + +// NewListRestoreJobsPaginator returns a new ListRestoreJobsPaginator +func NewListRestoreJobsPaginator(client ListRestoreJobsAPIClient, params *ListRestoreJobsInput, optFns ...func(*ListRestoreJobsPaginatorOptions)) *ListRestoreJobsPaginator { + options := ListRestoreJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRestoreJobsInput{} + } + + return &ListRestoreJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRestoreJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRestoreJobs page. +func (p *ListRestoreJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRestoreJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRestoreJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRestoreJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/api_op_ListTags.go b/service/backup/api_op_ListTags.go index c1b849dcf65..cb23bb108dd 100644 --- a/service/backup/api_op_ListTags.go +++ b/service/backup/api_op_ListTags.go @@ -4,6 +4,7 @@ package backup 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/awslabs/smithy-go/middleware" @@ -123,6 +124,86 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of items to be returned. + 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/backup.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/backup/endpoints.go b/service/backup/endpoints.go index 2acfed7aec9..b6da8e6f46b 100644 --- a/service/backup/endpoints.go +++ b/service/backup/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/batch/api_op_DescribeComputeEnvironments.go b/service/batch/api_op_DescribeComputeEnvironments.go index f2d514b7017..df71b9ff702 100644 --- a/service/batch/api_op_DescribeComputeEnvironments.go +++ b/service/batch/api_op_DescribeComputeEnvironments.go @@ -4,6 +4,7 @@ package batch 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/batch/types" @@ -128,6 +129,96 @@ func addOperationDescribeComputeEnvironmentsMiddlewares(stack *middleware.Stack, return nil } +// DescribeComputeEnvironmentsAPIClient is a client that implements the +// DescribeComputeEnvironments operation. +type DescribeComputeEnvironmentsAPIClient interface { + DescribeComputeEnvironments(context.Context, *DescribeComputeEnvironmentsInput, ...func(*Options)) (*DescribeComputeEnvironmentsOutput, error) +} + +var _ DescribeComputeEnvironmentsAPIClient = (*Client)(nil) + +// DescribeComputeEnvironmentsPaginatorOptions is the paginator options for +// DescribeComputeEnvironments +type DescribeComputeEnvironmentsPaginatorOptions struct { + // The maximum number of cluster results returned by DescribeComputeEnvironments in + // paginated output. When this parameter is used, DescribeComputeEnvironments only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another DescribeComputeEnvironments request with the returned nextToken value. + // This value can be between 1 and 100. If this parameter is not used, then + // DescribeComputeEnvironments returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// DescribeComputeEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeComputeEnvironments +type DescribeComputeEnvironmentsPaginator struct { + options DescribeComputeEnvironmentsPaginatorOptions + client DescribeComputeEnvironmentsAPIClient + params *DescribeComputeEnvironmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeComputeEnvironmentsPaginator returns a new +// DescribeComputeEnvironmentsPaginator +func NewDescribeComputeEnvironmentsPaginator(client DescribeComputeEnvironmentsAPIClient, params *DescribeComputeEnvironmentsInput, optFns ...func(*DescribeComputeEnvironmentsPaginatorOptions)) *DescribeComputeEnvironmentsPaginator { + options := DescribeComputeEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeComputeEnvironmentsInput{} + } + + return &DescribeComputeEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeComputeEnvironmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeComputeEnvironments page. +func (p *DescribeComputeEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeComputeEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeComputeEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeComputeEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_DescribeJobDefinitions.go b/service/batch/api_op_DescribeJobDefinitions.go index f44257e4dde..2160dcfcbee 100644 --- a/service/batch/api_op_DescribeJobDefinitions.go +++ b/service/batch/api_op_DescribeJobDefinitions.go @@ -4,6 +4,7 @@ package batch 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/batch/types" @@ -131,6 +132,94 @@ func addOperationDescribeJobDefinitionsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeJobDefinitionsAPIClient is a client that implements the +// DescribeJobDefinitions operation. +type DescribeJobDefinitionsAPIClient interface { + DescribeJobDefinitions(context.Context, *DescribeJobDefinitionsInput, ...func(*Options)) (*DescribeJobDefinitionsOutput, error) +} + +var _ DescribeJobDefinitionsAPIClient = (*Client)(nil) + +// DescribeJobDefinitionsPaginatorOptions is the paginator options for +// DescribeJobDefinitions +type DescribeJobDefinitionsPaginatorOptions struct { + // The maximum number of results returned by DescribeJobDefinitions in paginated + // output. When this parameter is used, DescribeJobDefinitions only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeJobDefinitions request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then DescribeJobDefinitions + // returns up to 100 results and a nextToken value if applicable. + 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 +} + +// DescribeJobDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeJobDefinitions +type DescribeJobDefinitionsPaginator struct { + options DescribeJobDefinitionsPaginatorOptions + client DescribeJobDefinitionsAPIClient + params *DescribeJobDefinitionsInput + nextToken *string + firstPage bool +} + +// NewDescribeJobDefinitionsPaginator returns a new DescribeJobDefinitionsPaginator +func NewDescribeJobDefinitionsPaginator(client DescribeJobDefinitionsAPIClient, params *DescribeJobDefinitionsInput, optFns ...func(*DescribeJobDefinitionsPaginatorOptions)) *DescribeJobDefinitionsPaginator { + options := DescribeJobDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeJobDefinitionsInput{} + } + + return &DescribeJobDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeJobDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeJobDefinitions page. +func (p *DescribeJobDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeJobDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeJobDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeJobDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_DescribeJobQueues.go b/service/batch/api_op_DescribeJobQueues.go index 214bd19ca7b..cf34a34ba9c 100644 --- a/service/batch/api_op_DescribeJobQueues.go +++ b/service/batch/api_op_DescribeJobQueues.go @@ -4,6 +4,7 @@ package batch 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/batch/types" @@ -123,6 +124,93 @@ func addOperationDescribeJobQueuesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeJobQueuesAPIClient is a client that implements the DescribeJobQueues +// operation. +type DescribeJobQueuesAPIClient interface { + DescribeJobQueues(context.Context, *DescribeJobQueuesInput, ...func(*Options)) (*DescribeJobQueuesOutput, error) +} + +var _ DescribeJobQueuesAPIClient = (*Client)(nil) + +// DescribeJobQueuesPaginatorOptions is the paginator options for DescribeJobQueues +type DescribeJobQueuesPaginatorOptions struct { + // The maximum number of results returned by DescribeJobQueues in paginated output. + // When this parameter is used, DescribeJobQueues only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another DescribeJobQueues request + // with the returned nextToken value. This value can be between 1 and 100. If this + // parameter is not used, then DescribeJobQueues returns up to 100 results and a + // nextToken value if applicable. + 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 +} + +// DescribeJobQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.DescribeJobQueues +type DescribeJobQueuesPaginator struct { + options DescribeJobQueuesPaginatorOptions + client DescribeJobQueuesAPIClient + params *DescribeJobQueuesInput + nextToken *string + firstPage bool +} + +// NewDescribeJobQueuesPaginator returns a new DescribeJobQueuesPaginator +func NewDescribeJobQueuesPaginator(client DescribeJobQueuesAPIClient, params *DescribeJobQueuesInput, optFns ...func(*DescribeJobQueuesPaginatorOptions)) *DescribeJobQueuesPaginator { + options := DescribeJobQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeJobQueuesInput{} + } + + return &DescribeJobQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeJobQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeJobQueues page. +func (p *DescribeJobQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeJobQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeJobQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeJobQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/api_op_ListJobs.go b/service/batch/api_op_ListJobs.go index cd01a8f4adf..273526c1c18 100644 --- a/service/batch/api_op_ListJobs.go +++ b/service/batch/api_op_ListJobs.go @@ -4,6 +4,7 @@ package batch 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/batch/types" @@ -151,6 +152,92 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results returned by ListJobs in paginated output. When + // this parameter is used, ListJobs only returns maxResults results in a single + // page along with a nextToken response element. The remaining results of the + // initial request can be seen by sending another ListJobs request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListJobs returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/batch.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/batch/endpoints.go b/service/batch/endpoints.go index 6c8ae2f6ece..2aa911e8963 100644 --- a/service/batch/endpoints.go +++ b/service/batch/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/braket/api_op_SearchDevices.go b/service/braket/api_op_SearchDevices.go index 44ce564aefd..8fa7329bda9 100644 --- a/service/braket/api_op_SearchDevices.go +++ b/service/braket/api_op_SearchDevices.go @@ -4,6 +4,7 @@ package braket 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/braket/types" @@ -116,3 +117,83 @@ func addOperationSearchDevicesMiddlewares(stack *middleware.Stack, options Optio } return nil } + +// SearchDevicesAPIClient is a client that implements the SearchDevices operation. +type SearchDevicesAPIClient interface { + SearchDevices(context.Context, *SearchDevicesInput, ...func(*Options)) (*SearchDevicesOutput, error) +} + +var _ SearchDevicesAPIClient = (*Client)(nil) + +// SearchDevicesPaginatorOptions is the paginator options for SearchDevices +type SearchDevicesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/braket.SearchDevices +type SearchDevicesPaginator struct { + options SearchDevicesPaginatorOptions + client SearchDevicesAPIClient + params *SearchDevicesInput + nextToken *string + firstPage bool +} + +// NewSearchDevicesPaginator returns a new SearchDevicesPaginator +func NewSearchDevicesPaginator(client SearchDevicesAPIClient, params *SearchDevicesInput, optFns ...func(*SearchDevicesPaginatorOptions)) *SearchDevicesPaginator { + options := SearchDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDevicesInput{} + } + + return &SearchDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchDevices page. +func (p *SearchDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/braket/api_op_SearchQuantumTasks.go b/service/braket/api_op_SearchQuantumTasks.go index eb319c8bc3d..78754004dbe 100644 --- a/service/braket/api_op_SearchQuantumTasks.go +++ b/service/braket/api_op_SearchQuantumTasks.go @@ -4,6 +4,7 @@ package braket 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/braket/types" @@ -116,3 +117,85 @@ func addOperationSearchQuantumTasksMiddlewares(stack *middleware.Stack, options } return nil } + +// SearchQuantumTasksAPIClient is a client that implements the SearchQuantumTasks +// operation. +type SearchQuantumTasksAPIClient interface { + SearchQuantumTasks(context.Context, *SearchQuantumTasksInput, ...func(*Options)) (*SearchQuantumTasksOutput, error) +} + +var _ SearchQuantumTasksAPIClient = (*Client)(nil) + +// SearchQuantumTasksPaginatorOptions is the paginator options for +// SearchQuantumTasks +type SearchQuantumTasksPaginatorOptions struct { + // Maximum number of results to return in the response. + 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 +} + +// SearchQuantumTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/braket.SearchQuantumTasks +type SearchQuantumTasksPaginator struct { + options SearchQuantumTasksPaginatorOptions + client SearchQuantumTasksAPIClient + params *SearchQuantumTasksInput + nextToken *string + firstPage bool +} + +// NewSearchQuantumTasksPaginator returns a new SearchQuantumTasksPaginator +func NewSearchQuantumTasksPaginator(client SearchQuantumTasksAPIClient, params *SearchQuantumTasksInput, optFns ...func(*SearchQuantumTasksPaginatorOptions)) *SearchQuantumTasksPaginator { + options := SearchQuantumTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchQuantumTasksInput{} + } + + return &SearchQuantumTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchQuantumTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchQuantumTasks page. +func (p *SearchQuantumTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchQuantumTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchQuantumTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/braket/endpoints.go b/service/braket/endpoints.go index 3de40cc8cf4..6d59c185abb 100644 --- a/service/braket/endpoints.go +++ b/service/braket/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/budgets/api_op_DescribeBudgetActionHistories.go b/service/budgets/api_op_DescribeBudgetActionHistories.go index d12c71d1d77..a1598dd5626 100644 --- a/service/budgets/api_op_DescribeBudgetActionHistories.go +++ b/service/budgets/api_op_DescribeBudgetActionHistories.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -132,6 +133,90 @@ func addOperationDescribeBudgetActionHistoriesMiddlewares(stack *middleware.Stac return nil } +// DescribeBudgetActionHistoriesAPIClient is a client that implements the +// DescribeBudgetActionHistories operation. +type DescribeBudgetActionHistoriesAPIClient interface { + DescribeBudgetActionHistories(context.Context, *DescribeBudgetActionHistoriesInput, ...func(*Options)) (*DescribeBudgetActionHistoriesOutput, error) +} + +var _ DescribeBudgetActionHistoriesAPIClient = (*Client)(nil) + +// DescribeBudgetActionHistoriesPaginatorOptions is the paginator options for +// DescribeBudgetActionHistories +type DescribeBudgetActionHistoriesPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + 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 +} + +// DescribeBudgetActionHistoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionHistories +type DescribeBudgetActionHistoriesPaginator struct { + options DescribeBudgetActionHistoriesPaginatorOptions + client DescribeBudgetActionHistoriesAPIClient + params *DescribeBudgetActionHistoriesInput + nextToken *string + firstPage bool +} + +// NewDescribeBudgetActionHistoriesPaginator returns a new +// DescribeBudgetActionHistoriesPaginator +func NewDescribeBudgetActionHistoriesPaginator(client DescribeBudgetActionHistoriesAPIClient, params *DescribeBudgetActionHistoriesInput, optFns ...func(*DescribeBudgetActionHistoriesPaginatorOptions)) *DescribeBudgetActionHistoriesPaginator { + options := DescribeBudgetActionHistoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionHistoriesInput{} + } + + return &DescribeBudgetActionHistoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionHistoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBudgetActionHistories page. +func (p *DescribeBudgetActionHistoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionHistoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBudgetActionHistories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionHistories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgetActionsForAccount.go b/service/budgets/api_op_DescribeBudgetActionsForAccount.go index 3c47267d6aa..90f7a4cbdb1 100644 --- a/service/budgets/api_op_DescribeBudgetActionsForAccount.go +++ b/service/budgets/api_op_DescribeBudgetActionsForAccount.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -116,6 +117,90 @@ func addOperationDescribeBudgetActionsForAccountMiddlewares(stack *middleware.St return nil } +// DescribeBudgetActionsForAccountAPIClient is a client that implements the +// DescribeBudgetActionsForAccount operation. +type DescribeBudgetActionsForAccountAPIClient interface { + DescribeBudgetActionsForAccount(context.Context, *DescribeBudgetActionsForAccountInput, ...func(*Options)) (*DescribeBudgetActionsForAccountOutput, error) +} + +var _ DescribeBudgetActionsForAccountAPIClient = (*Client)(nil) + +// DescribeBudgetActionsForAccountPaginatorOptions is the paginator options for +// DescribeBudgetActionsForAccount +type DescribeBudgetActionsForAccountPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + 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 +} + +// DescribeBudgetActionsForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionsForAccount +type DescribeBudgetActionsForAccountPaginator struct { + options DescribeBudgetActionsForAccountPaginatorOptions + client DescribeBudgetActionsForAccountAPIClient + params *DescribeBudgetActionsForAccountInput + nextToken *string + firstPage bool +} + +// NewDescribeBudgetActionsForAccountPaginator returns a new +// DescribeBudgetActionsForAccountPaginator +func NewDescribeBudgetActionsForAccountPaginator(client DescribeBudgetActionsForAccountAPIClient, params *DescribeBudgetActionsForAccountInput, optFns ...func(*DescribeBudgetActionsForAccountPaginatorOptions)) *DescribeBudgetActionsForAccountPaginator { + options := DescribeBudgetActionsForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionsForAccountInput{} + } + + return &DescribeBudgetActionsForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionsForAccountPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBudgetActionsForAccount page. +func (p *DescribeBudgetActionsForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionsForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBudgetActionsForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionsForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgetActionsForBudget.go b/service/budgets/api_op_DescribeBudgetActionsForBudget.go index 1f01c2970b0..44fa46218ae 100644 --- a/service/budgets/api_op_DescribeBudgetActionsForBudget.go +++ b/service/budgets/api_op_DescribeBudgetActionsForBudget.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -122,6 +123,90 @@ func addOperationDescribeBudgetActionsForBudgetMiddlewares(stack *middleware.Sta return nil } +// DescribeBudgetActionsForBudgetAPIClient is a client that implements the +// DescribeBudgetActionsForBudget operation. +type DescribeBudgetActionsForBudgetAPIClient interface { + DescribeBudgetActionsForBudget(context.Context, *DescribeBudgetActionsForBudgetInput, ...func(*Options)) (*DescribeBudgetActionsForBudgetOutput, error) +} + +var _ DescribeBudgetActionsForBudgetAPIClient = (*Client)(nil) + +// DescribeBudgetActionsForBudgetPaginatorOptions is the paginator options for +// DescribeBudgetActionsForBudget +type DescribeBudgetActionsForBudgetPaginatorOptions struct { + // An integer that represents how many entries a paginated response contains. The + // maximum is 100. + 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 +} + +// DescribeBudgetActionsForBudgetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgetActionsForBudget +type DescribeBudgetActionsForBudgetPaginator struct { + options DescribeBudgetActionsForBudgetPaginatorOptions + client DescribeBudgetActionsForBudgetAPIClient + params *DescribeBudgetActionsForBudgetInput + nextToken *string + firstPage bool +} + +// NewDescribeBudgetActionsForBudgetPaginator returns a new +// DescribeBudgetActionsForBudgetPaginator +func NewDescribeBudgetActionsForBudgetPaginator(client DescribeBudgetActionsForBudgetAPIClient, params *DescribeBudgetActionsForBudgetInput, optFns ...func(*DescribeBudgetActionsForBudgetPaginatorOptions)) *DescribeBudgetActionsForBudgetPaginator { + options := DescribeBudgetActionsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetActionsForBudgetInput{} + } + + return &DescribeBudgetActionsForBudgetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetActionsForBudgetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBudgetActionsForBudget page. +func (p *DescribeBudgetActionsForBudgetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetActionsForBudgetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBudgetActionsForBudget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgetActionsForBudget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeBudgets.go b/service/budgets/api_op_DescribeBudgets.go index 3b179b692e1..31cc3320fbe 100644 --- a/service/budgets/api_op_DescribeBudgets.go +++ b/service/budgets/api_op_DescribeBudgets.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -121,6 +122,88 @@ func addOperationDescribeBudgetsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeBudgetsAPIClient is a client that implements the DescribeBudgets +// operation. +type DescribeBudgetsAPIClient interface { + DescribeBudgets(context.Context, *DescribeBudgetsInput, ...func(*Options)) (*DescribeBudgetsOutput, error) +} + +var _ DescribeBudgetsAPIClient = (*Client)(nil) + +// DescribeBudgetsPaginatorOptions is the paginator options for DescribeBudgets +type DescribeBudgetsPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + 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 +} + +// DescribeBudgetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeBudgets +type DescribeBudgetsPaginator struct { + options DescribeBudgetsPaginatorOptions + client DescribeBudgetsAPIClient + params *DescribeBudgetsInput + nextToken *string + firstPage bool +} + +// NewDescribeBudgetsPaginator returns a new DescribeBudgetsPaginator +func NewDescribeBudgetsPaginator(client DescribeBudgetsAPIClient, params *DescribeBudgetsInput, optFns ...func(*DescribeBudgetsPaginatorOptions)) *DescribeBudgetsPaginator { + options := DescribeBudgetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBudgetsInput{} + } + + return &DescribeBudgetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBudgetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBudgets page. +func (p *DescribeBudgetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBudgetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBudgets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBudgets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeNotificationsForBudget.go b/service/budgets/api_op_DescribeNotificationsForBudget.go index 73eaf3eea1d..47b3c39d986 100644 --- a/service/budgets/api_op_DescribeNotificationsForBudget.go +++ b/service/budgets/api_op_DescribeNotificationsForBudget.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -124,6 +125,90 @@ func addOperationDescribeNotificationsForBudgetMiddlewares(stack *middleware.Sta return nil } +// DescribeNotificationsForBudgetAPIClient is a client that implements the +// DescribeNotificationsForBudget operation. +type DescribeNotificationsForBudgetAPIClient interface { + DescribeNotificationsForBudget(context.Context, *DescribeNotificationsForBudgetInput, ...func(*Options)) (*DescribeNotificationsForBudgetOutput, error) +} + +var _ DescribeNotificationsForBudgetAPIClient = (*Client)(nil) + +// DescribeNotificationsForBudgetPaginatorOptions is the paginator options for +// DescribeNotificationsForBudget +type DescribeNotificationsForBudgetPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + 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 +} + +// DescribeNotificationsForBudgetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeNotificationsForBudget +type DescribeNotificationsForBudgetPaginator struct { + options DescribeNotificationsForBudgetPaginatorOptions + client DescribeNotificationsForBudgetAPIClient + params *DescribeNotificationsForBudgetInput + nextToken *string + firstPage bool +} + +// NewDescribeNotificationsForBudgetPaginator returns a new +// DescribeNotificationsForBudgetPaginator +func NewDescribeNotificationsForBudgetPaginator(client DescribeNotificationsForBudgetAPIClient, params *DescribeNotificationsForBudgetInput, optFns ...func(*DescribeNotificationsForBudgetPaginatorOptions)) *DescribeNotificationsForBudgetPaginator { + options := DescribeNotificationsForBudgetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNotificationsForBudgetInput{} + } + + return &DescribeNotificationsForBudgetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNotificationsForBudgetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNotificationsForBudget page. +func (p *DescribeNotificationsForBudgetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNotificationsForBudgetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeNotificationsForBudget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNotificationsForBudget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/api_op_DescribeSubscribersForNotification.go b/service/budgets/api_op_DescribeSubscribersForNotification.go index e3efff5c24b..0a73496cd3a 100644 --- a/service/budgets/api_op_DescribeSubscribersForNotification.go +++ b/service/budgets/api_op_DescribeSubscribersForNotification.go @@ -4,6 +4,7 @@ package budgets 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/budgets/types" @@ -129,6 +130,90 @@ func addOperationDescribeSubscribersForNotificationMiddlewares(stack *middleware return nil } +// DescribeSubscribersForNotificationAPIClient is a client that implements the +// DescribeSubscribersForNotification operation. +type DescribeSubscribersForNotificationAPIClient interface { + DescribeSubscribersForNotification(context.Context, *DescribeSubscribersForNotificationInput, ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) +} + +var _ DescribeSubscribersForNotificationAPIClient = (*Client)(nil) + +// DescribeSubscribersForNotificationPaginatorOptions is the paginator options for +// DescribeSubscribersForNotification +type DescribeSubscribersForNotificationPaginatorOptions struct { + // An optional integer that represents how many entries a paginated response + // contains. The maximum is 100. + 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 +} + +// DescribeSubscribersForNotificationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/budgets.DescribeSubscribersForNotification +type DescribeSubscribersForNotificationPaginator struct { + options DescribeSubscribersForNotificationPaginatorOptions + client DescribeSubscribersForNotificationAPIClient + params *DescribeSubscribersForNotificationInput + nextToken *string + firstPage bool +} + +// NewDescribeSubscribersForNotificationPaginator returns a new +// DescribeSubscribersForNotificationPaginator +func NewDescribeSubscribersForNotificationPaginator(client DescribeSubscribersForNotificationAPIClient, params *DescribeSubscribersForNotificationInput, optFns ...func(*DescribeSubscribersForNotificationPaginatorOptions)) *DescribeSubscribersForNotificationPaginator { + options := DescribeSubscribersForNotificationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubscribersForNotificationInput{} + } + + return &DescribeSubscribersForNotificationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubscribersForNotificationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSubscribersForNotification page. +func (p *DescribeSubscribersForNotificationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubscribersForNotificationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeSubscribersForNotification(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubscribersForNotification(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/budgets/endpoints.go b/service/budgets/endpoints.go index 381c76431fc..d04c470f584 100644 --- a/service/budgets/endpoints.go +++ b/service/budgets/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/chime/api_op_ListAccounts.go b/service/chime/api_op_ListAccounts.go index 3f9b5d82006..e802f534886 100644 --- a/service/chime/api_op_ListAccounts.go +++ b/service/chime/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -114,6 +115,86 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // The maximum number of results to return in a single call. Defaults to 100. + 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 +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListAttendees.go b/service/chime/api_op_ListAttendees.go index 23c8182d01a..2b5ac12f0ba 100644 --- a/service/chime/api_op_ListAttendees.go +++ b/service/chime/api_op_ListAttendees.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -116,6 +117,86 @@ func addOperationListAttendeesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListAttendeesAPIClient is a client that implements the ListAttendees operation. +type ListAttendeesAPIClient interface { + ListAttendees(context.Context, *ListAttendeesInput, ...func(*Options)) (*ListAttendeesOutput, error) +} + +var _ ListAttendeesAPIClient = (*Client)(nil) + +// ListAttendeesPaginatorOptions is the paginator options for ListAttendees +type ListAttendeesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListAttendeesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListAttendees +type ListAttendeesPaginator struct { + options ListAttendeesPaginatorOptions + client ListAttendeesAPIClient + params *ListAttendeesInput + nextToken *string + firstPage bool +} + +// NewListAttendeesPaginator returns a new ListAttendeesPaginator +func NewListAttendeesPaginator(client ListAttendeesAPIClient, params *ListAttendeesInput, optFns ...func(*ListAttendeesPaginatorOptions)) *ListAttendeesPaginator { + options := ListAttendeesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttendeesInput{} + } + + return &ListAttendeesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttendeesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttendees page. +func (p *ListAttendeesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttendeesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAttendees(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttendees(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListBots.go b/service/chime/api_op_ListBots.go index 3cdcebc6df2..39af84dfbe6 100644 --- a/service/chime/api_op_ListBots.go +++ b/service/chime/api_op_ListBots.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -114,6 +115,86 @@ func addOperationListBotsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListBotsAPIClient is a client that implements the ListBots operation. +type ListBotsAPIClient interface { + ListBots(context.Context, *ListBotsInput, ...func(*Options)) (*ListBotsOutput, error) +} + +var _ ListBotsAPIClient = (*Client)(nil) + +// ListBotsPaginatorOptions is the paginator options for ListBots +type ListBotsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default is 10. + 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 +} + +// ListBotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListBots +type ListBotsPaginator struct { + options ListBotsPaginatorOptions + client ListBotsAPIClient + params *ListBotsInput + nextToken *string + firstPage bool +} + +// NewListBotsPaginator returns a new ListBotsPaginator +func NewListBotsPaginator(client ListBotsAPIClient, params *ListBotsInput, optFns ...func(*ListBotsPaginatorOptions)) *ListBotsPaginator { + options := ListBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBotsInput{} + } + + return &ListBotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBots page. +func (p *ListBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListMeetings.go b/service/chime/api_op_ListMeetings.go index bfdea015fa8..846497203f3 100644 --- a/service/chime/api_op_ListMeetings.go +++ b/service/chime/api_op_ListMeetings.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -108,6 +109,86 @@ func addOperationListMeetingsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListMeetingsAPIClient is a client that implements the ListMeetings operation. +type ListMeetingsAPIClient interface { + ListMeetings(context.Context, *ListMeetingsInput, ...func(*Options)) (*ListMeetingsOutput, error) +} + +var _ ListMeetingsAPIClient = (*Client)(nil) + +// ListMeetingsPaginatorOptions is the paginator options for ListMeetings +type ListMeetingsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListMeetingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListMeetings +type ListMeetingsPaginator struct { + options ListMeetingsPaginatorOptions + client ListMeetingsAPIClient + params *ListMeetingsInput + nextToken *string + firstPage bool +} + +// NewListMeetingsPaginator returns a new ListMeetingsPaginator +func NewListMeetingsPaginator(client ListMeetingsAPIClient, params *ListMeetingsInput, optFns ...func(*ListMeetingsPaginatorOptions)) *ListMeetingsPaginator { + options := ListMeetingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMeetingsInput{} + } + + return &ListMeetingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMeetingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMeetings page. +func (p *ListMeetingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMeetingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMeetings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMeetings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListPhoneNumberOrders.go b/service/chime/api_op_ListPhoneNumberOrders.go index c2f018cb17f..ba70ce2d4a9 100644 --- a/service/chime/api_op_ListPhoneNumberOrders.go +++ b/service/chime/api_op_ListPhoneNumberOrders.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -105,6 +106,88 @@ func addOperationListPhoneNumberOrdersMiddlewares(stack *middleware.Stack, optio return nil } +// ListPhoneNumberOrdersAPIClient is a client that implements the +// ListPhoneNumberOrders operation. +type ListPhoneNumberOrdersAPIClient interface { + ListPhoneNumberOrders(context.Context, *ListPhoneNumberOrdersInput, ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) +} + +var _ ListPhoneNumberOrdersAPIClient = (*Client)(nil) + +// ListPhoneNumberOrdersPaginatorOptions is the paginator options for +// ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListPhoneNumberOrdersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginator struct { + options ListPhoneNumberOrdersPaginatorOptions + client ListPhoneNumberOrdersAPIClient + params *ListPhoneNumberOrdersInput + nextToken *string + firstPage bool +} + +// NewListPhoneNumberOrdersPaginator returns a new ListPhoneNumberOrdersPaginator +func NewListPhoneNumberOrdersPaginator(client ListPhoneNumberOrdersAPIClient, params *ListPhoneNumberOrdersInput, optFns ...func(*ListPhoneNumberOrdersPaginatorOptions)) *ListPhoneNumberOrdersPaginator { + options := ListPhoneNumberOrdersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumberOrdersInput{} + } + + return &ListPhoneNumberOrdersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumberOrdersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPhoneNumberOrders page. +func (p *ListPhoneNumberOrdersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPhoneNumberOrders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumberOrders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListPhoneNumbers.go b/service/chime/api_op_ListPhoneNumbers.go index b7c46d3cb98..efc024e54b0 100644 --- a/service/chime/api_op_ListPhoneNumbers.go +++ b/service/chime/api_op_ListPhoneNumbers.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -118,6 +119,87 @@ func addOperationListPhoneNumbersMiddlewares(stack *middleware.Stack, options Op return nil } +// ListPhoneNumbersAPIClient is a client that implements the ListPhoneNumbers +// operation. +type ListPhoneNumbersAPIClient interface { + ListPhoneNumbers(context.Context, *ListPhoneNumbersInput, ...func(*Options)) (*ListPhoneNumbersOutput, error) +} + +var _ ListPhoneNumbersAPIClient = (*Client)(nil) + +// ListPhoneNumbersPaginatorOptions is the paginator options for ListPhoneNumbers +type ListPhoneNumbersPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListPhoneNumbersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListPhoneNumbers +type ListPhoneNumbersPaginator struct { + options ListPhoneNumbersPaginatorOptions + client ListPhoneNumbersAPIClient + params *ListPhoneNumbersInput + nextToken *string + firstPage bool +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumbersInput{} + } + + return &ListPhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumbersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPhoneNumbers page. +func (p *ListPhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListProxySessions.go b/service/chime/api_op_ListProxySessions.go index cf3a05796df..0c21d48b749 100644 --- a/service/chime/api_op_ListProxySessions.go +++ b/service/chime/api_op_ListProxySessions.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -116,6 +117,87 @@ func addOperationListProxySessionsMiddlewares(stack *middleware.Stack, options O return nil } +// ListProxySessionsAPIClient is a client that implements the ListProxySessions +// operation. +type ListProxySessionsAPIClient interface { + ListProxySessions(context.Context, *ListProxySessionsInput, ...func(*Options)) (*ListProxySessionsOutput, error) +} + +var _ ListProxySessionsAPIClient = (*Client)(nil) + +// ListProxySessionsPaginatorOptions is the paginator options for ListProxySessions +type ListProxySessionsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListProxySessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListProxySessions +type ListProxySessionsPaginator struct { + options ListProxySessionsPaginatorOptions + client ListProxySessionsAPIClient + params *ListProxySessionsInput + nextToken *string + firstPage bool +} + +// NewListProxySessionsPaginator returns a new ListProxySessionsPaginator +func NewListProxySessionsPaginator(client ListProxySessionsAPIClient, params *ListProxySessionsInput, optFns ...func(*ListProxySessionsPaginatorOptions)) *ListProxySessionsPaginator { + options := ListProxySessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProxySessionsInput{} + } + + return &ListProxySessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProxySessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProxySessions page. +func (p *ListProxySessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProxySessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProxySessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProxySessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListRoomMemberships.go b/service/chime/api_op_ListRoomMemberships.go index 90b5e8cc135..d93d2293d32 100644 --- a/service/chime/api_op_ListRoomMemberships.go +++ b/service/chime/api_op_ListRoomMemberships.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -119,6 +120,88 @@ func addOperationListRoomMembershipsMiddlewares(stack *middleware.Stack, options return nil } +// ListRoomMembershipsAPIClient is a client that implements the ListRoomMemberships +// operation. +type ListRoomMembershipsAPIClient interface { + ListRoomMemberships(context.Context, *ListRoomMembershipsInput, ...func(*Options)) (*ListRoomMembershipsOutput, error) +} + +var _ ListRoomMembershipsAPIClient = (*Client)(nil) + +// ListRoomMembershipsPaginatorOptions is the paginator options for +// ListRoomMemberships +type ListRoomMembershipsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListRoomMembershipsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListRoomMemberships +type ListRoomMembershipsPaginator struct { + options ListRoomMembershipsPaginatorOptions + client ListRoomMembershipsAPIClient + params *ListRoomMembershipsInput + nextToken *string + firstPage bool +} + +// NewListRoomMembershipsPaginator returns a new ListRoomMembershipsPaginator +func NewListRoomMembershipsPaginator(client ListRoomMembershipsAPIClient, params *ListRoomMembershipsInput, optFns ...func(*ListRoomMembershipsPaginatorOptions)) *ListRoomMembershipsPaginator { + options := ListRoomMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoomMembershipsInput{} + } + + return &ListRoomMembershipsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoomMembershipsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoomMemberships page. +func (p *ListRoomMembershipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoomMembershipsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRoomMemberships(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoomMemberships(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListRooms.go b/service/chime/api_op_ListRooms.go index 39fb3dfdb65..075a5021663 100644 --- a/service/chime/api_op_ListRooms.go +++ b/service/chime/api_op_ListRooms.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -118,6 +119,86 @@ func addOperationListRoomsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListRoomsAPIClient is a client that implements the ListRooms operation. +type ListRoomsAPIClient interface { + ListRooms(context.Context, *ListRoomsInput, ...func(*Options)) (*ListRoomsOutput, error) +} + +var _ ListRoomsAPIClient = (*Client)(nil) + +// ListRoomsPaginatorOptions is the paginator options for ListRooms +type ListRoomsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListRoomsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListRooms +type ListRoomsPaginator struct { + options ListRoomsPaginatorOptions + client ListRoomsAPIClient + params *ListRoomsInput + nextToken *string + firstPage bool +} + +// NewListRoomsPaginator returns a new ListRoomsPaginator +func NewListRoomsPaginator(client ListRoomsAPIClient, params *ListRoomsInput, optFns ...func(*ListRoomsPaginatorOptions)) *ListRoomsPaginator { + options := ListRoomsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoomsInput{} + } + + return &ListRoomsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoomsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRooms page. +func (p *ListRoomsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoomsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRooms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRooms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListUsers.go b/service/chime/api_op_ListUsers.go index 308bb8d87fd..83b8441fb4b 100644 --- a/service/chime/api_op_ListUsers.go +++ b/service/chime/api_op_ListUsers.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -121,6 +122,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to return in a single call. Defaults to 100. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListVoiceConnectorGroups.go b/service/chime/api_op_ListVoiceConnectorGroups.go index 69c5d03ba6c..09a429872cb 100644 --- a/service/chime/api_op_ListVoiceConnectorGroups.go +++ b/service/chime/api_op_ListVoiceConnectorGroups.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -106,6 +107,89 @@ func addOperationListVoiceConnectorGroupsMiddlewares(stack *middleware.Stack, op return nil } +// ListVoiceConnectorGroupsAPIClient is a client that implements the +// ListVoiceConnectorGroups operation. +type ListVoiceConnectorGroupsAPIClient interface { + ListVoiceConnectorGroups(context.Context, *ListVoiceConnectorGroupsInput, ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) +} + +var _ ListVoiceConnectorGroupsAPIClient = (*Client)(nil) + +// ListVoiceConnectorGroupsPaginatorOptions is the paginator options for +// ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListVoiceConnectorGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginator struct { + options ListVoiceConnectorGroupsPaginatorOptions + client ListVoiceConnectorGroupsAPIClient + params *ListVoiceConnectorGroupsInput + nextToken *string + firstPage bool +} + +// NewListVoiceConnectorGroupsPaginator returns a new +// ListVoiceConnectorGroupsPaginator +func NewListVoiceConnectorGroupsPaginator(client ListVoiceConnectorGroupsAPIClient, params *ListVoiceConnectorGroupsInput, optFns ...func(*ListVoiceConnectorGroupsPaginatorOptions)) *ListVoiceConnectorGroupsPaginator { + options := ListVoiceConnectorGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVoiceConnectorGroupsInput{} + } + + return &ListVoiceConnectorGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVoiceConnectorGroups page. +func (p *ListVoiceConnectorGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListVoiceConnectorGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVoiceConnectorGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/api_op_ListVoiceConnectors.go b/service/chime/api_op_ListVoiceConnectors.go index b3e7a71467b..81e0d4c684d 100644 --- a/service/chime/api_op_ListVoiceConnectors.go +++ b/service/chime/api_op_ListVoiceConnectors.go @@ -4,6 +4,7 @@ package chime 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/chime/types" @@ -105,6 +106,88 @@ func addOperationListVoiceConnectorsMiddlewares(stack *middleware.Stack, options return nil } +// ListVoiceConnectorsAPIClient is a client that implements the ListVoiceConnectors +// operation. +type ListVoiceConnectorsAPIClient interface { + ListVoiceConnectors(context.Context, *ListVoiceConnectorsInput, ...func(*Options)) (*ListVoiceConnectorsOutput, error) +} + +var _ ListVoiceConnectorsAPIClient = (*Client)(nil) + +// ListVoiceConnectorsPaginatorOptions is the paginator options for +// ListVoiceConnectors +type ListVoiceConnectorsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListVoiceConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/chime.ListVoiceConnectors +type ListVoiceConnectorsPaginator struct { + options ListVoiceConnectorsPaginatorOptions + client ListVoiceConnectorsAPIClient + params *ListVoiceConnectorsInput + nextToken *string + firstPage bool +} + +// NewListVoiceConnectorsPaginator returns a new ListVoiceConnectorsPaginator +func NewListVoiceConnectorsPaginator(client ListVoiceConnectorsAPIClient, params *ListVoiceConnectorsInput, optFns ...func(*ListVoiceConnectorsPaginatorOptions)) *ListVoiceConnectorsPaginator { + options := ListVoiceConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVoiceConnectorsInput{} + } + + return &ListVoiceConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVoiceConnectors page. +func (p *ListVoiceConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListVoiceConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVoiceConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/chime/endpoints.go b/service/chime/endpoints.go index dc7c23c75ef..ab216a20ea7 100644 --- a/service/chime/endpoints.go +++ b/service/chime/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloud9/api_op_DescribeEnvironmentMemberships.go b/service/cloud9/api_op_DescribeEnvironmentMemberships.go index 9a4f1678a75..a97ffb81a63 100644 --- a/service/cloud9/api_op_DescribeEnvironmentMemberships.go +++ b/service/cloud9/api_op_DescribeEnvironmentMemberships.go @@ -4,6 +4,7 @@ package cloud9 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/cloud9/types" @@ -137,6 +138,89 @@ func addOperationDescribeEnvironmentMembershipsMiddlewares(stack *middleware.Sta return nil } +// DescribeEnvironmentMembershipsAPIClient is a client that implements the +// DescribeEnvironmentMemberships operation. +type DescribeEnvironmentMembershipsAPIClient interface { + DescribeEnvironmentMemberships(context.Context, *DescribeEnvironmentMembershipsInput, ...func(*Options)) (*DescribeEnvironmentMembershipsOutput, error) +} + +var _ DescribeEnvironmentMembershipsAPIClient = (*Client)(nil) + +// DescribeEnvironmentMembershipsPaginatorOptions is the paginator options for +// DescribeEnvironmentMemberships +type DescribeEnvironmentMembershipsPaginatorOptions struct { + // The maximum number of environment members to get information about. + 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 +} + +// DescribeEnvironmentMembershipsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloud9.DescribeEnvironmentMemberships +type DescribeEnvironmentMembershipsPaginator struct { + options DescribeEnvironmentMembershipsPaginatorOptions + client DescribeEnvironmentMembershipsAPIClient + params *DescribeEnvironmentMembershipsInput + nextToken *string + firstPage bool +} + +// NewDescribeEnvironmentMembershipsPaginator returns a new +// DescribeEnvironmentMembershipsPaginator +func NewDescribeEnvironmentMembershipsPaginator(client DescribeEnvironmentMembershipsAPIClient, params *DescribeEnvironmentMembershipsInput, optFns ...func(*DescribeEnvironmentMembershipsPaginatorOptions)) *DescribeEnvironmentMembershipsPaginator { + options := DescribeEnvironmentMembershipsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEnvironmentMembershipsInput{} + } + + return &DescribeEnvironmentMembershipsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEnvironmentMembershipsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEnvironmentMemberships page. +func (p *DescribeEnvironmentMembershipsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEnvironmentMembershipsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEnvironmentMemberships(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEnvironmentMemberships(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloud9/api_op_ListEnvironments.go b/service/cloud9/api_op_ListEnvironments.go index b2564398cb9..a50b3a21c7b 100644 --- a/service/cloud9/api_op_ListEnvironments.go +++ b/service/cloud9/api_op_ListEnvironments.go @@ -4,6 +4,7 @@ package cloud9 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/awslabs/smithy-go/middleware" @@ -112,6 +113,87 @@ func addOperationListEnvironmentsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListEnvironmentsAPIClient is a client that implements the ListEnvironments +// operation. +type ListEnvironmentsAPIClient interface { + ListEnvironments(context.Context, *ListEnvironmentsInput, ...func(*Options)) (*ListEnvironmentsOutput, error) +} + +var _ ListEnvironmentsAPIClient = (*Client)(nil) + +// ListEnvironmentsPaginatorOptions is the paginator options for ListEnvironments +type ListEnvironmentsPaginatorOptions struct { + // The maximum number of environments to get identifiers for. + 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 +} + +// ListEnvironmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloud9.ListEnvironments +type ListEnvironmentsPaginator struct { + options ListEnvironmentsPaginatorOptions + client ListEnvironmentsAPIClient + params *ListEnvironmentsInput + nextToken *string + firstPage bool +} + +// NewListEnvironmentsPaginator returns a new ListEnvironmentsPaginator +func NewListEnvironmentsPaginator(client ListEnvironmentsAPIClient, params *ListEnvironmentsInput, optFns ...func(*ListEnvironmentsPaginatorOptions)) *ListEnvironmentsPaginator { + options := ListEnvironmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnvironmentsInput{} + } + + return &ListEnvironmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnvironmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEnvironments page. +func (p *ListEnvironmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnvironmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEnvironments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnvironments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloud9/endpoints.go b/service/cloud9/endpoints.go index c21217a294f..4a43e91ff9f 100644 --- a/service/cloud9/endpoints.go +++ b/service/cloud9/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/clouddirectory/api_op_ListAppliedSchemaArns.go b/service/clouddirectory/api_op_ListAppliedSchemaArns.go index a87d63a9cb3..4ab06979966 100644 --- a/service/clouddirectory/api_op_ListAppliedSchemaArns.go +++ b/service/clouddirectory/api_op_ListAppliedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -117,6 +118,88 @@ func addOperationListAppliedSchemaArnsMiddlewares(stack *middleware.Stack, optio return nil } +// ListAppliedSchemaArnsAPIClient is a client that implements the +// ListAppliedSchemaArns operation. +type ListAppliedSchemaArnsAPIClient interface { + ListAppliedSchemaArns(context.Context, *ListAppliedSchemaArnsInput, ...func(*Options)) (*ListAppliedSchemaArnsOutput, error) +} + +var _ ListAppliedSchemaArnsAPIClient = (*Client)(nil) + +// ListAppliedSchemaArnsPaginatorOptions is the paginator options for +// ListAppliedSchemaArns +type ListAppliedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListAppliedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListAppliedSchemaArns +type ListAppliedSchemaArnsPaginator struct { + options ListAppliedSchemaArnsPaginatorOptions + client ListAppliedSchemaArnsAPIClient + params *ListAppliedSchemaArnsInput + nextToken *string + firstPage bool +} + +// NewListAppliedSchemaArnsPaginator returns a new ListAppliedSchemaArnsPaginator +func NewListAppliedSchemaArnsPaginator(client ListAppliedSchemaArnsAPIClient, params *ListAppliedSchemaArnsInput, optFns ...func(*ListAppliedSchemaArnsPaginatorOptions)) *ListAppliedSchemaArnsPaginator { + options := ListAppliedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAppliedSchemaArnsInput{} + } + + return &ListAppliedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppliedSchemaArnsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAppliedSchemaArns page. +func (p *ListAppliedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppliedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAppliedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAppliedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListAttachedIndices.go b/service/clouddirectory/api_op_ListAttachedIndices.go index 44dad82a559..d885bb4c488 100644 --- a/service/clouddirectory/api_op_ListAttachedIndices.go +++ b/service/clouddirectory/api_op_ListAttachedIndices.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -121,6 +122,88 @@ func addOperationListAttachedIndicesMiddlewares(stack *middleware.Stack, options return nil } +// ListAttachedIndicesAPIClient is a client that implements the ListAttachedIndices +// operation. +type ListAttachedIndicesAPIClient interface { + ListAttachedIndices(context.Context, *ListAttachedIndicesInput, ...func(*Options)) (*ListAttachedIndicesOutput, error) +} + +var _ ListAttachedIndicesAPIClient = (*Client)(nil) + +// ListAttachedIndicesPaginatorOptions is the paginator options for +// ListAttachedIndices +type ListAttachedIndicesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListAttachedIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListAttachedIndices +type ListAttachedIndicesPaginator struct { + options ListAttachedIndicesPaginatorOptions + client ListAttachedIndicesAPIClient + params *ListAttachedIndicesInput + nextToken *string + firstPage bool +} + +// NewListAttachedIndicesPaginator returns a new ListAttachedIndicesPaginator +func NewListAttachedIndicesPaginator(client ListAttachedIndicesAPIClient, params *ListAttachedIndicesInput, optFns ...func(*ListAttachedIndicesPaginatorOptions)) *ListAttachedIndicesPaginator { + options := ListAttachedIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedIndicesInput{} + } + + return &ListAttachedIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedIndicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttachedIndices page. +func (p *ListAttachedIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAttachedIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go b/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go index 654af8503d6..2ead5219831 100644 --- a/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go +++ b/service/clouddirectory/api_op_ListDevelopmentSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -104,6 +105,89 @@ func addOperationListDevelopmentSchemaArnsMiddlewares(stack *middleware.Stack, o return nil } +// ListDevelopmentSchemaArnsAPIClient is a client that implements the +// ListDevelopmentSchemaArns operation. +type ListDevelopmentSchemaArnsAPIClient interface { + ListDevelopmentSchemaArns(context.Context, *ListDevelopmentSchemaArnsInput, ...func(*Options)) (*ListDevelopmentSchemaArnsOutput, error) +} + +var _ ListDevelopmentSchemaArnsAPIClient = (*Client)(nil) + +// ListDevelopmentSchemaArnsPaginatorOptions is the paginator options for +// ListDevelopmentSchemaArns +type ListDevelopmentSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListDevelopmentSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListDevelopmentSchemaArns +type ListDevelopmentSchemaArnsPaginator struct { + options ListDevelopmentSchemaArnsPaginatorOptions + client ListDevelopmentSchemaArnsAPIClient + params *ListDevelopmentSchemaArnsInput + nextToken *string + firstPage bool +} + +// NewListDevelopmentSchemaArnsPaginator returns a new +// ListDevelopmentSchemaArnsPaginator +func NewListDevelopmentSchemaArnsPaginator(client ListDevelopmentSchemaArnsAPIClient, params *ListDevelopmentSchemaArnsInput, optFns ...func(*ListDevelopmentSchemaArnsPaginatorOptions)) *ListDevelopmentSchemaArnsPaginator { + options := ListDevelopmentSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevelopmentSchemaArnsInput{} + } + + return &ListDevelopmentSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevelopmentSchemaArnsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDevelopmentSchemaArns page. +func (p *ListDevelopmentSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevelopmentSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDevelopmentSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevelopmentSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListDirectories.go b/service/clouddirectory/api_op_ListDirectories.go index b6d4d31beb5..111d03ddcaa 100644 --- a/service/clouddirectory/api_op_ListDirectories.go +++ b/service/clouddirectory/api_op_ListDirectories.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -112,6 +113,87 @@ func addOperationListDirectoriesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDirectoriesAPIClient is a client that implements the ListDirectories +// operation. +type ListDirectoriesAPIClient interface { + ListDirectories(context.Context, *ListDirectoriesInput, ...func(*Options)) (*ListDirectoriesOutput, error) +} + +var _ ListDirectoriesAPIClient = (*Client)(nil) + +// ListDirectoriesPaginatorOptions is the paginator options for ListDirectories +type ListDirectoriesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListDirectoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListDirectories +type ListDirectoriesPaginator struct { + options ListDirectoriesPaginatorOptions + client ListDirectoriesAPIClient + params *ListDirectoriesInput + nextToken *string + firstPage bool +} + +// NewListDirectoriesPaginator returns a new ListDirectoriesPaginator +func NewListDirectoriesPaginator(client ListDirectoriesAPIClient, params *ListDirectoriesInput, optFns ...func(*ListDirectoriesPaginatorOptions)) *ListDirectoriesPaginator { + options := ListDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDirectoriesInput{} + } + + return &ListDirectoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDirectoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDirectories page. +func (p *ListDirectoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDirectoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDirectories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDirectories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListFacetAttributes.go b/service/clouddirectory/api_op_ListFacetAttributes.go index e4ae09b4524..55a2a0f9b18 100644 --- a/service/clouddirectory/api_op_ListFacetAttributes.go +++ b/service/clouddirectory/api_op_ListFacetAttributes.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -118,6 +119,88 @@ func addOperationListFacetAttributesMiddlewares(stack *middleware.Stack, options return nil } +// ListFacetAttributesAPIClient is a client that implements the ListFacetAttributes +// operation. +type ListFacetAttributesAPIClient interface { + ListFacetAttributes(context.Context, *ListFacetAttributesInput, ...func(*Options)) (*ListFacetAttributesOutput, error) +} + +var _ ListFacetAttributesAPIClient = (*Client)(nil) + +// ListFacetAttributesPaginatorOptions is the paginator options for +// ListFacetAttributes +type ListFacetAttributesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListFacetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListFacetAttributes +type ListFacetAttributesPaginator struct { + options ListFacetAttributesPaginatorOptions + client ListFacetAttributesAPIClient + params *ListFacetAttributesInput + nextToken *string + firstPage bool +} + +// NewListFacetAttributesPaginator returns a new ListFacetAttributesPaginator +func NewListFacetAttributesPaginator(client ListFacetAttributesAPIClient, params *ListFacetAttributesInput, optFns ...func(*ListFacetAttributesPaginatorOptions)) *ListFacetAttributesPaginator { + options := ListFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacetAttributesInput{} + } + + return &ListFacetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacetAttributesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFacetAttributes page. +func (p *ListFacetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFacetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFacetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListFacetNames.go b/service/clouddirectory/api_op_ListFacetNames.go index 080bcb4a45e..7ec486484f1 100644 --- a/service/clouddirectory/api_op_ListFacetNames.go +++ b/service/clouddirectory/api_op_ListFacetNames.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -112,6 +113,87 @@ func addOperationListFacetNamesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListFacetNamesAPIClient is a client that implements the ListFacetNames +// operation. +type ListFacetNamesAPIClient interface { + ListFacetNames(context.Context, *ListFacetNamesInput, ...func(*Options)) (*ListFacetNamesOutput, error) +} + +var _ ListFacetNamesAPIClient = (*Client)(nil) + +// ListFacetNamesPaginatorOptions is the paginator options for ListFacetNames +type ListFacetNamesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListFacetNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListFacetNames +type ListFacetNamesPaginator struct { + options ListFacetNamesPaginatorOptions + client ListFacetNamesAPIClient + params *ListFacetNamesInput + nextToken *string + firstPage bool +} + +// NewListFacetNamesPaginator returns a new ListFacetNamesPaginator +func NewListFacetNamesPaginator(client ListFacetNamesAPIClient, params *ListFacetNamesInput, optFns ...func(*ListFacetNamesPaginatorOptions)) *ListFacetNamesPaginator { + options := ListFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacetNamesInput{} + } + + return &ListFacetNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacetNamesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFacetNames page. +func (p *ListFacetNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacetNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFacetNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFacetNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListIndex.go b/service/clouddirectory/api_op_ListIndex.go index fac822a32c4..9a839a9e7aa 100644 --- a/service/clouddirectory/api_op_ListIndex.go +++ b/service/clouddirectory/api_op_ListIndex.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -126,6 +127,88 @@ func addOperationListIndexMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListIndexAPIClient is a client that implements the ListIndex operation. +type ListIndexAPIClient interface { + ListIndex(context.Context, *ListIndexInput, ...func(*Options)) (*ListIndexOutput, error) +} + +var _ ListIndexAPIClient = (*Client)(nil) + +// ListIndexPaginatorOptions is the paginator options for ListIndex +type ListIndexPaginatorOptions struct { + // The maximum number of objects in a single page to retrieve from the index during + // a request. For more information, see Amazon Cloud Directory Limits + // (http://docs.aws.amazon.com/clouddirectory/latest/developerguide/limits.html). + 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 +} + +// ListIndexPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListIndex +type ListIndexPaginator struct { + options ListIndexPaginatorOptions + client ListIndexAPIClient + params *ListIndexInput + nextToken *string + firstPage bool +} + +// NewListIndexPaginator returns a new ListIndexPaginator +func NewListIndexPaginator(client ListIndexAPIClient, params *ListIndexInput, optFns ...func(*ListIndexPaginatorOptions)) *ListIndexPaginator { + options := ListIndexPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndexInput{} + } + + return &ListIndexPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndexPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIndex page. +func (p *ListIndexPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndexOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListIndex(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndex(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListManagedSchemaArns.go b/service/clouddirectory/api_op_ListManagedSchemaArns.go index 854b7efdd3b..98a8cabfba3 100644 --- a/service/clouddirectory/api_op_ListManagedSchemaArns.go +++ b/service/clouddirectory/api_op_ListManagedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -110,6 +111,88 @@ func addOperationListManagedSchemaArnsMiddlewares(stack *middleware.Stack, optio return nil } +// ListManagedSchemaArnsAPIClient is a client that implements the +// ListManagedSchemaArns operation. +type ListManagedSchemaArnsAPIClient interface { + ListManagedSchemaArns(context.Context, *ListManagedSchemaArnsInput, ...func(*Options)) (*ListManagedSchemaArnsOutput, error) +} + +var _ ListManagedSchemaArnsAPIClient = (*Client)(nil) + +// ListManagedSchemaArnsPaginatorOptions is the paginator options for +// ListManagedSchemaArns +type ListManagedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListManagedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListManagedSchemaArns +type ListManagedSchemaArnsPaginator struct { + options ListManagedSchemaArnsPaginatorOptions + client ListManagedSchemaArnsAPIClient + params *ListManagedSchemaArnsInput + nextToken *string + firstPage bool +} + +// NewListManagedSchemaArnsPaginator returns a new ListManagedSchemaArnsPaginator +func NewListManagedSchemaArnsPaginator(client ListManagedSchemaArnsAPIClient, params *ListManagedSchemaArnsInput, optFns ...func(*ListManagedSchemaArnsPaginatorOptions)) *ListManagedSchemaArnsPaginator { + options := ListManagedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListManagedSchemaArnsInput{} + } + + return &ListManagedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListManagedSchemaArnsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListManagedSchemaArns page. +func (p *ListManagedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListManagedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListManagedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectAttributes.go b/service/clouddirectory/api_op_ListObjectAttributes.go index a85171994de..8b14a208f88 100644 --- a/service/clouddirectory/api_op_ListObjectAttributes.go +++ b/service/clouddirectory/api_op_ListObjectAttributes.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -129,6 +130,89 @@ func addOperationListObjectAttributesMiddlewares(stack *middleware.Stack, option return nil } +// ListObjectAttributesAPIClient is a client that implements the +// ListObjectAttributes operation. +type ListObjectAttributesAPIClient interface { + ListObjectAttributes(context.Context, *ListObjectAttributesInput, ...func(*Options)) (*ListObjectAttributesOutput, error) +} + +var _ ListObjectAttributesAPIClient = (*Client)(nil) + +// ListObjectAttributesPaginatorOptions is the paginator options for +// ListObjectAttributes +type ListObjectAttributesPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListObjectAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectAttributes +type ListObjectAttributesPaginator struct { + options ListObjectAttributesPaginatorOptions + client ListObjectAttributesAPIClient + params *ListObjectAttributesInput + nextToken *string + firstPage bool +} + +// NewListObjectAttributesPaginator returns a new ListObjectAttributesPaginator +func NewListObjectAttributesPaginator(client ListObjectAttributesAPIClient, params *ListObjectAttributesInput, optFns ...func(*ListObjectAttributesPaginatorOptions)) *ListObjectAttributesPaginator { + options := ListObjectAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectAttributesInput{} + } + + return &ListObjectAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectAttributesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectAttributes page. +func (p *ListObjectAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListObjectAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectChildren.go b/service/clouddirectory/api_op_ListObjectChildren.go index c406909ceff..2ddb399bfda 100644 --- a/service/clouddirectory/api_op_ListObjectChildren.go +++ b/service/clouddirectory/api_op_ListObjectChildren.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -127,6 +128,89 @@ func addOperationListObjectChildrenMiddlewares(stack *middleware.Stack, options return nil } +// ListObjectChildrenAPIClient is a client that implements the ListObjectChildren +// operation. +type ListObjectChildrenAPIClient interface { + ListObjectChildren(context.Context, *ListObjectChildrenInput, ...func(*Options)) (*ListObjectChildrenOutput, error) +} + +var _ ListObjectChildrenAPIClient = (*Client)(nil) + +// ListObjectChildrenPaginatorOptions is the paginator options for +// ListObjectChildren +type ListObjectChildrenPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListObjectChildrenPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectChildren +type ListObjectChildrenPaginator struct { + options ListObjectChildrenPaginatorOptions + client ListObjectChildrenAPIClient + params *ListObjectChildrenInput + nextToken *string + firstPage bool +} + +// NewListObjectChildrenPaginator returns a new ListObjectChildrenPaginator +func NewListObjectChildrenPaginator(client ListObjectChildrenAPIClient, params *ListObjectChildrenInput, optFns ...func(*ListObjectChildrenPaginatorOptions)) *ListObjectChildrenPaginator { + options := ListObjectChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectChildrenInput{} + } + + return &ListObjectChildrenPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectChildrenPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectChildren page. +func (p *ListObjectChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectChildrenOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListObjectChildren(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectChildren(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectParentPaths.go b/service/clouddirectory/api_op_ListObjectParentPaths.go index 9145006126b..60056b103ab 100644 --- a/service/clouddirectory/api_op_ListObjectParentPaths.go +++ b/service/clouddirectory/api_op_ListObjectParentPaths.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -129,6 +130,89 @@ func addOperationListObjectParentPathsMiddlewares(stack *middleware.Stack, optio return nil } +// ListObjectParentPathsAPIClient is a client that implements the +// ListObjectParentPaths operation. +type ListObjectParentPathsAPIClient interface { + ListObjectParentPaths(context.Context, *ListObjectParentPathsInput, ...func(*Options)) (*ListObjectParentPathsOutput, error) +} + +var _ ListObjectParentPathsAPIClient = (*Client)(nil) + +// ListObjectParentPathsPaginatorOptions is the paginator options for +// ListObjectParentPaths +type ListObjectParentPathsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListObjectParentPathsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectParentPaths +type ListObjectParentPathsPaginator struct { + options ListObjectParentPathsPaginatorOptions + client ListObjectParentPathsAPIClient + params *ListObjectParentPathsInput + nextToken *string + firstPage bool +} + +// NewListObjectParentPathsPaginator returns a new ListObjectParentPathsPaginator +func NewListObjectParentPathsPaginator(client ListObjectParentPathsAPIClient, params *ListObjectParentPathsInput, optFns ...func(*ListObjectParentPathsPaginatorOptions)) *ListObjectParentPathsPaginator { + options := ListObjectParentPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectParentPathsInput{} + } + + return &ListObjectParentPathsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectParentPathsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectParentPaths page. +func (p *ListObjectParentPathsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectParentPathsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListObjectParentPaths(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectParentPaths(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectParents.go b/service/clouddirectory/api_op_ListObjectParents.go index c55afbbd200..1d24cc8ef88 100644 --- a/service/clouddirectory/api_op_ListObjectParents.go +++ b/service/clouddirectory/api_op_ListObjectParents.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -134,6 +135,88 @@ func addOperationListObjectParentsMiddlewares(stack *middleware.Stack, options O return nil } +// ListObjectParentsAPIClient is a client that implements the ListObjectParents +// operation. +type ListObjectParentsAPIClient interface { + ListObjectParents(context.Context, *ListObjectParentsInput, ...func(*Options)) (*ListObjectParentsOutput, error) +} + +var _ ListObjectParentsAPIClient = (*Client)(nil) + +// ListObjectParentsPaginatorOptions is the paginator options for ListObjectParents +type ListObjectParentsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListObjectParentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectParents +type ListObjectParentsPaginator struct { + options ListObjectParentsPaginatorOptions + client ListObjectParentsAPIClient + params *ListObjectParentsInput + nextToken *string + firstPage bool +} + +// NewListObjectParentsPaginator returns a new ListObjectParentsPaginator +func NewListObjectParentsPaginator(client ListObjectParentsAPIClient, params *ListObjectParentsInput, optFns ...func(*ListObjectParentsPaginatorOptions)) *ListObjectParentsPaginator { + options := ListObjectParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectParentsInput{} + } + + return &ListObjectParentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectParentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectParents page. +func (p *ListObjectParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectParentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListObjectParents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectParents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListObjectPolicies.go b/service/clouddirectory/api_op_ListObjectPolicies.go index 79c774a8832..22021c24bb8 100644 --- a/service/clouddirectory/api_op_ListObjectPolicies.go +++ b/service/clouddirectory/api_op_ListObjectPolicies.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -124,6 +125,89 @@ func addOperationListObjectPoliciesMiddlewares(stack *middleware.Stack, options return nil } +// ListObjectPoliciesAPIClient is a client that implements the ListObjectPolicies +// operation. +type ListObjectPoliciesAPIClient interface { + ListObjectPolicies(context.Context, *ListObjectPoliciesInput, ...func(*Options)) (*ListObjectPoliciesOutput, error) +} + +var _ ListObjectPoliciesAPIClient = (*Client)(nil) + +// ListObjectPoliciesPaginatorOptions is the paginator options for +// ListObjectPolicies +type ListObjectPoliciesPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListObjectPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListObjectPolicies +type ListObjectPoliciesPaginator struct { + options ListObjectPoliciesPaginatorOptions + client ListObjectPoliciesAPIClient + params *ListObjectPoliciesInput + nextToken *string + firstPage bool +} + +// NewListObjectPoliciesPaginator returns a new ListObjectPoliciesPaginator +func NewListObjectPoliciesPaginator(client ListObjectPoliciesAPIClient, params *ListObjectPoliciesInput, optFns ...func(*ListObjectPoliciesPaginatorOptions)) *ListObjectPoliciesPaginator { + options := ListObjectPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectPoliciesInput{} + } + + return &ListObjectPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectPolicies page. +func (p *ListObjectPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListObjectPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListPolicyAttachments.go b/service/clouddirectory/api_op_ListPolicyAttachments.go index 9baf6ad36e6..4e8c6f7f809 100644 --- a/service/clouddirectory/api_op_ListPolicyAttachments.go +++ b/service/clouddirectory/api_op_ListPolicyAttachments.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -124,6 +125,89 @@ func addOperationListPolicyAttachmentsMiddlewares(stack *middleware.Stack, optio return nil } +// ListPolicyAttachmentsAPIClient is a client that implements the +// ListPolicyAttachments operation. +type ListPolicyAttachmentsAPIClient interface { + ListPolicyAttachments(context.Context, *ListPolicyAttachmentsInput, ...func(*Options)) (*ListPolicyAttachmentsOutput, error) +} + +var _ ListPolicyAttachmentsAPIClient = (*Client)(nil) + +// ListPolicyAttachmentsPaginatorOptions is the paginator options for +// ListPolicyAttachments +type ListPolicyAttachmentsPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// ListPolicyAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListPolicyAttachments +type ListPolicyAttachmentsPaginator struct { + options ListPolicyAttachmentsPaginatorOptions + client ListPolicyAttachmentsAPIClient + params *ListPolicyAttachmentsInput + nextToken *string + firstPage bool +} + +// NewListPolicyAttachmentsPaginator returns a new ListPolicyAttachmentsPaginator +func NewListPolicyAttachmentsPaginator(client ListPolicyAttachmentsAPIClient, params *ListPolicyAttachmentsInput, optFns ...func(*ListPolicyAttachmentsPaginatorOptions)) *ListPolicyAttachmentsPaginator { + options := ListPolicyAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyAttachmentsInput{} + } + + return &ListPolicyAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyAttachmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicyAttachments page. +func (p *ListPolicyAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPolicyAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListPublishedSchemaArns.go b/service/clouddirectory/api_op_ListPublishedSchemaArns.go index ff4c9a6b9d6..723f920583a 100644 --- a/service/clouddirectory/api_op_ListPublishedSchemaArns.go +++ b/service/clouddirectory/api_op_ListPublishedSchemaArns.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -110,6 +111,89 @@ func addOperationListPublishedSchemaArnsMiddlewares(stack *middleware.Stack, opt return nil } +// ListPublishedSchemaArnsAPIClient is a client that implements the +// ListPublishedSchemaArns operation. +type ListPublishedSchemaArnsAPIClient interface { + ListPublishedSchemaArns(context.Context, *ListPublishedSchemaArnsInput, ...func(*Options)) (*ListPublishedSchemaArnsOutput, error) +} + +var _ ListPublishedSchemaArnsAPIClient = (*Client)(nil) + +// ListPublishedSchemaArnsPaginatorOptions is the paginator options for +// ListPublishedSchemaArns +type ListPublishedSchemaArnsPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListPublishedSchemaArnsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListPublishedSchemaArns +type ListPublishedSchemaArnsPaginator struct { + options ListPublishedSchemaArnsPaginatorOptions + client ListPublishedSchemaArnsAPIClient + params *ListPublishedSchemaArnsInput + nextToken *string + firstPage bool +} + +// NewListPublishedSchemaArnsPaginator returns a new +// ListPublishedSchemaArnsPaginator +func NewListPublishedSchemaArnsPaginator(client ListPublishedSchemaArnsAPIClient, params *ListPublishedSchemaArnsInput, optFns ...func(*ListPublishedSchemaArnsPaginatorOptions)) *ListPublishedSchemaArnsPaginator { + options := ListPublishedSchemaArnsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublishedSchemaArnsInput{} + } + + return &ListPublishedSchemaArnsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublishedSchemaArnsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPublishedSchemaArns page. +func (p *ListPublishedSchemaArnsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublishedSchemaArnsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPublishedSchemaArns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublishedSchemaArns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTagsForResource.go b/service/clouddirectory/api_op_ListTagsForResource.go index 069e08de1d9..fb4dd28afda 100644 --- a/service/clouddirectory/api_op_ListTagsForResource.go +++ b/service/clouddirectory/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -119,6 +120,89 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The MaxResults parameter sets the maximum number of results returned in a single + // page. This is for future use and is not supported currently. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go b/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go index 63a680d7c27..2204251b702 100644 --- a/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go +++ b/service/clouddirectory/api_op_ListTypedLinkFacetAttributes.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -121,6 +122,89 @@ func addOperationListTypedLinkFacetAttributesMiddlewares(stack *middleware.Stack return nil } +// ListTypedLinkFacetAttributesAPIClient is a client that implements the +// ListTypedLinkFacetAttributes operation. +type ListTypedLinkFacetAttributesAPIClient interface { + ListTypedLinkFacetAttributes(context.Context, *ListTypedLinkFacetAttributesInput, ...func(*Options)) (*ListTypedLinkFacetAttributesOutput, error) +} + +var _ ListTypedLinkFacetAttributesAPIClient = (*Client)(nil) + +// ListTypedLinkFacetAttributesPaginatorOptions is the paginator options for +// ListTypedLinkFacetAttributes +type ListTypedLinkFacetAttributesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListTypedLinkFacetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTypedLinkFacetAttributes +type ListTypedLinkFacetAttributesPaginator struct { + options ListTypedLinkFacetAttributesPaginatorOptions + client ListTypedLinkFacetAttributesAPIClient + params *ListTypedLinkFacetAttributesInput + nextToken *string + firstPage bool +} + +// NewListTypedLinkFacetAttributesPaginator returns a new +// ListTypedLinkFacetAttributesPaginator +func NewListTypedLinkFacetAttributesPaginator(client ListTypedLinkFacetAttributesAPIClient, params *ListTypedLinkFacetAttributesInput, optFns ...func(*ListTypedLinkFacetAttributesPaginatorOptions)) *ListTypedLinkFacetAttributesPaginator { + options := ListTypedLinkFacetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypedLinkFacetAttributesInput{} + } + + return &ListTypedLinkFacetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypedLinkFacetAttributesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTypedLinkFacetAttributes page. +func (p *ListTypedLinkFacetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypedLinkFacetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTypedLinkFacetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypedLinkFacetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_ListTypedLinkFacetNames.go b/service/clouddirectory/api_op_ListTypedLinkFacetNames.go index a1fe716e3d0..dbdff363872 100644 --- a/service/clouddirectory/api_op_ListTypedLinkFacetNames.go +++ b/service/clouddirectory/api_op_ListTypedLinkFacetNames.go @@ -4,6 +4,7 @@ package clouddirectory 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/awslabs/smithy-go/middleware" @@ -115,6 +116,89 @@ func addOperationListTypedLinkFacetNamesMiddlewares(stack *middleware.Stack, opt return nil } +// ListTypedLinkFacetNamesAPIClient is a client that implements the +// ListTypedLinkFacetNames operation. +type ListTypedLinkFacetNamesAPIClient interface { + ListTypedLinkFacetNames(context.Context, *ListTypedLinkFacetNamesInput, ...func(*Options)) (*ListTypedLinkFacetNamesOutput, error) +} + +var _ ListTypedLinkFacetNamesAPIClient = (*Client)(nil) + +// ListTypedLinkFacetNamesPaginatorOptions is the paginator options for +// ListTypedLinkFacetNames +type ListTypedLinkFacetNamesPaginatorOptions struct { + // The maximum number of results to retrieve. + 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 +} + +// ListTypedLinkFacetNamesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.ListTypedLinkFacetNames +type ListTypedLinkFacetNamesPaginator struct { + options ListTypedLinkFacetNamesPaginatorOptions + client ListTypedLinkFacetNamesAPIClient + params *ListTypedLinkFacetNamesInput + nextToken *string + firstPage bool +} + +// NewListTypedLinkFacetNamesPaginator returns a new +// ListTypedLinkFacetNamesPaginator +func NewListTypedLinkFacetNamesPaginator(client ListTypedLinkFacetNamesAPIClient, params *ListTypedLinkFacetNamesInput, optFns ...func(*ListTypedLinkFacetNamesPaginatorOptions)) *ListTypedLinkFacetNamesPaginator { + options := ListTypedLinkFacetNamesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypedLinkFacetNamesInput{} + } + + return &ListTypedLinkFacetNamesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypedLinkFacetNamesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTypedLinkFacetNames page. +func (p *ListTypedLinkFacetNamesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypedLinkFacetNamesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTypedLinkFacetNames(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypedLinkFacetNames(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/api_op_LookupPolicy.go b/service/clouddirectory/api_op_LookupPolicy.go index 78d33518153..01ee3209903 100644 --- a/service/clouddirectory/api_op_LookupPolicy.go +++ b/service/clouddirectory/api_op_LookupPolicy.go @@ -4,6 +4,7 @@ package clouddirectory 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/clouddirectory/types" @@ -128,6 +129,87 @@ func addOperationLookupPolicyMiddlewares(stack *middleware.Stack, options Option return nil } +// LookupPolicyAPIClient is a client that implements the LookupPolicy operation. +type LookupPolicyAPIClient interface { + LookupPolicy(context.Context, *LookupPolicyInput, ...func(*Options)) (*LookupPolicyOutput, error) +} + +var _ LookupPolicyAPIClient = (*Client)(nil) + +// LookupPolicyPaginatorOptions is the paginator options for LookupPolicy +type LookupPolicyPaginatorOptions struct { + // The maximum number of items to be retrieved in a single call. This is an + // approximate number. + 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 +} + +// LookupPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/clouddirectory.LookupPolicy +type LookupPolicyPaginator struct { + options LookupPolicyPaginatorOptions + client LookupPolicyAPIClient + params *LookupPolicyInput + nextToken *string + firstPage bool +} + +// NewLookupPolicyPaginator returns a new LookupPolicyPaginator +func NewLookupPolicyPaginator(client LookupPolicyAPIClient, params *LookupPolicyInput, optFns ...func(*LookupPolicyPaginatorOptions)) *LookupPolicyPaginator { + options := LookupPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &LookupPolicyInput{} + } + + return &LookupPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *LookupPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next LookupPolicy page. +func (p *LookupPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*LookupPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.LookupPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opLookupPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/clouddirectory/endpoints.go b/service/clouddirectory/endpoints.go index 7ca3005d186..bb9c46d23d5 100644 --- a/service/clouddirectory/endpoints.go +++ b/service/clouddirectory/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudformation/api_op_DescribeAccountLimits.go b/service/cloudformation/api_op_DescribeAccountLimits.go index 2c33c0e5058..288e0a9418f 100644 --- a/service/cloudformation/api_op_DescribeAccountLimits.go +++ b/service/cloudformation/api_op_DescribeAccountLimits.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -110,6 +111,81 @@ func addOperationDescribeAccountLimitsMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeAccountLimitsAPIClient is a client that implements the +// DescribeAccountLimits operation. +type DescribeAccountLimitsAPIClient interface { + DescribeAccountLimits(context.Context, *DescribeAccountLimitsInput, ...func(*Options)) (*DescribeAccountLimitsOutput, error) +} + +var _ DescribeAccountLimitsAPIClient = (*Client)(nil) + +// DescribeAccountLimitsPaginatorOptions is the paginator options for +// DescribeAccountLimits +type DescribeAccountLimitsPaginatorOptions struct { + // 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 +} + +// DescribeAccountLimitsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeAccountLimits +type DescribeAccountLimitsPaginator struct { + options DescribeAccountLimitsPaginatorOptions + client DescribeAccountLimitsAPIClient + params *DescribeAccountLimitsInput + nextToken *string + firstPage bool +} + +// NewDescribeAccountLimitsPaginator returns a new DescribeAccountLimitsPaginator +func NewDescribeAccountLimitsPaginator(client DescribeAccountLimitsAPIClient, params *DescribeAccountLimitsInput, optFns ...func(*DescribeAccountLimitsPaginatorOptions)) *DescribeAccountLimitsPaginator { + options := DescribeAccountLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAccountLimitsInput{} + } + + return &DescribeAccountLimitsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAccountLimitsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAccountLimits page. +func (p *DescribeAccountLimitsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAccountLimitsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeAccountLimits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccountLimits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStackEvents.go b/service/cloudformation/api_op_DescribeStackEvents.go index 32824a3e65a..370917857a1 100644 --- a/service/cloudformation/api_op_DescribeStackEvents.go +++ b/service/cloudformation/api_op_DescribeStackEvents.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -122,6 +123,81 @@ func addOperationDescribeStackEventsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeStackEventsAPIClient is a client that implements the DescribeStackEvents +// operation. +type DescribeStackEventsAPIClient interface { + DescribeStackEvents(context.Context, *DescribeStackEventsInput, ...func(*Options)) (*DescribeStackEventsOutput, error) +} + +var _ DescribeStackEventsAPIClient = (*Client)(nil) + +// DescribeStackEventsPaginatorOptions is the paginator options for +// DescribeStackEvents +type DescribeStackEventsPaginatorOptions struct { + // 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 +} + +// DescribeStackEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStackEvents +type DescribeStackEventsPaginator struct { + options DescribeStackEventsPaginatorOptions + client DescribeStackEventsAPIClient + params *DescribeStackEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeStackEventsPaginator returns a new DescribeStackEventsPaginator +func NewDescribeStackEventsPaginator(client DescribeStackEventsAPIClient, params *DescribeStackEventsInput, optFns ...func(*DescribeStackEventsPaginatorOptions)) *DescribeStackEventsPaginator { + options := DescribeStackEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStackEventsInput{} + } + + return &DescribeStackEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStackEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStackEvents page. +func (p *DescribeStackEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStackEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeStackEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStackEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStackResourceDrifts.go b/service/cloudformation/api_op_DescribeStackResourceDrifts.go index a95a9b1c229..bbbd6ccaa40 100644 --- a/service/cloudformation/api_op_DescribeStackResourceDrifts.go +++ b/service/cloudformation/api_op_DescribeStackResourceDrifts.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -155,6 +156,92 @@ func addOperationDescribeStackResourceDriftsMiddlewares(stack *middleware.Stack, return nil } +// DescribeStackResourceDriftsAPIClient is a client that implements the +// DescribeStackResourceDrifts operation. +type DescribeStackResourceDriftsAPIClient interface { + DescribeStackResourceDrifts(context.Context, *DescribeStackResourceDriftsInput, ...func(*Options)) (*DescribeStackResourceDriftsOutput, error) +} + +var _ DescribeStackResourceDriftsAPIClient = (*Client)(nil) + +// DescribeStackResourceDriftsPaginatorOptions is the paginator options for +// DescribeStackResourceDrifts +type DescribeStackResourceDriftsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// DescribeStackResourceDriftsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStackResourceDrifts +type DescribeStackResourceDriftsPaginator struct { + options DescribeStackResourceDriftsPaginatorOptions + client DescribeStackResourceDriftsAPIClient + params *DescribeStackResourceDriftsInput + nextToken *string + firstPage bool +} + +// NewDescribeStackResourceDriftsPaginator returns a new +// DescribeStackResourceDriftsPaginator +func NewDescribeStackResourceDriftsPaginator(client DescribeStackResourceDriftsAPIClient, params *DescribeStackResourceDriftsInput, optFns ...func(*DescribeStackResourceDriftsPaginatorOptions)) *DescribeStackResourceDriftsPaginator { + options := DescribeStackResourceDriftsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStackResourceDriftsInput{} + } + + return &DescribeStackResourceDriftsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStackResourceDriftsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStackResourceDrifts page. +func (p *DescribeStackResourceDriftsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStackResourceDriftsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeStackResourceDrifts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStackResourceDrifts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_DescribeStacks.go b/service/cloudformation/api_op_DescribeStacks.go index 19c14440578..1bbc3acb248 100644 --- a/service/cloudformation/api_op_DescribeStacks.go +++ b/service/cloudformation/api_op_DescribeStacks.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -119,6 +120,80 @@ func addOperationDescribeStacksMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeStacksAPIClient is a client that implements the DescribeStacks +// operation. +type DescribeStacksAPIClient interface { + DescribeStacks(context.Context, *DescribeStacksInput, ...func(*Options)) (*DescribeStacksOutput, error) +} + +var _ DescribeStacksAPIClient = (*Client)(nil) + +// DescribeStacksPaginatorOptions is the paginator options for DescribeStacks +type DescribeStacksPaginatorOptions struct { + // 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 +} + +// DescribeStacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.DescribeStacks +type DescribeStacksPaginator struct { + options DescribeStacksPaginatorOptions + client DescribeStacksAPIClient + params *DescribeStacksInput + nextToken *string + firstPage bool +} + +// NewDescribeStacksPaginator returns a new DescribeStacksPaginator +func NewDescribeStacksPaginator(client DescribeStacksAPIClient, params *DescribeStacksInput, optFns ...func(*DescribeStacksPaginatorOptions)) *DescribeStacksPaginator { + options := DescribeStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStacksInput{} + } + + return &DescribeStacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStacksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStacks page. +func (p *DescribeStacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeStacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListChangeSets.go b/service/cloudformation/api_op_ListChangeSets.go index e557f5630d7..62e17009c76 100644 --- a/service/cloudformation/api_op_ListChangeSets.go +++ b/service/cloudformation/api_op_ListChangeSets.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -118,6 +119,80 @@ func addOperationListChangeSetsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListChangeSetsAPIClient is a client that implements the ListChangeSets +// operation. +type ListChangeSetsAPIClient interface { + ListChangeSets(context.Context, *ListChangeSetsInput, ...func(*Options)) (*ListChangeSetsOutput, error) +} + +var _ ListChangeSetsAPIClient = (*Client)(nil) + +// ListChangeSetsPaginatorOptions is the paginator options for ListChangeSets +type ListChangeSetsPaginatorOptions struct { + // 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 +} + +// ListChangeSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListChangeSets +type ListChangeSetsPaginator struct { + options ListChangeSetsPaginatorOptions + client ListChangeSetsAPIClient + params *ListChangeSetsInput + nextToken *string + firstPage bool +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangeSetsInput{} + } + + return &ListChangeSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangeSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChangeSets page. +func (p *ListChangeSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangeSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListChangeSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangeSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListExports.go b/service/cloudformation/api_op_ListExports.go index 31f488530c9..107d88c0fad 100644 --- a/service/cloudformation/api_op_ListExports.go +++ b/service/cloudformation/api_op_ListExports.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -110,6 +111,79 @@ func addOperationListExportsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListExportsAPIClient is a client that implements the ListExports operation. +type ListExportsAPIClient interface { + ListExports(context.Context, *ListExportsInput, ...func(*Options)) (*ListExportsOutput, error) +} + +var _ ListExportsAPIClient = (*Client)(nil) + +// ListExportsPaginatorOptions is the paginator options for ListExports +type ListExportsPaginatorOptions struct { + // 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 +} + +// ListExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListExports +type ListExportsPaginator struct { + options ListExportsPaginatorOptions + client ListExportsAPIClient + params *ListExportsInput + nextToken *string + firstPage bool +} + +// NewListExportsPaginator returns a new ListExportsPaginator +func NewListExportsPaginator(client ListExportsAPIClient, params *ListExportsInput, optFns ...func(*ListExportsPaginatorOptions)) *ListExportsPaginator { + options := ListExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExportsInput{} + } + + return &ListExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListExports page. +func (p *ListExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListExports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListImports.go b/service/cloudformation/api_op_ListImports.go index 5bf0f953533..63b8115e588 100644 --- a/service/cloudformation/api_op_ListImports.go +++ b/service/cloudformation/api_op_ListImports.go @@ -4,6 +4,7 @@ package cloudformation 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/awslabs/smithy-go/middleware" @@ -118,6 +119,79 @@ func addOperationListImportsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListImportsAPIClient is a client that implements the ListImports operation. +type ListImportsAPIClient interface { + ListImports(context.Context, *ListImportsInput, ...func(*Options)) (*ListImportsOutput, error) +} + +var _ ListImportsAPIClient = (*Client)(nil) + +// ListImportsPaginatorOptions is the paginator options for ListImports +type ListImportsPaginatorOptions struct { + // 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 +} + +// ListImportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListImports +type ListImportsPaginator struct { + options ListImportsPaginatorOptions + client ListImportsAPIClient + params *ListImportsInput + nextToken *string + firstPage bool +} + +// NewListImportsPaginator returns a new ListImportsPaginator +func NewListImportsPaginator(client ListImportsAPIClient, params *ListImportsInput, optFns ...func(*ListImportsPaginatorOptions)) *ListImportsPaginator { + options := ListImportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImportsInput{} + } + + return &ListImportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImports page. +func (p *ListImportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListImports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackInstances.go b/service/cloudformation/api_op_ListStackInstances.go index d997cfe7c82..8ff35416774 100644 --- a/service/cloudformation/api_op_ListStackInstances.go +++ b/service/cloudformation/api_op_ListStackInstances.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -136,6 +137,91 @@ func addOperationListStackInstancesMiddlewares(stack *middleware.Stack, options return nil } +// ListStackInstancesAPIClient is a client that implements the ListStackInstances +// operation. +type ListStackInstancesAPIClient interface { + ListStackInstances(context.Context, *ListStackInstancesInput, ...func(*Options)) (*ListStackInstancesOutput, error) +} + +var _ ListStackInstancesAPIClient = (*Client)(nil) + +// ListStackInstancesPaginatorOptions is the paginator options for +// ListStackInstances +type ListStackInstancesPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListStackInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackInstances +type ListStackInstancesPaginator struct { + options ListStackInstancesPaginatorOptions + client ListStackInstancesAPIClient + params *ListStackInstancesInput + nextToken *string + firstPage bool +} + +// NewListStackInstancesPaginator returns a new ListStackInstancesPaginator +func NewListStackInstancesPaginator(client ListStackInstancesAPIClient, params *ListStackInstancesInput, optFns ...func(*ListStackInstancesPaginatorOptions)) *ListStackInstancesPaginator { + options := ListStackInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackInstancesInput{} + } + + return &ListStackInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStackInstances page. +func (p *ListStackInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStackInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackResources.go b/service/cloudformation/api_op_ListStackResources.go index 6262e173d09..21dc5b6e1f0 100644 --- a/service/cloudformation/api_op_ListStackResources.go +++ b/service/cloudformation/api_op_ListStackResources.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -125,6 +126,81 @@ func addOperationListStackResourcesMiddlewares(stack *middleware.Stack, options return nil } +// ListStackResourcesAPIClient is a client that implements the ListStackResources +// operation. +type ListStackResourcesAPIClient interface { + ListStackResources(context.Context, *ListStackResourcesInput, ...func(*Options)) (*ListStackResourcesOutput, error) +} + +var _ ListStackResourcesAPIClient = (*Client)(nil) + +// ListStackResourcesPaginatorOptions is the paginator options for +// ListStackResources +type ListStackResourcesPaginatorOptions struct { + // 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 +} + +// ListStackResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackResources +type ListStackResourcesPaginator struct { + options ListStackResourcesPaginatorOptions + client ListStackResourcesAPIClient + params *ListStackResourcesInput + nextToken *string + firstPage bool +} + +// NewListStackResourcesPaginator returns a new ListStackResourcesPaginator +func NewListStackResourcesPaginator(client ListStackResourcesAPIClient, params *ListStackResourcesInput, optFns ...func(*ListStackResourcesPaginatorOptions)) *ListStackResourcesPaginator { + options := ListStackResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackResourcesInput{} + } + + return &ListStackResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStackResources page. +func (p *ListStackResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListStackResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSetOperationResults.go b/service/cloudformation/api_op_ListStackSetOperationResults.go index c2429962755..ae0dab84d1a 100644 --- a/service/cloudformation/api_op_ListStackSetOperationResults.go +++ b/service/cloudformation/api_op_ListStackSetOperationResults.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -131,6 +132,92 @@ func addOperationListStackSetOperationResultsMiddlewares(stack *middleware.Stack return nil } +// ListStackSetOperationResultsAPIClient is a client that implements the +// ListStackSetOperationResults operation. +type ListStackSetOperationResultsAPIClient interface { + ListStackSetOperationResults(context.Context, *ListStackSetOperationResultsInput, ...func(*Options)) (*ListStackSetOperationResultsOutput, error) +} + +var _ ListStackSetOperationResultsAPIClient = (*Client)(nil) + +// ListStackSetOperationResultsPaginatorOptions is the paginator options for +// ListStackSetOperationResults +type ListStackSetOperationResultsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListStackSetOperationResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSetOperationResults +type ListStackSetOperationResultsPaginator struct { + options ListStackSetOperationResultsPaginatorOptions + client ListStackSetOperationResultsAPIClient + params *ListStackSetOperationResultsInput + nextToken *string + firstPage bool +} + +// NewListStackSetOperationResultsPaginator returns a new +// ListStackSetOperationResultsPaginator +func NewListStackSetOperationResultsPaginator(client ListStackSetOperationResultsAPIClient, params *ListStackSetOperationResultsInput, optFns ...func(*ListStackSetOperationResultsPaginatorOptions)) *ListStackSetOperationResultsPaginator { + options := ListStackSetOperationResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetOperationResultsInput{} + } + + return &ListStackSetOperationResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetOperationResultsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStackSetOperationResults page. +func (p *ListStackSetOperationResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetOperationResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStackSetOperationResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSetOperationResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSetOperations.go b/service/cloudformation/api_op_ListStackSetOperations.go index 594718599c5..96dfe8231dd 100644 --- a/service/cloudformation/api_op_ListStackSetOperations.go +++ b/service/cloudformation/api_op_ListStackSetOperations.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -125,6 +126,91 @@ func addOperationListStackSetOperationsMiddlewares(stack *middleware.Stack, opti return nil } +// ListStackSetOperationsAPIClient is a client that implements the +// ListStackSetOperations operation. +type ListStackSetOperationsAPIClient interface { + ListStackSetOperations(context.Context, *ListStackSetOperationsInput, ...func(*Options)) (*ListStackSetOperationsOutput, error) +} + +var _ ListStackSetOperationsAPIClient = (*Client)(nil) + +// ListStackSetOperationsPaginatorOptions is the paginator options for +// ListStackSetOperations +type ListStackSetOperationsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListStackSetOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSetOperations +type ListStackSetOperationsPaginator struct { + options ListStackSetOperationsPaginatorOptions + client ListStackSetOperationsAPIClient + params *ListStackSetOperationsInput + nextToken *string + firstPage bool +} + +// NewListStackSetOperationsPaginator returns a new ListStackSetOperationsPaginator +func NewListStackSetOperationsPaginator(client ListStackSetOperationsAPIClient, params *ListStackSetOperationsInput, optFns ...func(*ListStackSetOperationsPaginatorOptions)) *ListStackSetOperationsPaginator { + options := ListStackSetOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetOperationsInput{} + } + + return &ListStackSetOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetOperationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStackSetOperations page. +func (p *ListStackSetOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStackSetOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSetOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStackSets.go b/service/cloudformation/api_op_ListStackSets.go index 0517f219d20..ffa52d660ba 100644 --- a/service/cloudformation/api_op_ListStackSets.go +++ b/service/cloudformation/api_op_ListStackSets.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -119,6 +120,89 @@ func addOperationListStackSetsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListStackSetsAPIClient is a client that implements the ListStackSets operation. +type ListStackSetsAPIClient interface { + ListStackSets(context.Context, *ListStackSetsInput, ...func(*Options)) (*ListStackSetsOutput, error) +} + +var _ ListStackSetsAPIClient = (*Client)(nil) + +// ListStackSetsPaginatorOptions is the paginator options for ListStackSets +type ListStackSetsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListStackSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStackSets +type ListStackSetsPaginator struct { + options ListStackSetsPaginatorOptions + client ListStackSetsAPIClient + params *ListStackSetsInput + nextToken *string + firstPage bool +} + +// NewListStackSetsPaginator returns a new ListStackSetsPaginator +func NewListStackSetsPaginator(client ListStackSetsAPIClient, params *ListStackSetsInput, optFns ...func(*ListStackSetsPaginatorOptions)) *ListStackSetsPaginator { + options := ListStackSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStackSetsInput{} + } + + return &ListStackSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStackSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStackSets page. +func (p *ListStackSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStackSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStackSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStackSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListStacks.go b/service/cloudformation/api_op_ListStacks.go index a28a50bfd1b..d424e52040e 100644 --- a/service/cloudformation/api_op_ListStacks.go +++ b/service/cloudformation/api_op_ListStacks.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -115,6 +116,79 @@ func addOperationListStacksMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListStacksAPIClient is a client that implements the ListStacks operation. +type ListStacksAPIClient interface { + ListStacks(context.Context, *ListStacksInput, ...func(*Options)) (*ListStacksOutput, error) +} + +var _ ListStacksAPIClient = (*Client)(nil) + +// ListStacksPaginatorOptions is the paginator options for ListStacks +type ListStacksPaginatorOptions struct { + // 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 +} + +// ListStacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListStacks +type ListStacksPaginator struct { + options ListStacksPaginatorOptions + client ListStacksAPIClient + params *ListStacksInput + nextToken *string + firstPage bool +} + +// NewListStacksPaginator returns a new ListStacksPaginator +func NewListStacksPaginator(client ListStacksAPIClient, params *ListStacksInput, optFns ...func(*ListStacksPaginatorOptions)) *ListStacksPaginator { + options := ListStacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStacksInput{} + } + + return &ListStacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStacksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStacks page. +func (p *ListStacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListStacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypeRegistrations.go b/service/cloudformation/api_op_ListTypeRegistrations.go index 407a4dd67a7..61b5a04902d 100644 --- a/service/cloudformation/api_op_ListTypeRegistrations.go +++ b/service/cloudformation/api_op_ListTypeRegistrations.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -131,6 +132,91 @@ func addOperationListTypeRegistrationsMiddlewares(stack *middleware.Stack, optio return nil } +// ListTypeRegistrationsAPIClient is a client that implements the +// ListTypeRegistrations operation. +type ListTypeRegistrationsAPIClient interface { + ListTypeRegistrations(context.Context, *ListTypeRegistrationsInput, ...func(*Options)) (*ListTypeRegistrationsOutput, error) +} + +var _ ListTypeRegistrationsAPIClient = (*Client)(nil) + +// ListTypeRegistrationsPaginatorOptions is the paginator options for +// ListTypeRegistrations +type ListTypeRegistrationsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListTypeRegistrationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypeRegistrations +type ListTypeRegistrationsPaginator struct { + options ListTypeRegistrationsPaginatorOptions + client ListTypeRegistrationsAPIClient + params *ListTypeRegistrationsInput + nextToken *string + firstPage bool +} + +// NewListTypeRegistrationsPaginator returns a new ListTypeRegistrationsPaginator +func NewListTypeRegistrationsPaginator(client ListTypeRegistrationsAPIClient, params *ListTypeRegistrationsInput, optFns ...func(*ListTypeRegistrationsPaginatorOptions)) *ListTypeRegistrationsPaginator { + options := ListTypeRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypeRegistrationsInput{} + } + + return &ListTypeRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypeRegistrationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTypeRegistrations page. +func (p *ListTypeRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypeRegistrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTypeRegistrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypeRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypeVersions.go b/service/cloudformation/api_op_ListTypeVersions.go index fa0b4aecba4..11a3ea217b6 100644 --- a/service/cloudformation/api_op_ListTypeVersions.go +++ b/service/cloudformation/api_op_ListTypeVersions.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -142,6 +143,90 @@ func addOperationListTypeVersionsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListTypeVersionsAPIClient is a client that implements the ListTypeVersions +// operation. +type ListTypeVersionsAPIClient interface { + ListTypeVersions(context.Context, *ListTypeVersionsInput, ...func(*Options)) (*ListTypeVersionsOutput, error) +} + +var _ ListTypeVersionsAPIClient = (*Client)(nil) + +// ListTypeVersionsPaginatorOptions is the paginator options for ListTypeVersions +type ListTypeVersionsPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListTypeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypeVersions +type ListTypeVersionsPaginator struct { + options ListTypeVersionsPaginatorOptions + client ListTypeVersionsAPIClient + params *ListTypeVersionsInput + nextToken *string + firstPage bool +} + +// NewListTypeVersionsPaginator returns a new ListTypeVersionsPaginator +func NewListTypeVersionsPaginator(client ListTypeVersionsAPIClient, params *ListTypeVersionsInput, optFns ...func(*ListTypeVersionsPaginatorOptions)) *ListTypeVersionsPaginator { + options := ListTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypeVersionsInput{} + } + + return &ListTypeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypeVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTypeVersions page. +func (p *ListTypeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTypeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/api_op_ListTypes.go b/service/cloudformation/api_op_ListTypes.go index 158092c7dcb..0090fde56fd 100644 --- a/service/cloudformation/api_op_ListTypes.go +++ b/service/cloudformation/api_op_ListTypes.go @@ -4,6 +4,7 @@ package cloudformation 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/cloudformation/types" @@ -156,6 +157,89 @@ func addOperationListTypesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTypesAPIClient is a client that implements the ListTypes operation. +type ListTypesAPIClient interface { + ListTypes(context.Context, *ListTypesInput, ...func(*Options)) (*ListTypesOutput, error) +} + +var _ ListTypesAPIClient = (*Client)(nil) + +// ListTypesPaginatorOptions is the paginator options for ListTypes +type ListTypesPaginatorOptions struct { + // The maximum number of results to be returned with a single call. If the number + // of available results exceeds this maximum, the response includes a NextToken + // value that you can assign to the NextToken request parameter to get the next set + // of results. + 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 +} + +// ListTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudformation.ListTypes +type ListTypesPaginator struct { + options ListTypesPaginatorOptions + client ListTypesAPIClient + params *ListTypesInput + nextToken *string + firstPage bool +} + +// NewListTypesPaginator returns a new ListTypesPaginator +func NewListTypesPaginator(client ListTypesAPIClient, params *ListTypesInput, optFns ...func(*ListTypesPaginatorOptions)) *ListTypesPaginator { + options := ListTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTypesInput{} + } + + return &ListTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTypes page. +func (p *ListTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudformation/endpoints.go b/service/cloudformation/endpoints.go index ceea9c8a0b0..e0c9b76b109 100644 --- a/service/cloudformation/endpoints.go +++ b/service/cloudformation/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudfront/endpoints.go b/service/cloudfront/endpoints.go index 97a9bedfcbf..cf47e12e2aa 100644 --- a/service/cloudfront/endpoints.go +++ b/service/cloudfront/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudhsm/endpoints.go b/service/cloudhsm/endpoints.go index 69fe4275d29..87ab30d4134 100644 --- a/service/cloudhsm/endpoints.go +++ b/service/cloudhsm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudhsmv2/api_op_DescribeBackups.go b/service/cloudhsmv2/api_op_DescribeBackups.go index 7dfddd3020d..aa2682c9cb0 100644 --- a/service/cloudhsmv2/api_op_DescribeBackups.go +++ b/service/cloudhsmv2/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package cloudhsmv2 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/cloudhsmv2/types" @@ -128,6 +129,88 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // The maximum number of backups to return in the response. When there are more + // backups than the number you specify, the response contains a NextToken value. + 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 +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/api_op_DescribeClusters.go b/service/cloudhsmv2/api_op_DescribeClusters.go index 11c0373f6bf..0551f891c20 100644 --- a/service/cloudhsmv2/api_op_DescribeClusters.go +++ b/service/cloudhsmv2/api_op_DescribeClusters.go @@ -4,6 +4,7 @@ package cloudhsmv2 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/cloudhsmv2/types" @@ -122,6 +123,88 @@ func addOperationDescribeClustersMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeClustersAPIClient is a client that implements the DescribeClusters +// operation. +type DescribeClustersAPIClient interface { + DescribeClusters(context.Context, *DescribeClustersInput, ...func(*Options)) (*DescribeClustersOutput, error) +} + +var _ DescribeClustersAPIClient = (*Client)(nil) + +// DescribeClustersPaginatorOptions is the paginator options for DescribeClusters +type DescribeClustersPaginatorOptions struct { + // The maximum number of clusters to return in the response. When there are more + // clusters than the number you specify, the response contains a NextToken value. + 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 +} + +// DescribeClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.DescribeClusters +type DescribeClustersPaginator struct { + options DescribeClustersPaginatorOptions + client DescribeClustersAPIClient + params *DescribeClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClustersInput{} + } + + return &DescribeClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusters page. +func (p *DescribeClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/api_op_ListTags.go b/service/cloudhsmv2/api_op_ListTags.go index b9dc8354972..ccbdaae5fca 100644 --- a/service/cloudhsmv2/api_op_ListTags.go +++ b/service/cloudhsmv2/api_op_ListTags.go @@ -4,6 +4,7 @@ package cloudhsmv2 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/cloudhsmv2/types" @@ -124,6 +125,87 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // The maximum number of tags to return in the response. When there are more tags + // than the number you specify, the response contains a NextToken value. + 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudhsmv2.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudhsmv2/endpoints.go b/service/cloudhsmv2/endpoints.go index eed7cf0668a..40a28612343 100644 --- a/service/cloudhsmv2/endpoints.go +++ b/service/cloudhsmv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudsearch/endpoints.go b/service/cloudsearch/endpoints.go index 2a2a249343c..b68c5440e10 100644 --- a/service/cloudsearch/endpoints.go +++ b/service/cloudsearch/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudsearchdomain/endpoints.go b/service/cloudsearchdomain/endpoints.go index 7535b073e2b..84cf43e1694 100644 --- a/service/cloudsearchdomain/endpoints.go +++ b/service/cloudsearchdomain/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudtrail/api_op_ListPublicKeys.go b/service/cloudtrail/api_op_ListPublicKeys.go index 3ed09dd863f..fd0e7e17bd1 100644 --- a/service/cloudtrail/api_op_ListPublicKeys.go +++ b/service/cloudtrail/api_op_ListPublicKeys.go @@ -4,6 +4,7 @@ package cloudtrail 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/cloudtrail/types" @@ -122,6 +123,80 @@ func addOperationListPublicKeysMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListPublicKeysAPIClient is a client that implements the ListPublicKeys +// operation. +type ListPublicKeysAPIClient interface { + ListPublicKeys(context.Context, *ListPublicKeysInput, ...func(*Options)) (*ListPublicKeysOutput, error) +} + +var _ ListPublicKeysAPIClient = (*Client)(nil) + +// ListPublicKeysPaginatorOptions is the paginator options for ListPublicKeys +type ListPublicKeysPaginatorOptions struct { + // 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 +} + +// ListPublicKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListPublicKeys +type ListPublicKeysPaginator struct { + options ListPublicKeysPaginatorOptions + client ListPublicKeysAPIClient + params *ListPublicKeysInput + nextToken *string + firstPage bool +} + +// NewListPublicKeysPaginator returns a new ListPublicKeysPaginator +func NewListPublicKeysPaginator(client ListPublicKeysAPIClient, params *ListPublicKeysInput, optFns ...func(*ListPublicKeysPaginatorOptions)) *ListPublicKeysPaginator { + options := ListPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublicKeysInput{} + } + + return &ListPublicKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublicKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPublicKeys page. +func (p *ListPublicKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublicKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPublicKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublicKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_ListTags.go b/service/cloudtrail/api_op_ListTags.go index df1f678646c..ac44dd4c1c7 100644 --- a/service/cloudtrail/api_op_ListTags.go +++ b/service/cloudtrail/api_op_ListTags.go @@ -4,6 +4,7 @@ package cloudtrail 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/cloudtrail/types" @@ -115,6 +116,79 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_ListTrails.go b/service/cloudtrail/api_op_ListTrails.go index 78dcd6c3a54..36b632a2c22 100644 --- a/service/cloudtrail/api_op_ListTrails.go +++ b/service/cloudtrail/api_op_ListTrails.go @@ -4,6 +4,7 @@ package cloudtrail 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/cloudtrail/types" @@ -110,6 +111,79 @@ func addOperationListTrailsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTrailsAPIClient is a client that implements the ListTrails operation. +type ListTrailsAPIClient interface { + ListTrails(context.Context, *ListTrailsInput, ...func(*Options)) (*ListTrailsOutput, error) +} + +var _ ListTrailsAPIClient = (*Client)(nil) + +// ListTrailsPaginatorOptions is the paginator options for ListTrails +type ListTrailsPaginatorOptions struct { + // 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 +} + +// ListTrailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.ListTrails +type ListTrailsPaginator struct { + options ListTrailsPaginatorOptions + client ListTrailsAPIClient + params *ListTrailsInput + nextToken *string + firstPage bool +} + +// NewListTrailsPaginator returns a new ListTrailsPaginator +func NewListTrailsPaginator(client ListTrailsAPIClient, params *ListTrailsInput, optFns ...func(*ListTrailsPaginatorOptions)) *ListTrailsPaginator { + options := ListTrailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrailsInput{} + } + + return &ListTrailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrailsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTrails page. +func (p *ListTrailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTrails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/api_op_LookupEvents.go b/service/cloudtrail/api_op_LookupEvents.go index 07f4f650117..ab8739b9c48 100644 --- a/service/cloudtrail/api_op_LookupEvents.go +++ b/service/cloudtrail/api_op_LookupEvents.go @@ -4,6 +4,7 @@ package cloudtrail 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/cloudtrail/types" @@ -180,6 +181,87 @@ func addOperationLookupEventsMiddlewares(stack *middleware.Stack, options Option return nil } +// LookupEventsAPIClient is a client that implements the LookupEvents operation. +type LookupEventsAPIClient interface { + LookupEvents(context.Context, *LookupEventsInput, ...func(*Options)) (*LookupEventsOutput, error) +} + +var _ LookupEventsAPIClient = (*Client)(nil) + +// LookupEventsPaginatorOptions is the paginator options for LookupEvents +type LookupEventsPaginatorOptions struct { + // The number of events to return. Possible values are 1 through 50. The default is + // 50. + 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 +} + +// LookupEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudtrail.LookupEvents +type LookupEventsPaginator struct { + options LookupEventsPaginatorOptions + client LookupEventsAPIClient + params *LookupEventsInput + nextToken *string + firstPage bool +} + +// NewLookupEventsPaginator returns a new LookupEventsPaginator +func NewLookupEventsPaginator(client LookupEventsAPIClient, params *LookupEventsInput, optFns ...func(*LookupEventsPaginatorOptions)) *LookupEventsPaginator { + options := LookupEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &LookupEventsInput{} + } + + return &LookupEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *LookupEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next LookupEvents page. +func (p *LookupEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*LookupEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.LookupEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opLookupEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudtrail/endpoints.go b/service/cloudtrail/endpoints.go index 358208cd5fb..fa5cb514e05 100644 --- a/service/cloudtrail/endpoints.go +++ b/service/cloudtrail/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudwatch/api_op_DescribeAlarmHistory.go b/service/cloudwatch/api_op_DescribeAlarmHistory.go index b866e9cd166..2c18148f79a 100644 --- a/service/cloudwatch/api_op_DescribeAlarmHistory.go +++ b/service/cloudwatch/api_op_DescribeAlarmHistory.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -132,6 +133,88 @@ func addOperationDescribeAlarmHistoryMiddlewares(stack *middleware.Stack, option return nil } +// DescribeAlarmHistoryAPIClient is a client that implements the +// DescribeAlarmHistory operation. +type DescribeAlarmHistoryAPIClient interface { + DescribeAlarmHistory(context.Context, *DescribeAlarmHistoryInput, ...func(*Options)) (*DescribeAlarmHistoryOutput, error) +} + +var _ DescribeAlarmHistoryAPIClient = (*Client)(nil) + +// DescribeAlarmHistoryPaginatorOptions is the paginator options for +// DescribeAlarmHistory +type DescribeAlarmHistoryPaginatorOptions struct { + // The maximum number of alarm history records to retrieve. + 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 +} + +// DescribeAlarmHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeAlarmHistory +type DescribeAlarmHistoryPaginator struct { + options DescribeAlarmHistoryPaginatorOptions + client DescribeAlarmHistoryAPIClient + params *DescribeAlarmHistoryInput + nextToken *string + firstPage bool +} + +// NewDescribeAlarmHistoryPaginator returns a new DescribeAlarmHistoryPaginator +func NewDescribeAlarmHistoryPaginator(client DescribeAlarmHistoryAPIClient, params *DescribeAlarmHistoryInput, optFns ...func(*DescribeAlarmHistoryPaginatorOptions)) *DescribeAlarmHistoryPaginator { + options := DescribeAlarmHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAlarmHistoryInput{} + } + + return &DescribeAlarmHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAlarmHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAlarmHistory page. +func (p *DescribeAlarmHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAlarmHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeAlarmHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAlarmHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_DescribeAlarms.go b/service/cloudwatch/api_op_DescribeAlarms.go index 8852e857e98..812d76fa83a 100644 --- a/service/cloudwatch/api_op_DescribeAlarms.go +++ b/service/cloudwatch/api_op_DescribeAlarms.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -159,6 +160,87 @@ func addOperationDescribeAlarmsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeAlarmsAPIClient is a client that implements the DescribeAlarms +// operation. +type DescribeAlarmsAPIClient interface { + DescribeAlarms(context.Context, *DescribeAlarmsInput, ...func(*Options)) (*DescribeAlarmsOutput, error) +} + +var _ DescribeAlarmsAPIClient = (*Client)(nil) + +// DescribeAlarmsPaginatorOptions is the paginator options for DescribeAlarms +type DescribeAlarmsPaginatorOptions struct { + // The maximum number of alarm descriptions to retrieve. + 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 +} + +// DescribeAlarmsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeAlarms +type DescribeAlarmsPaginator struct { + options DescribeAlarmsPaginatorOptions + client DescribeAlarmsAPIClient + params *DescribeAlarmsInput + nextToken *string + firstPage bool +} + +// NewDescribeAlarmsPaginator returns a new DescribeAlarmsPaginator +func NewDescribeAlarmsPaginator(client DescribeAlarmsAPIClient, params *DescribeAlarmsInput, optFns ...func(*DescribeAlarmsPaginatorOptions)) *DescribeAlarmsPaginator { + options := DescribeAlarmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAlarmsInput{} + } + + return &DescribeAlarmsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAlarmsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAlarms page. +func (p *DescribeAlarmsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAlarmsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeAlarms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAlarms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_DescribeInsightRules.go b/service/cloudwatch/api_op_DescribeInsightRules.go index fe757dffbc1..db0519d3698 100644 --- a/service/cloudwatch/api_op_DescribeInsightRules.go +++ b/service/cloudwatch/api_op_DescribeInsightRules.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -110,6 +111,89 @@ func addOperationDescribeInsightRulesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeInsightRulesAPIClient is a client that implements the +// DescribeInsightRules operation. +type DescribeInsightRulesAPIClient interface { + DescribeInsightRules(context.Context, *DescribeInsightRulesInput, ...func(*Options)) (*DescribeInsightRulesOutput, error) +} + +var _ DescribeInsightRulesAPIClient = (*Client)(nil) + +// DescribeInsightRulesPaginatorOptions is the paginator options for +// DescribeInsightRules +type DescribeInsightRulesPaginatorOptions struct { + // This parameter is not currently used. Reserved for future use. If it is used in + // the future, the maximum value might be different. + 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 +} + +// DescribeInsightRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.DescribeInsightRules +type DescribeInsightRulesPaginator struct { + options DescribeInsightRulesPaginatorOptions + client DescribeInsightRulesAPIClient + params *DescribeInsightRulesInput + nextToken *string + firstPage bool +} + +// NewDescribeInsightRulesPaginator returns a new DescribeInsightRulesPaginator +func NewDescribeInsightRulesPaginator(client DescribeInsightRulesAPIClient, params *DescribeInsightRulesInput, optFns ...func(*DescribeInsightRulesPaginatorOptions)) *DescribeInsightRulesPaginator { + options := DescribeInsightRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInsightRulesInput{} + } + + return &DescribeInsightRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInsightRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInsightRules page. +func (p *DescribeInsightRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInsightRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeInsightRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInsightRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_GetMetricData.go b/service/cloudwatch/api_op_GetMetricData.go index 9f637aa7110..5c99f9195ff 100644 --- a/service/cloudwatch/api_op_GetMetricData.go +++ b/service/cloudwatch/api_op_GetMetricData.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -215,6 +216,87 @@ func addOperationGetMetricDataMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetMetricDataAPIClient is a client that implements the GetMetricData operation. +type GetMetricDataAPIClient interface { + GetMetricData(context.Context, *GetMetricDataInput, ...func(*Options)) (*GetMetricDataOutput, error) +} + +var _ GetMetricDataAPIClient = (*Client)(nil) + +// GetMetricDataPaginatorOptions is the paginator options for GetMetricData +type GetMetricDataPaginatorOptions struct { + // The maximum number of data points the request should return before paginating. + // If you omit this, the default of 100,800 is used. + 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 +} + +// GetMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.GetMetricData +type GetMetricDataPaginator struct { + options GetMetricDataPaginatorOptions + client GetMetricDataAPIClient + params *GetMetricDataInput + nextToken *string + firstPage bool +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMetricDataInput{} + } + + return &GetMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMetricDataPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetMetricData page. +func (p *GetMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxDatapoints = &p.options.Limit + } + + result, err := p.client.GetMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_ListDashboards.go b/service/cloudwatch/api_op_ListDashboards.go index 55a6de5e0af..d9b2ac80677 100644 --- a/service/cloudwatch/api_op_ListDashboards.go +++ b/service/cloudwatch/api_op_ListDashboards.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -113,6 +114,80 @@ func addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // 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 +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/api_op_ListMetrics.go b/service/cloudwatch/api_op_ListMetrics.go index 7344759230d..7d02074c01c 100644 --- a/service/cloudwatch/api_op_ListMetrics.go +++ b/service/cloudwatch/api_op_ListMetrics.go @@ -4,6 +4,7 @@ package cloudwatch 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/cloudwatch/types" @@ -139,6 +140,79 @@ func addOperationListMetricsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMetricsAPIClient is a client that implements the ListMetrics operation. +type ListMetricsAPIClient interface { + ListMetrics(context.Context, *ListMetricsInput, ...func(*Options)) (*ListMetricsOutput, error) +} + +var _ ListMetricsAPIClient = (*Client)(nil) + +// ListMetricsPaginatorOptions is the paginator options for ListMetrics +type ListMetricsPaginatorOptions struct { + // 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 +} + +// ListMetricsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatch.ListMetrics +type ListMetricsPaginator struct { + options ListMetricsPaginatorOptions + client ListMetricsAPIClient + params *ListMetricsInput + nextToken *string + firstPage bool +} + +// NewListMetricsPaginator returns a new ListMetricsPaginator +func NewListMetricsPaginator(client ListMetricsAPIClient, params *ListMetricsInput, optFns ...func(*ListMetricsPaginatorOptions)) *ListMetricsPaginator { + options := ListMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMetricsInput{} + } + + return &ListMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMetricsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMetrics page. +func (p *ListMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMetricsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListMetrics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMetrics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatch/endpoints.go b/service/cloudwatch/endpoints.go index fa1db06274d..2149d6f987d 100644 --- a/service/cloudwatch/endpoints.go +++ b/service/cloudwatch/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudwatchevents/endpoints.go b/service/cloudwatchevents/endpoints.go index 7fbdfd8e56e..aec7d6666ca 100644 --- a/service/cloudwatchevents/endpoints.go +++ b/service/cloudwatchevents/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cloudwatchlogs/api_op_DescribeDestinations.go b/service/cloudwatchlogs/api_op_DescribeDestinations.go index fcc36342bfa..6dc3a6a54aa 100644 --- a/service/cloudwatchlogs/api_op_DescribeDestinations.go +++ b/service/cloudwatchlogs/api_op_DescribeDestinations.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -110,6 +111,89 @@ func addOperationDescribeDestinationsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeDestinationsAPIClient is a client that implements the +// DescribeDestinations operation. +type DescribeDestinationsAPIClient interface { + DescribeDestinations(context.Context, *DescribeDestinationsInput, ...func(*Options)) (*DescribeDestinationsOutput, error) +} + +var _ DescribeDestinationsAPIClient = (*Client)(nil) + +// DescribeDestinationsPaginatorOptions is the paginator options for +// DescribeDestinations +type DescribeDestinationsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + 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 +} + +// DescribeDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeDestinations +type DescribeDestinationsPaginator struct { + options DescribeDestinationsPaginatorOptions + client DescribeDestinationsAPIClient + params *DescribeDestinationsInput + nextToken *string + firstPage bool +} + +// NewDescribeDestinationsPaginator returns a new DescribeDestinationsPaginator +func NewDescribeDestinationsPaginator(client DescribeDestinationsAPIClient, params *DescribeDestinationsInput, optFns ...func(*DescribeDestinationsPaginatorOptions)) *DescribeDestinationsPaginator { + options := DescribeDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDestinationsInput{} + } + + return &DescribeDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDestinationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDestinations page. +func (p *DescribeDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeLogGroups.go b/service/cloudwatchlogs/api_op_DescribeLogGroups.go index 642b644d427..e111d365fa7 100644 --- a/service/cloudwatchlogs/api_op_DescribeLogGroups.go +++ b/service/cloudwatchlogs/api_op_DescribeLogGroups.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -112,6 +113,88 @@ func addOperationDescribeLogGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeLogGroupsAPIClient is a client that implements the DescribeLogGroups +// operation. +type DescribeLogGroupsAPIClient interface { + DescribeLogGroups(context.Context, *DescribeLogGroupsInput, ...func(*Options)) (*DescribeLogGroupsOutput, error) +} + +var _ DescribeLogGroupsAPIClient = (*Client)(nil) + +// DescribeLogGroupsPaginatorOptions is the paginator options for DescribeLogGroups +type DescribeLogGroupsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + 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 +} + +// DescribeLogGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeLogGroups +type DescribeLogGroupsPaginator struct { + options DescribeLogGroupsPaginatorOptions + client DescribeLogGroupsAPIClient + params *DescribeLogGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeLogGroupsPaginator returns a new DescribeLogGroupsPaginator +func NewDescribeLogGroupsPaginator(client DescribeLogGroupsAPIClient, params *DescribeLogGroupsInput, optFns ...func(*DescribeLogGroupsPaginatorOptions)) *DescribeLogGroupsPaginator { + options := DescribeLogGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLogGroupsInput{} + } + + return &DescribeLogGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLogGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLogGroups page. +func (p *DescribeLogGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLogGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeLogGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLogGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeLogStreams.go b/service/cloudwatchlogs/api_op_DescribeLogStreams.go index 47456523493..9fe35a1c629 100644 --- a/service/cloudwatchlogs/api_op_DescribeLogStreams.go +++ b/service/cloudwatchlogs/api_op_DescribeLogStreams.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -137,6 +138,89 @@ func addOperationDescribeLogStreamsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeLogStreamsAPIClient is a client that implements the DescribeLogStreams +// operation. +type DescribeLogStreamsAPIClient interface { + DescribeLogStreams(context.Context, *DescribeLogStreamsInput, ...func(*Options)) (*DescribeLogStreamsOutput, error) +} + +var _ DescribeLogStreamsAPIClient = (*Client)(nil) + +// DescribeLogStreamsPaginatorOptions is the paginator options for +// DescribeLogStreams +type DescribeLogStreamsPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + 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 +} + +// DescribeLogStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeLogStreams +type DescribeLogStreamsPaginator struct { + options DescribeLogStreamsPaginatorOptions + client DescribeLogStreamsAPIClient + params *DescribeLogStreamsInput + nextToken *string + firstPage bool +} + +// NewDescribeLogStreamsPaginator returns a new DescribeLogStreamsPaginator +func NewDescribeLogStreamsPaginator(client DescribeLogStreamsAPIClient, params *DescribeLogStreamsInput, optFns ...func(*DescribeLogStreamsPaginatorOptions)) *DescribeLogStreamsPaginator { + options := DescribeLogStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLogStreamsInput{} + } + + return &DescribeLogStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLogStreamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLogStreams page. +func (p *DescribeLogStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLogStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeLogStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLogStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeMetricFilters.go b/service/cloudwatchlogs/api_op_DescribeMetricFilters.go index d8eef419313..a43e7c33b75 100644 --- a/service/cloudwatchlogs/api_op_DescribeMetricFilters.go +++ b/service/cloudwatchlogs/api_op_DescribeMetricFilters.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -125,6 +126,89 @@ func addOperationDescribeMetricFiltersMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeMetricFiltersAPIClient is a client that implements the +// DescribeMetricFilters operation. +type DescribeMetricFiltersAPIClient interface { + DescribeMetricFilters(context.Context, *DescribeMetricFiltersInput, ...func(*Options)) (*DescribeMetricFiltersOutput, error) +} + +var _ DescribeMetricFiltersAPIClient = (*Client)(nil) + +// DescribeMetricFiltersPaginatorOptions is the paginator options for +// DescribeMetricFilters +type DescribeMetricFiltersPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + 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 +} + +// DescribeMetricFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeMetricFilters +type DescribeMetricFiltersPaginator struct { + options DescribeMetricFiltersPaginatorOptions + client DescribeMetricFiltersAPIClient + params *DescribeMetricFiltersInput + nextToken *string + firstPage bool +} + +// NewDescribeMetricFiltersPaginator returns a new DescribeMetricFiltersPaginator +func NewDescribeMetricFiltersPaginator(client DescribeMetricFiltersAPIClient, params *DescribeMetricFiltersInput, optFns ...func(*DescribeMetricFiltersPaginatorOptions)) *DescribeMetricFiltersPaginator { + options := DescribeMetricFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMetricFiltersInput{} + } + + return &DescribeMetricFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMetricFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMetricFilters page. +func (p *DescribeMetricFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMetricFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeMetricFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMetricFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go b/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go index 5a23f2403ef..6b564c29f87 100644 --- a/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go +++ b/service/cloudwatchlogs/api_op_DescribeSubscriptionFilters.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -120,6 +121,90 @@ func addOperationDescribeSubscriptionFiltersMiddlewares(stack *middleware.Stack, return nil } +// DescribeSubscriptionFiltersAPIClient is a client that implements the +// DescribeSubscriptionFilters operation. +type DescribeSubscriptionFiltersAPIClient interface { + DescribeSubscriptionFilters(context.Context, *DescribeSubscriptionFiltersInput, ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error) +} + +var _ DescribeSubscriptionFiltersAPIClient = (*Client)(nil) + +// DescribeSubscriptionFiltersPaginatorOptions is the paginator options for +// DescribeSubscriptionFilters +type DescribeSubscriptionFiltersPaginatorOptions struct { + // The maximum number of items returned. If you don't specify a value, the default + // is up to 50 items. + 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 +} + +// DescribeSubscriptionFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.DescribeSubscriptionFilters +type DescribeSubscriptionFiltersPaginator struct { + options DescribeSubscriptionFiltersPaginatorOptions + client DescribeSubscriptionFiltersAPIClient + params *DescribeSubscriptionFiltersInput + nextToken *string + firstPage bool +} + +// NewDescribeSubscriptionFiltersPaginator returns a new +// DescribeSubscriptionFiltersPaginator +func NewDescribeSubscriptionFiltersPaginator(client DescribeSubscriptionFiltersAPIClient, params *DescribeSubscriptionFiltersInput, optFns ...func(*DescribeSubscriptionFiltersPaginatorOptions)) *DescribeSubscriptionFiltersPaginator { + options := DescribeSubscriptionFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubscriptionFiltersInput{} + } + + return &DescribeSubscriptionFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubscriptionFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSubscriptionFilters page. +func (p *DescribeSubscriptionFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubscriptionFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeSubscriptionFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubscriptionFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_FilterLogEvents.go b/service/cloudwatchlogs/api_op_FilterLogEvents.go index 36e49761ce7..a93e063bcd2 100644 --- a/service/cloudwatchlogs/api_op_FilterLogEvents.go +++ b/service/cloudwatchlogs/api_op_FilterLogEvents.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -166,6 +167,87 @@ func addOperationFilterLogEventsMiddlewares(stack *middleware.Stack, options Opt return nil } +// FilterLogEventsAPIClient is a client that implements the FilterLogEvents +// operation. +type FilterLogEventsAPIClient interface { + FilterLogEvents(context.Context, *FilterLogEventsInput, ...func(*Options)) (*FilterLogEventsOutput, error) +} + +var _ FilterLogEventsAPIClient = (*Client)(nil) + +// FilterLogEventsPaginatorOptions is the paginator options for FilterLogEvents +type FilterLogEventsPaginatorOptions struct { + // The maximum number of events to return. The default is 10,000 events. + 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 +} + +// FilterLogEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.FilterLogEvents +type FilterLogEventsPaginator struct { + options FilterLogEventsPaginatorOptions + client FilterLogEventsAPIClient + params *FilterLogEventsInput + nextToken *string + firstPage bool +} + +// NewFilterLogEventsPaginator returns a new FilterLogEventsPaginator +func NewFilterLogEventsPaginator(client FilterLogEventsAPIClient, params *FilterLogEventsInput, optFns ...func(*FilterLogEventsPaginatorOptions)) *FilterLogEventsPaginator { + options := FilterLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &FilterLogEventsInput{} + } + + return &FilterLogEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *FilterLogEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next FilterLogEvents page. +func (p *FilterLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*FilterLogEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.FilterLogEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opFilterLogEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/api_op_GetLogEvents.go b/service/cloudwatchlogs/api_op_GetLogEvents.go index 7b2a9799a32..488eb3f0967 100644 --- a/service/cloudwatchlogs/api_op_GetLogEvents.go +++ b/service/cloudwatchlogs/api_op_GetLogEvents.go @@ -4,6 +4,7 @@ package cloudwatchlogs 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/cloudwatchlogs/types" @@ -151,6 +152,88 @@ func addOperationGetLogEventsMiddlewares(stack *middleware.Stack, options Option return nil } +// GetLogEventsAPIClient is a client that implements the GetLogEvents operation. +type GetLogEventsAPIClient interface { + GetLogEvents(context.Context, *GetLogEventsInput, ...func(*Options)) (*GetLogEventsOutput, error) +} + +var _ GetLogEventsAPIClient = (*Client)(nil) + +// GetLogEventsPaginatorOptions is the paginator options for GetLogEvents +type GetLogEventsPaginatorOptions struct { + // The maximum number of log events returned. If you don't specify a value, the + // maximum is as many log events as can fit in a response size of 1 MB, up to + // 10,000 log events. + 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 +} + +// GetLogEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs.GetLogEvents +type GetLogEventsPaginator struct { + options GetLogEventsPaginatorOptions + client GetLogEventsAPIClient + params *GetLogEventsInput + nextToken *string + firstPage bool +} + +// NewGetLogEventsPaginator returns a new GetLogEventsPaginator +func NewGetLogEventsPaginator(client GetLogEventsAPIClient, params *GetLogEventsInput, optFns ...func(*GetLogEventsPaginatorOptions)) *GetLogEventsPaginator { + options := GetLogEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLogEventsInput{} + } + + return &GetLogEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLogEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLogEvents page. +func (p *GetLogEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLogEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.GetLogEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextForwardToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLogEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cloudwatchlogs/endpoints.go b/service/cloudwatchlogs/endpoints.go index 9d71ef3c5f4..6ea76b484de 100644 --- a/service/cloudwatchlogs/endpoints.go +++ b/service/cloudwatchlogs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codeartifact/api_op_ListDomains.go b/service/codeartifact/api_op_ListDomains.go index e602cb0193f..1620a730a41 100644 --- a/service/codeartifact/api_op_ListDomains.go +++ b/service/codeartifact/api_op_ListDomains.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -112,6 +113,86 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackageVersionAssets.go b/service/codeartifact/api_op_ListPackageVersionAssets.go index 5e9f5d1ef0c..4c522201cc0 100644 --- a/service/codeartifact/api_op_ListPackageVersionAssets.go +++ b/service/codeartifact/api_op_ListPackageVersionAssets.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -191,6 +192,89 @@ func addOperationListPackageVersionAssetsMiddlewares(stack *middleware.Stack, op return nil } +// ListPackageVersionAssetsAPIClient is a client that implements the +// ListPackageVersionAssets operation. +type ListPackageVersionAssetsAPIClient interface { + ListPackageVersionAssets(context.Context, *ListPackageVersionAssetsInput, ...func(*Options)) (*ListPackageVersionAssetsOutput, error) +} + +var _ ListPackageVersionAssetsAPIClient = (*Client)(nil) + +// ListPackageVersionAssetsPaginatorOptions is the paginator options for +// ListPackageVersionAssets +type ListPackageVersionAssetsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListPackageVersionAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackageVersionAssets +type ListPackageVersionAssetsPaginator struct { + options ListPackageVersionAssetsPaginatorOptions + client ListPackageVersionAssetsAPIClient + params *ListPackageVersionAssetsInput + nextToken *string + firstPage bool +} + +// NewListPackageVersionAssetsPaginator returns a new +// ListPackageVersionAssetsPaginator +func NewListPackageVersionAssetsPaginator(client ListPackageVersionAssetsAPIClient, params *ListPackageVersionAssetsInput, optFns ...func(*ListPackageVersionAssetsPaginatorOptions)) *ListPackageVersionAssetsPaginator { + options := ListPackageVersionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackageVersionAssetsInput{} + } + + return &ListPackageVersionAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackageVersionAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackageVersionAssets page. +func (p *ListPackageVersionAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackageVersionAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPackageVersionAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackageVersionAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackageVersions.go b/service/codeartifact/api_op_ListPackageVersions.go index bc2343c6655..e2ace924510 100644 --- a/service/codeartifact/api_op_ListPackageVersions.go +++ b/service/codeartifact/api_op_ListPackageVersions.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -214,6 +215,88 @@ func addOperationListPackageVersionsMiddlewares(stack *middleware.Stack, options return nil } +// ListPackageVersionsAPIClient is a client that implements the ListPackageVersions +// operation. +type ListPackageVersionsAPIClient interface { + ListPackageVersions(context.Context, *ListPackageVersionsInput, ...func(*Options)) (*ListPackageVersionsOutput, error) +} + +var _ ListPackageVersionsAPIClient = (*Client)(nil) + +// ListPackageVersionsPaginatorOptions is the paginator options for +// ListPackageVersions +type ListPackageVersionsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListPackageVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackageVersions +type ListPackageVersionsPaginator struct { + options ListPackageVersionsPaginatorOptions + client ListPackageVersionsAPIClient + params *ListPackageVersionsInput + nextToken *string + firstPage bool +} + +// NewListPackageVersionsPaginator returns a new ListPackageVersionsPaginator +func NewListPackageVersionsPaginator(client ListPackageVersionsAPIClient, params *ListPackageVersionsInput, optFns ...func(*ListPackageVersionsPaginatorOptions)) *ListPackageVersionsPaginator { + options := ListPackageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackageVersionsInput{} + } + + return &ListPackageVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackageVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackageVersions page. +func (p *ListPackageVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackageVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPackageVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackageVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListPackages.go b/service/codeartifact/api_op_ListPackages.go index ac0996c8679..204a9f34cc7 100644 --- a/service/codeartifact/api_op_ListPackages.go +++ b/service/codeartifact/api_op_ListPackages.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -157,6 +158,86 @@ func addOperationListPackagesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListPackagesAPIClient is a client that implements the ListPackages operation. +type ListPackagesAPIClient interface { + ListPackages(context.Context, *ListPackagesInput, ...func(*Options)) (*ListPackagesOutput, error) +} + +var _ ListPackagesAPIClient = (*Client)(nil) + +// ListPackagesPaginatorOptions is the paginator options for ListPackages +type ListPackagesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListPackages +type ListPackagesPaginator struct { + options ListPackagesPaginatorOptions + client ListPackagesAPIClient + params *ListPackagesInput + nextToken *string + firstPage bool +} + +// NewListPackagesPaginator returns a new ListPackagesPaginator +func NewListPackagesPaginator(client ListPackagesAPIClient, params *ListPackagesInput, optFns ...func(*ListPackagesPaginatorOptions)) *ListPackagesPaginator { + options := ListPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagesInput{} + } + + return &ListPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackages page. +func (p *ListPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListRepositories.go b/service/codeartifact/api_op_ListRepositories.go index 449020759dc..02c8aace4eb 100644 --- a/service/codeartifact/api_op_ListRepositories.go +++ b/service/codeartifact/api_op_ListRepositories.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -115,6 +116,87 @@ func addOperationListRepositoriesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListRepositoriesAPIClient is a client that implements the ListRepositories +// operation. +type ListRepositoriesAPIClient interface { + ListRepositories(context.Context, *ListRepositoriesInput, ...func(*Options)) (*ListRepositoriesOutput, error) +} + +var _ ListRepositoriesAPIClient = (*Client)(nil) + +// ListRepositoriesPaginatorOptions is the paginator options for ListRepositories +type ListRepositoriesPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListRepositories +type ListRepositoriesPaginator struct { + options ListRepositoriesPaginatorOptions + client ListRepositoriesAPIClient + params *ListRepositoriesInput + nextToken *string + firstPage bool +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInput{} + } + + return &ListRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRepositories page. +func (p *ListRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/api_op_ListRepositoriesInDomain.go b/service/codeartifact/api_op_ListRepositoriesInDomain.go index 198a1a6a9dc..527e7d7f423 100644 --- a/service/codeartifact/api_op_ListRepositoriesInDomain.go +++ b/service/codeartifact/api_op_ListRepositoriesInDomain.go @@ -4,6 +4,7 @@ package codeartifact 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/codeartifact/types" @@ -129,6 +130,89 @@ func addOperationListRepositoriesInDomainMiddlewares(stack *middleware.Stack, op return nil } +// ListRepositoriesInDomainAPIClient is a client that implements the +// ListRepositoriesInDomain operation. +type ListRepositoriesInDomainAPIClient interface { + ListRepositoriesInDomain(context.Context, *ListRepositoriesInDomainInput, ...func(*Options)) (*ListRepositoriesInDomainOutput, error) +} + +var _ ListRepositoriesInDomainAPIClient = (*Client)(nil) + +// ListRepositoriesInDomainPaginatorOptions is the paginator options for +// ListRepositoriesInDomain +type ListRepositoriesInDomainPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListRepositoriesInDomainPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeartifact.ListRepositoriesInDomain +type ListRepositoriesInDomainPaginator struct { + options ListRepositoriesInDomainPaginatorOptions + client ListRepositoriesInDomainAPIClient + params *ListRepositoriesInDomainInput + nextToken *string + firstPage bool +} + +// NewListRepositoriesInDomainPaginator returns a new +// ListRepositoriesInDomainPaginator +func NewListRepositoriesInDomainPaginator(client ListRepositoriesInDomainAPIClient, params *ListRepositoriesInDomainInput, optFns ...func(*ListRepositoriesInDomainPaginatorOptions)) *ListRepositoriesInDomainPaginator { + options := ListRepositoriesInDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInDomainInput{} + } + + return &ListRepositoriesInDomainPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesInDomainPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRepositoriesInDomain page. +func (p *ListRepositoriesInDomainPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesInDomainOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRepositoriesInDomain(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoriesInDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codeartifact/endpoints.go b/service/codeartifact/endpoints.go index 410a6108348..8bda3be84cc 100644 --- a/service/codeartifact/endpoints.go +++ b/service/codeartifact/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codebuild/api_op_DescribeCodeCoverages.go b/service/codebuild/api_op_DescribeCodeCoverages.go index 8c26bd2b31e..5fe5bfc7dc7 100644 --- a/service/codebuild/api_op_DescribeCodeCoverages.go +++ b/service/codebuild/api_op_DescribeCodeCoverages.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -130,6 +131,88 @@ func addOperationDescribeCodeCoveragesMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeCodeCoveragesAPIClient is a client that implements the +// DescribeCodeCoverages operation. +type DescribeCodeCoveragesAPIClient interface { + DescribeCodeCoverages(context.Context, *DescribeCodeCoveragesInput, ...func(*Options)) (*DescribeCodeCoveragesOutput, error) +} + +var _ DescribeCodeCoveragesAPIClient = (*Client)(nil) + +// DescribeCodeCoveragesPaginatorOptions is the paginator options for +// DescribeCodeCoverages +type DescribeCodeCoveragesPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeCodeCoveragesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.DescribeCodeCoverages +type DescribeCodeCoveragesPaginator struct { + options DescribeCodeCoveragesPaginatorOptions + client DescribeCodeCoveragesAPIClient + params *DescribeCodeCoveragesInput + nextToken *string + firstPage bool +} + +// NewDescribeCodeCoveragesPaginator returns a new DescribeCodeCoveragesPaginator +func NewDescribeCodeCoveragesPaginator(client DescribeCodeCoveragesAPIClient, params *DescribeCodeCoveragesInput, optFns ...func(*DescribeCodeCoveragesPaginatorOptions)) *DescribeCodeCoveragesPaginator { + options := DescribeCodeCoveragesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCodeCoveragesInput{} + } + + return &DescribeCodeCoveragesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCodeCoveragesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCodeCoverages page. +func (p *DescribeCodeCoveragesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCodeCoveragesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeCodeCoverages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCodeCoverages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_DescribeTestCases.go b/service/codebuild/api_op_DescribeTestCases.go index 56c6b951f03..a920e4f0744 100644 --- a/service/codebuild/api_op_DescribeTestCases.go +++ b/service/codebuild/api_op_DescribeTestCases.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -128,6 +129,89 @@ func addOperationDescribeTestCasesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeTestCasesAPIClient is a client that implements the DescribeTestCases +// operation. +type DescribeTestCasesAPIClient interface { + DescribeTestCases(context.Context, *DescribeTestCasesInput, ...func(*Options)) (*DescribeTestCasesOutput, error) +} + +var _ DescribeTestCasesAPIClient = (*Client)(nil) + +// DescribeTestCasesPaginatorOptions is the paginator options for DescribeTestCases +type DescribeTestCasesPaginatorOptions struct { + // The maximum number of paginated test cases returned per response. Use nextToken + // to iterate pages in the list of returned TestCase objects. The default value is + // 100. + 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 +} + +// DescribeTestCasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.DescribeTestCases +type DescribeTestCasesPaginator struct { + options DescribeTestCasesPaginatorOptions + client DescribeTestCasesAPIClient + params *DescribeTestCasesInput + nextToken *string + firstPage bool +} + +// NewDescribeTestCasesPaginator returns a new DescribeTestCasesPaginator +func NewDescribeTestCasesPaginator(client DescribeTestCasesAPIClient, params *DescribeTestCasesInput, optFns ...func(*DescribeTestCasesPaginatorOptions)) *DescribeTestCasesPaginator { + options := DescribeTestCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTestCasesInput{} + } + + return &DescribeTestCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTestCasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTestCases page. +func (p *DescribeTestCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTestCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeTestCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTestCases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildBatches.go b/service/codebuild/api_op_ListBuildBatches.go index 74202bab842..c061bd94efc 100644 --- a/service/codebuild/api_op_ListBuildBatches.go +++ b/service/codebuild/api_op_ListBuildBatches.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -120,6 +121,87 @@ func addOperationListBuildBatchesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListBuildBatchesAPIClient is a client that implements the ListBuildBatches +// operation. +type ListBuildBatchesAPIClient interface { + ListBuildBatches(context.Context, *ListBuildBatchesInput, ...func(*Options)) (*ListBuildBatchesOutput, error) +} + +var _ ListBuildBatchesAPIClient = (*Client)(nil) + +// ListBuildBatchesPaginatorOptions is the paginator options for ListBuildBatches +type ListBuildBatchesPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListBuildBatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildBatches +type ListBuildBatchesPaginator struct { + options ListBuildBatchesPaginatorOptions + client ListBuildBatchesAPIClient + params *ListBuildBatchesInput + nextToken *string + firstPage bool +} + +// NewListBuildBatchesPaginator returns a new ListBuildBatchesPaginator +func NewListBuildBatchesPaginator(client ListBuildBatchesAPIClient, params *ListBuildBatchesInput, optFns ...func(*ListBuildBatchesPaginatorOptions)) *ListBuildBatchesPaginator { + options := ListBuildBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildBatchesInput{} + } + + return &ListBuildBatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildBatchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBuildBatches page. +func (p *ListBuildBatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildBatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBuildBatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildBatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildBatchesForProject.go b/service/codebuild/api_op_ListBuildBatchesForProject.go index dc858f211f0..9ce288cd5d1 100644 --- a/service/codebuild/api_op_ListBuildBatchesForProject.go +++ b/service/codebuild/api_op_ListBuildBatchesForProject.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -123,6 +124,89 @@ func addOperationListBuildBatchesForProjectMiddlewares(stack *middleware.Stack, return nil } +// ListBuildBatchesForProjectAPIClient is a client that implements the +// ListBuildBatchesForProject operation. +type ListBuildBatchesForProjectAPIClient interface { + ListBuildBatchesForProject(context.Context, *ListBuildBatchesForProjectInput, ...func(*Options)) (*ListBuildBatchesForProjectOutput, error) +} + +var _ ListBuildBatchesForProjectAPIClient = (*Client)(nil) + +// ListBuildBatchesForProjectPaginatorOptions is the paginator options for +// ListBuildBatchesForProject +type ListBuildBatchesForProjectPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListBuildBatchesForProjectPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildBatchesForProject +type ListBuildBatchesForProjectPaginator struct { + options ListBuildBatchesForProjectPaginatorOptions + client ListBuildBatchesForProjectAPIClient + params *ListBuildBatchesForProjectInput + nextToken *string + firstPage bool +} + +// NewListBuildBatchesForProjectPaginator returns a new +// ListBuildBatchesForProjectPaginator +func NewListBuildBatchesForProjectPaginator(client ListBuildBatchesForProjectAPIClient, params *ListBuildBatchesForProjectInput, optFns ...func(*ListBuildBatchesForProjectPaginatorOptions)) *ListBuildBatchesForProjectPaginator { + options := ListBuildBatchesForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildBatchesForProjectInput{} + } + + return &ListBuildBatchesForProjectPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildBatchesForProjectPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBuildBatchesForProject page. +func (p *ListBuildBatchesForProjectPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildBatchesForProjectOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBuildBatchesForProject(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildBatchesForProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuilds.go b/service/codebuild/api_op_ListBuilds.go index cba50cdddcb..f41d09c483c 100644 --- a/service/codebuild/api_op_ListBuilds.go +++ b/service/codebuild/api_op_ListBuilds.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -119,6 +120,79 @@ func addOperationListBuildsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListBuildsAPIClient is a client that implements the ListBuilds operation. +type ListBuildsAPIClient interface { + ListBuilds(context.Context, *ListBuildsInput, ...func(*Options)) (*ListBuildsOutput, error) +} + +var _ ListBuildsAPIClient = (*Client)(nil) + +// ListBuildsPaginatorOptions is the paginator options for ListBuilds +type ListBuildsPaginatorOptions struct { + // 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 +} + +// ListBuildsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuilds +type ListBuildsPaginator struct { + options ListBuildsPaginatorOptions + client ListBuildsAPIClient + params *ListBuildsInput + nextToken *string + firstPage bool +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsInput{} + } + + return &ListBuildsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBuilds page. +func (p *ListBuildsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBuilds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuilds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListBuildsForProject.go b/service/codebuild/api_op_ListBuildsForProject.go index 0020ca13d08..f957a8b8ca4 100644 --- a/service/codebuild/api_op_ListBuildsForProject.go +++ b/service/codebuild/api_op_ListBuildsForProject.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -129,6 +130,81 @@ func addOperationListBuildsForProjectMiddlewares(stack *middleware.Stack, option return nil } +// ListBuildsForProjectAPIClient is a client that implements the +// ListBuildsForProject operation. +type ListBuildsForProjectAPIClient interface { + ListBuildsForProject(context.Context, *ListBuildsForProjectInput, ...func(*Options)) (*ListBuildsForProjectOutput, error) +} + +var _ ListBuildsForProjectAPIClient = (*Client)(nil) + +// ListBuildsForProjectPaginatorOptions is the paginator options for +// ListBuildsForProject +type ListBuildsForProjectPaginatorOptions struct { + // 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 +} + +// ListBuildsForProjectPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListBuildsForProject +type ListBuildsForProjectPaginator struct { + options ListBuildsForProjectPaginatorOptions + client ListBuildsForProjectAPIClient + params *ListBuildsForProjectInput + nextToken *string + firstPage bool +} + +// NewListBuildsForProjectPaginator returns a new ListBuildsForProjectPaginator +func NewListBuildsForProjectPaginator(client ListBuildsForProjectAPIClient, params *ListBuildsForProjectInput, optFns ...func(*ListBuildsForProjectPaginatorOptions)) *ListBuildsForProjectPaginator { + options := ListBuildsForProjectPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsForProjectInput{} + } + + return &ListBuildsForProjectPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsForProjectPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBuildsForProject page. +func (p *ListBuildsForProjectPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsForProjectOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBuildsForProject(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuildsForProject(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListProjects.go b/service/codebuild/api_op_ListProjects.go index 051bad41d4d..0f2fc65b080 100644 --- a/service/codebuild/api_op_ListProjects.go +++ b/service/codebuild/api_op_ListProjects.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -139,6 +140,79 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // 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 +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReportGroups.go b/service/codebuild/api_op_ListReportGroups.go index 37bf7ba6d50..9c15da30a1a 100644 --- a/service/codebuild/api_op_ListReportGroups.go +++ b/service/codebuild/api_op_ListReportGroups.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -133,6 +134,89 @@ func addOperationListReportGroupsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListReportGroupsAPIClient is a client that implements the ListReportGroups +// operation. +type ListReportGroupsAPIClient interface { + ListReportGroups(context.Context, *ListReportGroupsInput, ...func(*Options)) (*ListReportGroupsOutput, error) +} + +var _ ListReportGroupsAPIClient = (*Client)(nil) + +// ListReportGroupsPaginatorOptions is the paginator options for ListReportGroups +type ListReportGroupsPaginatorOptions struct { + // The maximum number of paginated report groups returned per response. Use + // nextToken to iterate pages in the list of returned ReportGroup objects. The + // default value is 100. + 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 +} + +// ListReportGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReportGroups +type ListReportGroupsPaginator struct { + options ListReportGroupsPaginatorOptions + client ListReportGroupsAPIClient + params *ListReportGroupsInput + nextToken *string + firstPage bool +} + +// NewListReportGroupsPaginator returns a new ListReportGroupsPaginator +func NewListReportGroupsPaginator(client ListReportGroupsAPIClient, params *ListReportGroupsInput, optFns ...func(*ListReportGroupsPaginatorOptions)) *ListReportGroupsPaginator { + options := ListReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportGroupsInput{} + } + + return &ListReportGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReportGroups page. +func (p *ListReportGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListReportGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReportGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReports.go b/service/codebuild/api_op_ListReports.go index ec52e617341..3c6634b6f65 100644 --- a/service/codebuild/api_op_ListReports.go +++ b/service/codebuild/api_op_ListReports.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -129,6 +130,87 @@ func addOperationListReportsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListReportsAPIClient is a client that implements the ListReports operation. +type ListReportsAPIClient interface { + ListReports(context.Context, *ListReportsInput, ...func(*Options)) (*ListReportsOutput, error) +} + +var _ ListReportsAPIClient = (*Client)(nil) + +// ListReportsPaginatorOptions is the paginator options for ListReports +type ListReportsPaginatorOptions struct { + // The maximum number of paginated reports returned per response. Use nextToken to + // iterate pages in the list of returned Report objects. The default value is 100. + 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 +} + +// ListReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReports +type ListReportsPaginator struct { + options ListReportsPaginatorOptions + client ListReportsAPIClient + params *ListReportsInput + nextToken *string + firstPage bool +} + +// NewListReportsPaginator returns a new ListReportsPaginator +func NewListReportsPaginator(client ListReportsAPIClient, params *ListReportsInput, optFns ...func(*ListReportsPaginatorOptions)) *ListReportsPaginator { + options := ListReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportsInput{} + } + + return &ListReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReports page. +func (p *ListReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListReportsForReportGroup.go b/service/codebuild/api_op_ListReportsForReportGroup.go index 93e807748dc..a0941e1ca68 100644 --- a/service/codebuild/api_op_ListReportsForReportGroup.go +++ b/service/codebuild/api_op_ListReportsForReportGroup.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -132,6 +133,91 @@ func addOperationListReportsForReportGroupMiddlewares(stack *middleware.Stack, o return nil } +// ListReportsForReportGroupAPIClient is a client that implements the +// ListReportsForReportGroup operation. +type ListReportsForReportGroupAPIClient interface { + ListReportsForReportGroup(context.Context, *ListReportsForReportGroupInput, ...func(*Options)) (*ListReportsForReportGroupOutput, error) +} + +var _ ListReportsForReportGroupAPIClient = (*Client)(nil) + +// ListReportsForReportGroupPaginatorOptions is the paginator options for +// ListReportsForReportGroup +type ListReportsForReportGroupPaginatorOptions struct { + // The maximum number of paginated reports in this report group returned per + // response. Use nextToken to iterate pages in the list of returned Report objects. + // The default value is 100. + 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 +} + +// ListReportsForReportGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListReportsForReportGroup +type ListReportsForReportGroupPaginator struct { + options ListReportsForReportGroupPaginatorOptions + client ListReportsForReportGroupAPIClient + params *ListReportsForReportGroupInput + nextToken *string + firstPage bool +} + +// NewListReportsForReportGroupPaginator returns a new +// ListReportsForReportGroupPaginator +func NewListReportsForReportGroupPaginator(client ListReportsForReportGroupAPIClient, params *ListReportsForReportGroupInput, optFns ...func(*ListReportsForReportGroupPaginatorOptions)) *ListReportsForReportGroupPaginator { + options := ListReportsForReportGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReportsForReportGroupInput{} + } + + return &ListReportsForReportGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReportsForReportGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReportsForReportGroup page. +func (p *ListReportsForReportGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReportsForReportGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListReportsForReportGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReportsForReportGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListSharedProjects.go b/service/codebuild/api_op_ListSharedProjects.go index 2edb626de47..cd32bc09bb6 100644 --- a/service/codebuild/api_op_ListSharedProjects.go +++ b/service/codebuild/api_op_ListSharedProjects.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -136,6 +137,90 @@ func addOperationListSharedProjectsMiddlewares(stack *middleware.Stack, options return nil } +// ListSharedProjectsAPIClient is a client that implements the ListSharedProjects +// operation. +type ListSharedProjectsAPIClient interface { + ListSharedProjects(context.Context, *ListSharedProjectsInput, ...func(*Options)) (*ListSharedProjectsOutput, error) +} + +var _ ListSharedProjectsAPIClient = (*Client)(nil) + +// ListSharedProjectsPaginatorOptions is the paginator options for +// ListSharedProjects +type ListSharedProjectsPaginatorOptions struct { + // The maximum number of paginated shared build projects returned per response. Use + // nextToken to iterate pages in the list of returned Project objects. The default + // value is 100. + 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 +} + +// ListSharedProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListSharedProjects +type ListSharedProjectsPaginator struct { + options ListSharedProjectsPaginatorOptions + client ListSharedProjectsAPIClient + params *ListSharedProjectsInput + nextToken *string + firstPage bool +} + +// NewListSharedProjectsPaginator returns a new ListSharedProjectsPaginator +func NewListSharedProjectsPaginator(client ListSharedProjectsAPIClient, params *ListSharedProjectsInput, optFns ...func(*ListSharedProjectsPaginatorOptions)) *ListSharedProjectsPaginator { + options := ListSharedProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSharedProjectsInput{} + } + + return &ListSharedProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSharedProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSharedProjects page. +func (p *ListSharedProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSharedProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSharedProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSharedProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/api_op_ListSharedReportGroups.go b/service/codebuild/api_op_ListSharedReportGroups.go index 16f08ef0e28..8e2a0e78d52 100644 --- a/service/codebuild/api_op_ListSharedReportGroups.go +++ b/service/codebuild/api_op_ListSharedReportGroups.go @@ -4,6 +4,7 @@ package codebuild 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/codebuild/types" @@ -136,6 +137,90 @@ func addOperationListSharedReportGroupsMiddlewares(stack *middleware.Stack, opti return nil } +// ListSharedReportGroupsAPIClient is a client that implements the +// ListSharedReportGroups operation. +type ListSharedReportGroupsAPIClient interface { + ListSharedReportGroups(context.Context, *ListSharedReportGroupsInput, ...func(*Options)) (*ListSharedReportGroupsOutput, error) +} + +var _ ListSharedReportGroupsAPIClient = (*Client)(nil) + +// ListSharedReportGroupsPaginatorOptions is the paginator options for +// ListSharedReportGroups +type ListSharedReportGroupsPaginatorOptions struct { + // The maximum number of paginated shared report groups per response. Use nextToken + // to iterate pages in the list of returned ReportGroup objects. The default value + // is 100. + 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 +} + +// ListSharedReportGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codebuild.ListSharedReportGroups +type ListSharedReportGroupsPaginator struct { + options ListSharedReportGroupsPaginatorOptions + client ListSharedReportGroupsAPIClient + params *ListSharedReportGroupsInput + nextToken *string + firstPage bool +} + +// NewListSharedReportGroupsPaginator returns a new ListSharedReportGroupsPaginator +func NewListSharedReportGroupsPaginator(client ListSharedReportGroupsAPIClient, params *ListSharedReportGroupsInput, optFns ...func(*ListSharedReportGroupsPaginatorOptions)) *ListSharedReportGroupsPaginator { + options := ListSharedReportGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSharedReportGroupsInput{} + } + + return &ListSharedReportGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSharedReportGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSharedReportGroups page. +func (p *ListSharedReportGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSharedReportGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSharedReportGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSharedReportGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codebuild/endpoints.go b/service/codebuild/endpoints.go index f3d14ec3b35..f39bc01be81 100644 --- a/service/codebuild/endpoints.go +++ b/service/codebuild/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codecommit/api_op_DescribeMergeConflicts.go b/service/codecommit/api_op_DescribeMergeConflicts.go index 93295ec0397..66c4c9bb9de 100644 --- a/service/codecommit/api_op_DescribeMergeConflicts.go +++ b/service/codecommit/api_op_DescribeMergeConflicts.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -175,6 +176,88 @@ func addOperationDescribeMergeConflictsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeMergeConflictsAPIClient is a client that implements the +// DescribeMergeConflicts operation. +type DescribeMergeConflictsAPIClient interface { + DescribeMergeConflicts(context.Context, *DescribeMergeConflictsInput, ...func(*Options)) (*DescribeMergeConflictsOutput, error) +} + +var _ DescribeMergeConflictsAPIClient = (*Client)(nil) + +// DescribeMergeConflictsPaginatorOptions is the paginator options for +// DescribeMergeConflicts +type DescribeMergeConflictsPaginatorOptions struct { + // The maximum number of merge hunks to include in the output. + 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 +} + +// DescribeMergeConflictsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.DescribeMergeConflicts +type DescribeMergeConflictsPaginator struct { + options DescribeMergeConflictsPaginatorOptions + client DescribeMergeConflictsAPIClient + params *DescribeMergeConflictsInput + nextToken *string + firstPage bool +} + +// NewDescribeMergeConflictsPaginator returns a new DescribeMergeConflictsPaginator +func NewDescribeMergeConflictsPaginator(client DescribeMergeConflictsAPIClient, params *DescribeMergeConflictsInput, optFns ...func(*DescribeMergeConflictsPaginatorOptions)) *DescribeMergeConflictsPaginator { + options := DescribeMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMergeConflictsInput{} + } + + return &DescribeMergeConflictsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMergeConflictsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMergeConflicts page. +func (p *DescribeMergeConflictsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMergeConflictsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxMergeHunks = &p.options.Limit + } + + result, err := p.client.DescribeMergeConflicts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMergeConflicts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_DescribePullRequestEvents.go b/service/codecommit/api_op_DescribePullRequestEvents.go index 27ac7122e60..63a1bc6dfae 100644 --- a/service/codecommit/api_op_DescribePullRequestEvents.go +++ b/service/codecommit/api_op_DescribePullRequestEvents.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -129,6 +130,91 @@ func addOperationDescribePullRequestEventsMiddlewares(stack *middleware.Stack, o return nil } +// DescribePullRequestEventsAPIClient is a client that implements the +// DescribePullRequestEvents operation. +type DescribePullRequestEventsAPIClient interface { + DescribePullRequestEvents(context.Context, *DescribePullRequestEventsInput, ...func(*Options)) (*DescribePullRequestEventsOutput, error) +} + +var _ DescribePullRequestEventsAPIClient = (*Client)(nil) + +// DescribePullRequestEventsPaginatorOptions is the paginator options for +// DescribePullRequestEvents +type DescribePullRequestEventsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 events, which is also the maximum number of events that can + // be returned in a result. + 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 +} + +// DescribePullRequestEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.DescribePullRequestEvents +type DescribePullRequestEventsPaginator struct { + options DescribePullRequestEventsPaginatorOptions + client DescribePullRequestEventsAPIClient + params *DescribePullRequestEventsInput + nextToken *string + firstPage bool +} + +// NewDescribePullRequestEventsPaginator returns a new +// DescribePullRequestEventsPaginator +func NewDescribePullRequestEventsPaginator(client DescribePullRequestEventsAPIClient, params *DescribePullRequestEventsInput, optFns ...func(*DescribePullRequestEventsPaginatorOptions)) *DescribePullRequestEventsPaginator { + options := DescribePullRequestEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePullRequestEventsInput{} + } + + return &DescribePullRequestEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePullRequestEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePullRequestEvents page. +func (p *DescribePullRequestEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePullRequestEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribePullRequestEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePullRequestEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentReactions.go b/service/codecommit/api_op_GetCommentReactions.go index 37e6269915f..611abd274e4 100644 --- a/service/codecommit/api_op_GetCommentReactions.go +++ b/service/codecommit/api_op_GetCommentReactions.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -123,6 +124,89 @@ func addOperationGetCommentReactionsMiddlewares(stack *middleware.Stack, options return nil } +// GetCommentReactionsAPIClient is a client that implements the GetCommentReactions +// operation. +type GetCommentReactionsAPIClient interface { + GetCommentReactions(context.Context, *GetCommentReactionsInput, ...func(*Options)) (*GetCommentReactionsOutput, error) +} + +var _ GetCommentReactionsAPIClient = (*Client)(nil) + +// GetCommentReactionsPaginatorOptions is the paginator options for +// GetCommentReactions +type GetCommentReactionsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is the same as the allowed maximum, 1,000. + 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 +} + +// GetCommentReactionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentReactions +type GetCommentReactionsPaginator struct { + options GetCommentReactionsPaginatorOptions + client GetCommentReactionsAPIClient + params *GetCommentReactionsInput + nextToken *string + firstPage bool +} + +// NewGetCommentReactionsPaginator returns a new GetCommentReactionsPaginator +func NewGetCommentReactionsPaginator(client GetCommentReactionsAPIClient, params *GetCommentReactionsInput, optFns ...func(*GetCommentReactionsPaginatorOptions)) *GetCommentReactionsPaginator { + options := GetCommentReactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentReactionsInput{} + } + + return &GetCommentReactionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentReactionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCommentReactions page. +func (p *GetCommentReactionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentReactionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCommentReactions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentReactions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentsForComparedCommit.go b/service/codecommit/api_op_GetCommentsForComparedCommit.go index f0d46087d51..66efd066823 100644 --- a/service/codecommit/api_op_GetCommentsForComparedCommit.go +++ b/service/codecommit/api_op_GetCommentsForComparedCommit.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -129,6 +130,90 @@ func addOperationGetCommentsForComparedCommitMiddlewares(stack *middleware.Stack return nil } +// GetCommentsForComparedCommitAPIClient is a client that implements the +// GetCommentsForComparedCommit operation. +type GetCommentsForComparedCommitAPIClient interface { + GetCommentsForComparedCommit(context.Context, *GetCommentsForComparedCommitInput, ...func(*Options)) (*GetCommentsForComparedCommitOutput, error) +} + +var _ GetCommentsForComparedCommitAPIClient = (*Client)(nil) + +// GetCommentsForComparedCommitPaginatorOptions is the paginator options for +// GetCommentsForComparedCommit +type GetCommentsForComparedCommitPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments, but you can configure up to 500. + 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 +} + +// GetCommentsForComparedCommitPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentsForComparedCommit +type GetCommentsForComparedCommitPaginator struct { + options GetCommentsForComparedCommitPaginatorOptions + client GetCommentsForComparedCommitAPIClient + params *GetCommentsForComparedCommitInput + nextToken *string + firstPage bool +} + +// NewGetCommentsForComparedCommitPaginator returns a new +// GetCommentsForComparedCommitPaginator +func NewGetCommentsForComparedCommitPaginator(client GetCommentsForComparedCommitAPIClient, params *GetCommentsForComparedCommitInput, optFns ...func(*GetCommentsForComparedCommitPaginatorOptions)) *GetCommentsForComparedCommitPaginator { + options := GetCommentsForComparedCommitPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentsForComparedCommitInput{} + } + + return &GetCommentsForComparedCommitPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentsForComparedCommitPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCommentsForComparedCommit page. +func (p *GetCommentsForComparedCommitPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentsForComparedCommitOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCommentsForComparedCommit(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentsForComparedCommit(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetCommentsForPullRequest.go b/service/codecommit/api_op_GetCommentsForPullRequest.go index edb82c1441e..cc9fe02126c 100644 --- a/service/codecommit/api_op_GetCommentsForPullRequest.go +++ b/service/codecommit/api_op_GetCommentsForPullRequest.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -131,6 +132,91 @@ func addOperationGetCommentsForPullRequestMiddlewares(stack *middleware.Stack, o return nil } +// GetCommentsForPullRequestAPIClient is a client that implements the +// GetCommentsForPullRequest operation. +type GetCommentsForPullRequestAPIClient interface { + GetCommentsForPullRequest(context.Context, *GetCommentsForPullRequestInput, ...func(*Options)) (*GetCommentsForPullRequestOutput, error) +} + +var _ GetCommentsForPullRequestAPIClient = (*Client)(nil) + +// GetCommentsForPullRequestPaginatorOptions is the paginator options for +// GetCommentsForPullRequest +type GetCommentsForPullRequestPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments. You can return up to 500 comments with a single + // request. + 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 +} + +// GetCommentsForPullRequestPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetCommentsForPullRequest +type GetCommentsForPullRequestPaginator struct { + options GetCommentsForPullRequestPaginatorOptions + client GetCommentsForPullRequestAPIClient + params *GetCommentsForPullRequestInput + nextToken *string + firstPage bool +} + +// NewGetCommentsForPullRequestPaginator returns a new +// GetCommentsForPullRequestPaginator +func NewGetCommentsForPullRequestPaginator(client GetCommentsForPullRequestAPIClient, params *GetCommentsForPullRequestInput, optFns ...func(*GetCommentsForPullRequestPaginatorOptions)) *GetCommentsForPullRequestPaginator { + options := GetCommentsForPullRequestPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCommentsForPullRequestInput{} + } + + return &GetCommentsForPullRequestPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCommentsForPullRequestPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCommentsForPullRequest page. +func (p *GetCommentsForPullRequestPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCommentsForPullRequestOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCommentsForPullRequest(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCommentsForPullRequest(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetDifferences.go b/service/codecommit/api_op_GetDifferences.go index f528bbb78ad..c65ac32f0fc 100644 --- a/service/codecommit/api_op_GetDifferences.go +++ b/service/codecommit/api_op_GetDifferences.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -141,6 +142,87 @@ func addOperationGetDifferencesMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetDifferencesAPIClient is a client that implements the GetDifferences +// operation. +type GetDifferencesAPIClient interface { + GetDifferences(context.Context, *GetDifferencesInput, ...func(*Options)) (*GetDifferencesOutput, error) +} + +var _ GetDifferencesAPIClient = (*Client)(nil) + +// GetDifferencesPaginatorOptions is the paginator options for GetDifferences +type GetDifferencesPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + 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 +} + +// GetDifferencesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetDifferences +type GetDifferencesPaginator struct { + options GetDifferencesPaginatorOptions + client GetDifferencesAPIClient + params *GetDifferencesInput + nextToken *string + firstPage bool +} + +// NewGetDifferencesPaginator returns a new GetDifferencesPaginator +func NewGetDifferencesPaginator(client GetDifferencesAPIClient, params *GetDifferencesInput, optFns ...func(*GetDifferencesPaginatorOptions)) *GetDifferencesPaginator { + options := GetDifferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDifferencesInput{} + } + + return &GetDifferencesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDifferencesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDifferences page. +func (p *GetDifferencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDifferencesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetDifferences(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDifferences(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_GetMergeConflicts.go b/service/codecommit/api_op_GetMergeConflicts.go index 8a22e1a07df..04a5fef2dd7 100644 --- a/service/codecommit/api_op_GetMergeConflicts.go +++ b/service/codecommit/api_op_GetMergeConflicts.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -169,6 +170,87 @@ func addOperationGetMergeConflictsMiddlewares(stack *middleware.Stack, options O return nil } +// GetMergeConflictsAPIClient is a client that implements the GetMergeConflicts +// operation. +type GetMergeConflictsAPIClient interface { + GetMergeConflicts(context.Context, *GetMergeConflictsInput, ...func(*Options)) (*GetMergeConflictsOutput, error) +} + +var _ GetMergeConflictsAPIClient = (*Client)(nil) + +// GetMergeConflictsPaginatorOptions is the paginator options for GetMergeConflicts +type GetMergeConflictsPaginatorOptions struct { + // The maximum number of files to include in the output. + 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 +} + +// GetMergeConflictsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.GetMergeConflicts +type GetMergeConflictsPaginator struct { + options GetMergeConflictsPaginatorOptions + client GetMergeConflictsAPIClient + params *GetMergeConflictsInput + nextToken *string + firstPage bool +} + +// NewGetMergeConflictsPaginator returns a new GetMergeConflictsPaginator +func NewGetMergeConflictsPaginator(client GetMergeConflictsAPIClient, params *GetMergeConflictsInput, optFns ...func(*GetMergeConflictsPaginatorOptions)) *GetMergeConflictsPaginator { + options := GetMergeConflictsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMergeConflictsInput{} + } + + return &GetMergeConflictsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMergeConflictsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetMergeConflicts page. +func (p *GetMergeConflictsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMergeConflictsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxConflictFiles = &p.options.Limit + } + + result, err := p.client.GetMergeConflicts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMergeConflicts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListApprovalRuleTemplates.go b/service/codecommit/api_op_ListApprovalRuleTemplates.go index b8119317c87..066c3c1c185 100644 --- a/service/codecommit/api_op_ListApprovalRuleTemplates.go +++ b/service/codecommit/api_op_ListApprovalRuleTemplates.go @@ -4,6 +4,7 @@ package codecommit 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/awslabs/smithy-go/middleware" @@ -109,6 +110,89 @@ func addOperationListApprovalRuleTemplatesMiddlewares(stack *middleware.Stack, o return nil } +// ListApprovalRuleTemplatesAPIClient is a client that implements the +// ListApprovalRuleTemplates operation. +type ListApprovalRuleTemplatesAPIClient interface { + ListApprovalRuleTemplates(context.Context, *ListApprovalRuleTemplatesInput, ...func(*Options)) (*ListApprovalRuleTemplatesOutput, error) +} + +var _ ListApprovalRuleTemplatesAPIClient = (*Client)(nil) + +// ListApprovalRuleTemplatesPaginatorOptions is the paginator options for +// ListApprovalRuleTemplates +type ListApprovalRuleTemplatesPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + 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 +} + +// ListApprovalRuleTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListApprovalRuleTemplates +type ListApprovalRuleTemplatesPaginator struct { + options ListApprovalRuleTemplatesPaginatorOptions + client ListApprovalRuleTemplatesAPIClient + params *ListApprovalRuleTemplatesInput + nextToken *string + firstPage bool +} + +// NewListApprovalRuleTemplatesPaginator returns a new +// ListApprovalRuleTemplatesPaginator +func NewListApprovalRuleTemplatesPaginator(client ListApprovalRuleTemplatesAPIClient, params *ListApprovalRuleTemplatesInput, optFns ...func(*ListApprovalRuleTemplatesPaginatorOptions)) *ListApprovalRuleTemplatesPaginator { + options := ListApprovalRuleTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApprovalRuleTemplatesInput{} + } + + return &ListApprovalRuleTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApprovalRuleTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApprovalRuleTemplates page. +func (p *ListApprovalRuleTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApprovalRuleTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListApprovalRuleTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApprovalRuleTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go b/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go index 7b2d6250ede..a05fb22c438 100644 --- a/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go +++ b/service/codecommit/api_op_ListAssociatedApprovalRuleTemplatesForRepository.go @@ -4,6 +4,7 @@ package codecommit 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/awslabs/smithy-go/middleware" @@ -116,6 +117,90 @@ func addOperationListAssociatedApprovalRuleTemplatesForRepositoryMiddlewares(sta return nil } +// ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient is a client that +// implements the ListAssociatedApprovalRuleTemplatesForRepository operation. +type ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient interface { + ListAssociatedApprovalRuleTemplatesForRepository(context.Context, *ListAssociatedApprovalRuleTemplatesForRepositoryInput, ...func(*Options)) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) +} + +var _ ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient = (*Client)(nil) + +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions is the +// paginator options for ListAssociatedApprovalRuleTemplatesForRepository +type ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + 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 +} + +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListAssociatedApprovalRuleTemplatesForRepository +type ListAssociatedApprovalRuleTemplatesForRepositoryPaginator struct { + options ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions + client ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient + params *ListAssociatedApprovalRuleTemplatesForRepositoryInput + nextToken *string + firstPage bool +} + +// NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator returns a new +// ListAssociatedApprovalRuleTemplatesForRepositoryPaginator +func NewListAssociatedApprovalRuleTemplatesForRepositoryPaginator(client ListAssociatedApprovalRuleTemplatesForRepositoryAPIClient, params *ListAssociatedApprovalRuleTemplatesForRepositoryInput, optFns ...func(*ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions)) *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator { + options := ListAssociatedApprovalRuleTemplatesForRepositoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociatedApprovalRuleTemplatesForRepositoryInput{} + } + + return &ListAssociatedApprovalRuleTemplatesForRepositoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssociatedApprovalRuleTemplatesForRepository +// page. +func (p *ListAssociatedApprovalRuleTemplatesForRepositoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssociatedApprovalRuleTemplatesForRepository(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociatedApprovalRuleTemplatesForRepository(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListBranches.go b/service/codecommit/api_op_ListBranches.go index 77d508940a0..eb6eba73d0c 100644 --- a/service/codecommit/api_op_ListBranches.go +++ b/service/codecommit/api_op_ListBranches.go @@ -4,6 +4,7 @@ package codecommit 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/awslabs/smithy-go/middleware" @@ -111,6 +112,79 @@ func addOperationListBranchesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListBranchesAPIClient is a client that implements the ListBranches operation. +type ListBranchesAPIClient interface { + ListBranches(context.Context, *ListBranchesInput, ...func(*Options)) (*ListBranchesOutput, error) +} + +var _ ListBranchesAPIClient = (*Client)(nil) + +// ListBranchesPaginatorOptions is the paginator options for ListBranches +type ListBranchesPaginatorOptions struct { + // 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 +} + +// ListBranchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListBranches +type ListBranchesPaginator struct { + options ListBranchesPaginatorOptions + client ListBranchesAPIClient + params *ListBranchesInput + nextToken *string + firstPage bool +} + +// NewListBranchesPaginator returns a new ListBranchesPaginator +func NewListBranchesPaginator(client ListBranchesAPIClient, params *ListBranchesInput, optFns ...func(*ListBranchesPaginatorOptions)) *ListBranchesPaginator { + options := ListBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBranchesInput{} + } + + return &ListBranchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBranchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBranches page. +func (p *ListBranchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBranchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListBranches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBranches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListPullRequests.go b/service/codecommit/api_op_ListPullRequests.go index ac9d7636e58..6aaaa019ef9 100644 --- a/service/codecommit/api_op_ListPullRequests.go +++ b/service/codecommit/api_op_ListPullRequests.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -127,6 +128,87 @@ func addOperationListPullRequestsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListPullRequestsAPIClient is a client that implements the ListPullRequests +// operation. +type ListPullRequestsAPIClient interface { + ListPullRequests(context.Context, *ListPullRequestsInput, ...func(*Options)) (*ListPullRequestsOutput, error) +} + +var _ ListPullRequestsAPIClient = (*Client)(nil) + +// ListPullRequestsPaginatorOptions is the paginator options for ListPullRequests +type ListPullRequestsPaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + 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 +} + +// ListPullRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListPullRequests +type ListPullRequestsPaginator struct { + options ListPullRequestsPaginatorOptions + client ListPullRequestsAPIClient + params *ListPullRequestsInput + nextToken *string + firstPage bool +} + +// NewListPullRequestsPaginator returns a new ListPullRequestsPaginator +func NewListPullRequestsPaginator(client ListPullRequestsAPIClient, params *ListPullRequestsInput, optFns ...func(*ListPullRequestsPaginatorOptions)) *ListPullRequestsPaginator { + options := ListPullRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPullRequestsInput{} + } + + return &ListPullRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPullRequestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPullRequests page. +func (p *ListPullRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPullRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPullRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPullRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListRepositories.go b/service/codecommit/api_op_ListRepositories.go index 624e2b4ffc0..4948be1ebec 100644 --- a/service/codecommit/api_op_ListRepositories.go +++ b/service/codecommit/api_op_ListRepositories.go @@ -4,6 +4,7 @@ package codecommit 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/codecommit/types" @@ -116,6 +117,80 @@ func addOperationListRepositoriesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListRepositoriesAPIClient is a client that implements the ListRepositories +// operation. +type ListRepositoriesAPIClient interface { + ListRepositories(context.Context, *ListRepositoriesInput, ...func(*Options)) (*ListRepositoriesOutput, error) +} + +var _ ListRepositoriesAPIClient = (*Client)(nil) + +// ListRepositoriesPaginatorOptions is the paginator options for ListRepositories +type ListRepositoriesPaginatorOptions struct { + // 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 +} + +// ListRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListRepositories +type ListRepositoriesPaginator struct { + options ListRepositoriesPaginatorOptions + client ListRepositoriesAPIClient + params *ListRepositoriesInput + nextToken *string + firstPage bool +} + +// NewListRepositoriesPaginator returns a new ListRepositoriesPaginator +func NewListRepositoriesPaginator(client ListRepositoriesAPIClient, params *ListRepositoriesInput, optFns ...func(*ListRepositoriesPaginatorOptions)) *ListRepositoriesPaginator { + options := ListRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesInput{} + } + + return &ListRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRepositories page. +func (p *ListRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go b/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go index 16e9ae8de88..a6659abe8ea 100644 --- a/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go +++ b/service/codecommit/api_op_ListRepositoriesForApprovalRuleTemplate.go @@ -4,6 +4,7 @@ package codecommit 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/awslabs/smithy-go/middleware" @@ -116,6 +117,89 @@ func addOperationListRepositoriesForApprovalRuleTemplateMiddlewares(stack *middl return nil } +// ListRepositoriesForApprovalRuleTemplateAPIClient is a client that implements the +// ListRepositoriesForApprovalRuleTemplate operation. +type ListRepositoriesForApprovalRuleTemplateAPIClient interface { + ListRepositoriesForApprovalRuleTemplate(context.Context, *ListRepositoriesForApprovalRuleTemplateInput, ...func(*Options)) (*ListRepositoriesForApprovalRuleTemplateOutput, error) +} + +var _ ListRepositoriesForApprovalRuleTemplateAPIClient = (*Client)(nil) + +// ListRepositoriesForApprovalRuleTemplatePaginatorOptions is the paginator options +// for ListRepositoriesForApprovalRuleTemplate +type ListRepositoriesForApprovalRuleTemplatePaginatorOptions struct { + // A non-zero, non-negative integer used to limit the number of returned results. + 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 +} + +// ListRepositoriesForApprovalRuleTemplatePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codecommit.ListRepositoriesForApprovalRuleTemplate +type ListRepositoriesForApprovalRuleTemplatePaginator struct { + options ListRepositoriesForApprovalRuleTemplatePaginatorOptions + client ListRepositoriesForApprovalRuleTemplateAPIClient + params *ListRepositoriesForApprovalRuleTemplateInput + nextToken *string + firstPage bool +} + +// NewListRepositoriesForApprovalRuleTemplatePaginator returns a new +// ListRepositoriesForApprovalRuleTemplatePaginator +func NewListRepositoriesForApprovalRuleTemplatePaginator(client ListRepositoriesForApprovalRuleTemplateAPIClient, params *ListRepositoriesForApprovalRuleTemplateInput, optFns ...func(*ListRepositoriesForApprovalRuleTemplatePaginatorOptions)) *ListRepositoriesForApprovalRuleTemplatePaginator { + options := ListRepositoriesForApprovalRuleTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoriesForApprovalRuleTemplateInput{} + } + + return &ListRepositoriesForApprovalRuleTemplatePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoriesForApprovalRuleTemplatePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRepositoriesForApprovalRuleTemplate page. +func (p *ListRepositoriesForApprovalRuleTemplatePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoriesForApprovalRuleTemplateOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRepositoriesForApprovalRuleTemplate(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoriesForApprovalRuleTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codecommit/endpoints.go b/service/codecommit/endpoints.go index da7fded0e5c..d05e3deb354 100644 --- a/service/codecommit/endpoints.go +++ b/service/codecommit/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codedeploy/api_op_ListApplicationRevisions.go b/service/codedeploy/api_op_ListApplicationRevisions.go index 72025d60561..a34c3ffe274 100644 --- a/service/codedeploy/api_op_ListApplicationRevisions.go +++ b/service/codedeploy/api_op_ListApplicationRevisions.go @@ -4,6 +4,7 @@ package codedeploy 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/codedeploy/types" @@ -161,6 +162,82 @@ func addOperationListApplicationRevisionsMiddlewares(stack *middleware.Stack, op return nil } +// ListApplicationRevisionsAPIClient is a client that implements the +// ListApplicationRevisions operation. +type ListApplicationRevisionsAPIClient interface { + ListApplicationRevisions(context.Context, *ListApplicationRevisionsInput, ...func(*Options)) (*ListApplicationRevisionsOutput, error) +} + +var _ ListApplicationRevisionsAPIClient = (*Client)(nil) + +// ListApplicationRevisionsPaginatorOptions is the paginator options for +// ListApplicationRevisions +type ListApplicationRevisionsPaginatorOptions struct { + // 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 +} + +// ListApplicationRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListApplicationRevisions +type ListApplicationRevisionsPaginator struct { + options ListApplicationRevisionsPaginatorOptions + client ListApplicationRevisionsAPIClient + params *ListApplicationRevisionsInput + nextToken *string + firstPage bool +} + +// NewListApplicationRevisionsPaginator returns a new +// ListApplicationRevisionsPaginator +func NewListApplicationRevisionsPaginator(client ListApplicationRevisionsAPIClient, params *ListApplicationRevisionsInput, optFns ...func(*ListApplicationRevisionsPaginatorOptions)) *ListApplicationRevisionsPaginator { + options := ListApplicationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationRevisionsInput{} + } + + return &ListApplicationRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationRevisionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplicationRevisions page. +func (p *ListApplicationRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListApplicationRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListApplications.go b/service/codedeploy/api_op_ListApplications.go index df893fa671b..5e826d3b764 100644 --- a/service/codedeploy/api_op_ListApplications.go +++ b/service/codedeploy/api_op_ListApplications.go @@ -4,6 +4,7 @@ package codedeploy 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/awslabs/smithy-go/middleware" @@ -106,6 +107,80 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // 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 +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentConfigs.go b/service/codedeploy/api_op_ListDeploymentConfigs.go index 7b014a7ab96..578bbcc5bc9 100644 --- a/service/codedeploy/api_op_ListDeploymentConfigs.go +++ b/service/codedeploy/api_op_ListDeploymentConfigs.go @@ -4,6 +4,7 @@ package codedeploy 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/awslabs/smithy-go/middleware" @@ -107,6 +108,81 @@ func addOperationListDeploymentConfigsMiddlewares(stack *middleware.Stack, optio return nil } +// ListDeploymentConfigsAPIClient is a client that implements the +// ListDeploymentConfigs operation. +type ListDeploymentConfigsAPIClient interface { + ListDeploymentConfigs(context.Context, *ListDeploymentConfigsInput, ...func(*Options)) (*ListDeploymentConfigsOutput, error) +} + +var _ ListDeploymentConfigsAPIClient = (*Client)(nil) + +// ListDeploymentConfigsPaginatorOptions is the paginator options for +// ListDeploymentConfigs +type ListDeploymentConfigsPaginatorOptions struct { + // 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 +} + +// ListDeploymentConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentConfigs +type ListDeploymentConfigsPaginator struct { + options ListDeploymentConfigsPaginatorOptions + client ListDeploymentConfigsAPIClient + params *ListDeploymentConfigsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentConfigsPaginator returns a new ListDeploymentConfigsPaginator +func NewListDeploymentConfigsPaginator(client ListDeploymentConfigsAPIClient, params *ListDeploymentConfigsInput, optFns ...func(*ListDeploymentConfigsPaginatorOptions)) *ListDeploymentConfigsPaginator { + options := ListDeploymentConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentConfigsInput{} + } + + return &ListDeploymentConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeploymentConfigs page. +func (p *ListDeploymentConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentGroups.go b/service/codedeploy/api_op_ListDeploymentGroups.go index 67946badd21..c4b3e536e7d 100644 --- a/service/codedeploy/api_op_ListDeploymentGroups.go +++ b/service/codedeploy/api_op_ListDeploymentGroups.go @@ -4,6 +4,7 @@ package codedeploy 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/awslabs/smithy-go/middleware" @@ -119,6 +120,81 @@ func addOperationListDeploymentGroupsMiddlewares(stack *middleware.Stack, option return nil } +// ListDeploymentGroupsAPIClient is a client that implements the +// ListDeploymentGroups operation. +type ListDeploymentGroupsAPIClient interface { + ListDeploymentGroups(context.Context, *ListDeploymentGroupsInput, ...func(*Options)) (*ListDeploymentGroupsOutput, error) +} + +var _ ListDeploymentGroupsAPIClient = (*Client)(nil) + +// ListDeploymentGroupsPaginatorOptions is the paginator options for +// ListDeploymentGroups +type ListDeploymentGroupsPaginatorOptions struct { + // 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 +} + +// ListDeploymentGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentGroups +type ListDeploymentGroupsPaginator struct { + options ListDeploymentGroupsPaginatorOptions + client ListDeploymentGroupsAPIClient + params *ListDeploymentGroupsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentGroupsPaginator returns a new ListDeploymentGroupsPaginator +func NewListDeploymentGroupsPaginator(client ListDeploymentGroupsAPIClient, params *ListDeploymentGroupsInput, optFns ...func(*ListDeploymentGroupsPaginatorOptions)) *ListDeploymentGroupsPaginator { + options := ListDeploymentGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentGroupsInput{} + } + + return &ListDeploymentGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeploymentGroups page. +func (p *ListDeploymentGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeploymentInstances.go b/service/codedeploy/api_op_ListDeploymentInstances.go index 3118f8fcd1d..43c1cfb9c52 100644 --- a/service/codedeploy/api_op_ListDeploymentInstances.go +++ b/service/codedeploy/api_op_ListDeploymentInstances.go @@ -4,6 +4,7 @@ package codedeploy 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/codedeploy/types" @@ -143,6 +144,82 @@ func addOperationListDeploymentInstancesMiddlewares(stack *middleware.Stack, opt return nil } +// ListDeploymentInstancesAPIClient is a client that implements the +// ListDeploymentInstances operation. +type ListDeploymentInstancesAPIClient interface { + ListDeploymentInstances(context.Context, *ListDeploymentInstancesInput, ...func(*Options)) (*ListDeploymentInstancesOutput, error) +} + +var _ ListDeploymentInstancesAPIClient = (*Client)(nil) + +// ListDeploymentInstancesPaginatorOptions is the paginator options for +// ListDeploymentInstances +type ListDeploymentInstancesPaginatorOptions struct { + // 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 +} + +// ListDeploymentInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeploymentInstances +type ListDeploymentInstancesPaginator struct { + options ListDeploymentInstancesPaginatorOptions + client ListDeploymentInstancesAPIClient + params *ListDeploymentInstancesInput + nextToken *string + firstPage bool +} + +// NewListDeploymentInstancesPaginator returns a new +// ListDeploymentInstancesPaginator +func NewListDeploymentInstancesPaginator(client ListDeploymentInstancesAPIClient, params *ListDeploymentInstancesInput, optFns ...func(*ListDeploymentInstancesPaginatorOptions)) *ListDeploymentInstancesPaginator { + options := ListDeploymentInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentInstancesInput{} + } + + return &ListDeploymentInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeploymentInstances page. +func (p *ListDeploymentInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeploymentInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/api_op_ListDeployments.go b/service/codedeploy/api_op_ListDeployments.go index 0a2b5322aaa..b3cc9bf9af1 100644 --- a/service/codedeploy/api_op_ListDeployments.go +++ b/service/codedeploy/api_op_ListDeployments.go @@ -4,6 +4,7 @@ package codedeploy 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/codedeploy/types" @@ -146,6 +147,80 @@ func addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDeploymentsAPIClient is a client that implements the ListDeployments +// operation. +type ListDeploymentsAPIClient interface { + ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) +} + +var _ ListDeploymentsAPIClient = (*Client)(nil) + +// ListDeploymentsPaginatorOptions is the paginator options for ListDeployments +type ListDeploymentsPaginatorOptions struct { + // 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 +} + +// ListDeploymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codedeploy.ListDeployments +type ListDeploymentsPaginator struct { + options ListDeploymentsPaginatorOptions + client ListDeploymentsAPIClient + params *ListDeploymentsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentsInput{} + } + + return &ListDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeployments page. +func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codedeploy/endpoints.go b/service/codedeploy/endpoints.go index 05966e0d158..91dcfe2bfe8 100644 --- a/service/codedeploy/endpoints.go +++ b/service/codedeploy/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codeguruprofiler/api_op_ListProfileTimes.go b/service/codeguruprofiler/api_op_ListProfileTimes.go index b49255f4173..1cbde787026 100644 --- a/service/codeguruprofiler/api_op_ListProfileTimes.go +++ b/service/codeguruprofiler/api_op_ListProfileTimes.go @@ -4,6 +4,7 @@ package codeguruprofiler 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/codeguruprofiler/types" @@ -147,3 +148,88 @@ func addOperationListProfileTimesMiddlewares(stack *middleware.Stack, options Op } return nil } + +// ListProfileTimesAPIClient is a client that implements the ListProfileTimes +// operation. +type ListProfileTimesAPIClient interface { + ListProfileTimes(context.Context, *ListProfileTimesInput, ...func(*Options)) (*ListProfileTimesOutput, error) +} + +var _ ListProfileTimesAPIClient = (*Client)(nil) + +// ListProfileTimesPaginatorOptions is the paginator options for ListProfileTimes +type ListProfileTimesPaginatorOptions struct { + // The maximum number of profile time results returned by ListProfileTimes in + // paginated output. When this parameter is used, ListProfileTimes only returns + // maxResults results in a single page with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListProfileTimes request with the returned nextToken value. + 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 +} + +// ListProfileTimesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeguruprofiler.ListProfileTimes +type ListProfileTimesPaginator struct { + options ListProfileTimesPaginatorOptions + client ListProfileTimesAPIClient + params *ListProfileTimesInput + nextToken *string + firstPage bool +} + +// NewListProfileTimesPaginator returns a new ListProfileTimesPaginator +func NewListProfileTimesPaginator(client ListProfileTimesAPIClient, params *ListProfileTimesInput, optFns ...func(*ListProfileTimesPaginatorOptions)) *ListProfileTimesPaginator { + options := ListProfileTimesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProfileTimesInput{} + } + + return &ListProfileTimesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfileTimesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProfileTimes page. +func (p *ListProfileTimesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfileTimesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProfileTimes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/codeguruprofiler/api_op_ListProfilingGroups.go b/service/codeguruprofiler/api_op_ListProfilingGroups.go index 44f93bf5e1e..542f509f3de 100644 --- a/service/codeguruprofiler/api_op_ListProfilingGroups.go +++ b/service/codeguruprofiler/api_op_ListProfilingGroups.go @@ -4,6 +4,7 @@ package codeguruprofiler 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/codeguruprofiler/types" @@ -123,3 +124,89 @@ func addOperationListProfilingGroupsMiddlewares(stack *middleware.Stack, options } return nil } + +// ListProfilingGroupsAPIClient is a client that implements the ListProfilingGroups +// operation. +type ListProfilingGroupsAPIClient interface { + ListProfilingGroups(context.Context, *ListProfilingGroupsInput, ...func(*Options)) (*ListProfilingGroupsOutput, error) +} + +var _ ListProfilingGroupsAPIClient = (*Client)(nil) + +// ListProfilingGroupsPaginatorOptions is the paginator options for +// ListProfilingGroups +type ListProfilingGroupsPaginatorOptions struct { + // The maximum number of profiling groups results returned by ListProfilingGroups + // in paginated output. When this parameter is used, ListProfilingGroups only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another ListProfilingGroups request with the returned nextToken value. + 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 +} + +// ListProfilingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codeguruprofiler.ListProfilingGroups +type ListProfilingGroupsPaginator struct { + options ListProfilingGroupsPaginatorOptions + client ListProfilingGroupsAPIClient + params *ListProfilingGroupsInput + nextToken *string + firstPage bool +} + +// NewListProfilingGroupsPaginator returns a new ListProfilingGroupsPaginator +func NewListProfilingGroupsPaginator(client ListProfilingGroupsAPIClient, params *ListProfilingGroupsInput, optFns ...func(*ListProfilingGroupsPaginatorOptions)) *ListProfilingGroupsPaginator { + options := ListProfilingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProfilingGroupsInput{} + } + + return &ListProfilingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProfilingGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProfilingGroups page. +func (p *ListProfilingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProfilingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProfilingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/codeguruprofiler/endpoints.go b/service/codeguruprofiler/endpoints.go index d29927fa6a9..6d30e6eae3c 100644 --- a/service/codeguruprofiler/endpoints.go +++ b/service/codeguruprofiler/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codegurureviewer/api_op_ListCodeReviews.go b/service/codegurureviewer/api_op_ListCodeReviews.go index 658270508b9..12580ffb26d 100644 --- a/service/codegurureviewer/api_op_ListCodeReviews.go +++ b/service/codegurureviewer/api_op_ListCodeReviews.go @@ -4,6 +4,7 @@ package codegurureviewer 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/codegurureviewer/types" @@ -139,6 +140,87 @@ func addOperationListCodeReviewsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListCodeReviewsAPIClient is a client that implements the ListCodeReviews +// operation. +type ListCodeReviewsAPIClient interface { + ListCodeReviews(context.Context, *ListCodeReviewsInput, ...func(*Options)) (*ListCodeReviewsOutput, error) +} + +var _ ListCodeReviewsAPIClient = (*Client)(nil) + +// ListCodeReviewsPaginatorOptions is the paginator options for ListCodeReviews +type ListCodeReviewsPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + 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 +} + +// ListCodeReviewsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListCodeReviews +type ListCodeReviewsPaginator struct { + options ListCodeReviewsPaginatorOptions + client ListCodeReviewsAPIClient + params *ListCodeReviewsInput + nextToken *string + firstPage bool +} + +// NewListCodeReviewsPaginator returns a new ListCodeReviewsPaginator +func NewListCodeReviewsPaginator(client ListCodeReviewsAPIClient, params *ListCodeReviewsInput, optFns ...func(*ListCodeReviewsPaginatorOptions)) *ListCodeReviewsPaginator { + options := ListCodeReviewsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCodeReviewsInput{} + } + + return &ListCodeReviewsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCodeReviewsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCodeReviews page. +func (p *ListCodeReviewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCodeReviewsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCodeReviews(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCodeReviews(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRecommendationFeedback.go b/service/codegurureviewer/api_op_ListRecommendationFeedback.go index 81f711ef306..e653d3a6001 100644 --- a/service/codegurureviewer/api_op_ListRecommendationFeedback.go +++ b/service/codegurureviewer/api_op_ListRecommendationFeedback.go @@ -4,6 +4,7 @@ package codegurureviewer 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/codegurureviewer/types" @@ -135,6 +136,89 @@ func addOperationListRecommendationFeedbackMiddlewares(stack *middleware.Stack, return nil } +// ListRecommendationFeedbackAPIClient is a client that implements the +// ListRecommendationFeedback operation. +type ListRecommendationFeedbackAPIClient interface { + ListRecommendationFeedback(context.Context, *ListRecommendationFeedbackInput, ...func(*Options)) (*ListRecommendationFeedbackOutput, error) +} + +var _ ListRecommendationFeedbackAPIClient = (*Client)(nil) + +// ListRecommendationFeedbackPaginatorOptions is the paginator options for +// ListRecommendationFeedback +type ListRecommendationFeedbackPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + 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 +} + +// ListRecommendationFeedbackPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRecommendationFeedback +type ListRecommendationFeedbackPaginator struct { + options ListRecommendationFeedbackPaginatorOptions + client ListRecommendationFeedbackAPIClient + params *ListRecommendationFeedbackInput + nextToken *string + firstPage bool +} + +// NewListRecommendationFeedbackPaginator returns a new +// ListRecommendationFeedbackPaginator +func NewListRecommendationFeedbackPaginator(client ListRecommendationFeedbackAPIClient, params *ListRecommendationFeedbackInput, optFns ...func(*ListRecommendationFeedbackPaginatorOptions)) *ListRecommendationFeedbackPaginator { + options := ListRecommendationFeedbackPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecommendationFeedbackInput{} + } + + return &ListRecommendationFeedbackPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationFeedbackPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRecommendationFeedback page. +func (p *ListRecommendationFeedbackPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationFeedbackOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRecommendationFeedback(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecommendationFeedback(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRecommendations.go b/service/codegurureviewer/api_op_ListRecommendations.go index 64bba774b1b..177061b4201 100644 --- a/service/codegurureviewer/api_op_ListRecommendations.go +++ b/service/codegurureviewer/api_op_ListRecommendations.go @@ -4,6 +4,7 @@ package codegurureviewer 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/codegurureviewer/types" @@ -115,6 +116,88 @@ func addOperationListRecommendationsMiddlewares(stack *middleware.Stack, options return nil } +// ListRecommendationsAPIClient is a client that implements the ListRecommendations +// operation. +type ListRecommendationsAPIClient interface { + ListRecommendations(context.Context, *ListRecommendationsInput, ...func(*Options)) (*ListRecommendationsOutput, error) +} + +var _ ListRecommendationsAPIClient = (*Client)(nil) + +// ListRecommendationsPaginatorOptions is the paginator options for +// ListRecommendations +type ListRecommendationsPaginatorOptions struct { + // The maximum number of results that are returned per call. The default is 100. + 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 +} + +// ListRecommendationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRecommendations +type ListRecommendationsPaginator struct { + options ListRecommendationsPaginatorOptions + client ListRecommendationsAPIClient + params *ListRecommendationsInput + nextToken *string + firstPage bool +} + +// NewListRecommendationsPaginator returns a new ListRecommendationsPaginator +func NewListRecommendationsPaginator(client ListRecommendationsAPIClient, params *ListRecommendationsInput, optFns ...func(*ListRecommendationsPaginatorOptions)) *ListRecommendationsPaginator { + options := ListRecommendationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecommendationsInput{} + } + + return &ListRecommendationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecommendationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRecommendations page. +func (p *ListRecommendationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecommendationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRecommendations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecommendations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/api_op_ListRepositoryAssociations.go b/service/codegurureviewer/api_op_ListRepositoryAssociations.go index c6feda31615..d42a306a331 100644 --- a/service/codegurureviewer/api_op_ListRepositoryAssociations.go +++ b/service/codegurureviewer/api_op_ListRepositoryAssociations.go @@ -4,6 +4,7 @@ package codegurureviewer 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/codegurureviewer/types" @@ -168,6 +169,96 @@ func addOperationListRepositoryAssociationsMiddlewares(stack *middleware.Stack, return nil } +// ListRepositoryAssociationsAPIClient is a client that implements the +// ListRepositoryAssociations operation. +type ListRepositoryAssociationsAPIClient interface { + ListRepositoryAssociations(context.Context, *ListRepositoryAssociationsInput, ...func(*Options)) (*ListRepositoryAssociationsOutput, error) +} + +var _ ListRepositoryAssociationsAPIClient = (*Client)(nil) + +// ListRepositoryAssociationsPaginatorOptions is the paginator options for +// ListRepositoryAssociations +type ListRepositoryAssociationsPaginatorOptions struct { + // The maximum number of repository association results returned by + // ListRepositoryAssociations in paginated output. When this parameter is used, + // ListRepositoryAssociations only returns maxResults results in a single page with + // a nextToken response element. The remaining results of the initial request can + // be seen by sending another ListRepositoryAssociations request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, ListRepositoryAssociations returns up to 100 results and a nextToken value + // if applicable. + 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 +} + +// ListRepositoryAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codegurureviewer.ListRepositoryAssociations +type ListRepositoryAssociationsPaginator struct { + options ListRepositoryAssociationsPaginatorOptions + client ListRepositoryAssociationsAPIClient + params *ListRepositoryAssociationsInput + nextToken *string + firstPage bool +} + +// NewListRepositoryAssociationsPaginator returns a new +// ListRepositoryAssociationsPaginator +func NewListRepositoryAssociationsPaginator(client ListRepositoryAssociationsAPIClient, params *ListRepositoryAssociationsInput, optFns ...func(*ListRepositoryAssociationsPaginatorOptions)) *ListRepositoryAssociationsPaginator { + options := ListRepositoryAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRepositoryAssociationsInput{} + } + + return &ListRepositoryAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRepositoryAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRepositoryAssociations page. +func (p *ListRepositoryAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRepositoryAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRepositoryAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRepositoryAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codegurureviewer/endpoints.go b/service/codegurureviewer/endpoints.go index c716e9ceccc..587a8446c39 100644 --- a/service/codegurureviewer/endpoints.go +++ b/service/codegurureviewer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codepipeline/api_op_ListActionExecutions.go b/service/codepipeline/api_op_ListActionExecutions.go index 1d6d0ef1b74..3cce4297785 100644 --- a/service/codepipeline/api_op_ListActionExecutions.go +++ b/service/codepipeline/api_op_ListActionExecutions.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -123,6 +124,92 @@ func addOperationListActionExecutionsMiddlewares(stack *middleware.Stack, option return nil } +// ListActionExecutionsAPIClient is a client that implements the +// ListActionExecutions operation. +type ListActionExecutionsAPIClient interface { + ListActionExecutions(context.Context, *ListActionExecutionsInput, ...func(*Options)) (*ListActionExecutionsOutput, error) +} + +var _ ListActionExecutionsAPIClient = (*Client)(nil) + +// ListActionExecutionsPaginatorOptions is the paginator options for +// ListActionExecutions +type ListActionExecutionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Action + // execution history is retained for up to 12 months, based on action execution + // start times. Default value is 100. Detailed execution history is available for + // executions run on or after February 21, 2019. + 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 +} + +// ListActionExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListActionExecutions +type ListActionExecutionsPaginator struct { + options ListActionExecutionsPaginatorOptions + client ListActionExecutionsAPIClient + params *ListActionExecutionsInput + nextToken *string + firstPage bool +} + +// NewListActionExecutionsPaginator returns a new ListActionExecutionsPaginator +func NewListActionExecutionsPaginator(client ListActionExecutionsAPIClient, params *ListActionExecutionsInput, optFns ...func(*ListActionExecutionsPaginatorOptions)) *ListActionExecutionsPaginator { + options := ListActionExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActionExecutionsInput{} + } + + return &ListActionExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActionExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListActionExecutions page. +func (p *ListActionExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActionExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListActionExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActionExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListActionTypes.go b/service/codepipeline/api_op_ListActionTypes.go index 92f89d8d7bb..a086215b86a 100644 --- a/service/codepipeline/api_op_ListActionTypes.go +++ b/service/codepipeline/api_op_ListActionTypes.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -113,6 +114,80 @@ func addOperationListActionTypesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListActionTypesAPIClient is a client that implements the ListActionTypes +// operation. +type ListActionTypesAPIClient interface { + ListActionTypes(context.Context, *ListActionTypesInput, ...func(*Options)) (*ListActionTypesOutput, error) +} + +var _ ListActionTypesAPIClient = (*Client)(nil) + +// ListActionTypesPaginatorOptions is the paginator options for ListActionTypes +type ListActionTypesPaginatorOptions struct { + // 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 +} + +// ListActionTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListActionTypes +type ListActionTypesPaginator struct { + options ListActionTypesPaginatorOptions + client ListActionTypesAPIClient + params *ListActionTypesInput + nextToken *string + firstPage bool +} + +// NewListActionTypesPaginator returns a new ListActionTypesPaginator +func NewListActionTypesPaginator(client ListActionTypesAPIClient, params *ListActionTypesInput, optFns ...func(*ListActionTypesPaginatorOptions)) *ListActionTypesPaginator { + options := ListActionTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActionTypesInput{} + } + + return &ListActionTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActionTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListActionTypes page. +func (p *ListActionTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActionTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListActionTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActionTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListPipelineExecutions.go b/service/codepipeline/api_op_ListPipelineExecutions.go index 88a9228030e..ef2f1e74f96 100644 --- a/service/codepipeline/api_op_ListPipelineExecutions.go +++ b/service/codepipeline/api_op_ListPipelineExecutions.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -122,6 +123,91 @@ func addOperationListPipelineExecutionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListPipelineExecutionsAPIClient is a client that implements the +// ListPipelineExecutions operation. +type ListPipelineExecutionsAPIClient interface { + ListPipelineExecutions(context.Context, *ListPipelineExecutionsInput, ...func(*Options)) (*ListPipelineExecutionsOutput, error) +} + +var _ ListPipelineExecutionsAPIClient = (*Client)(nil) + +// ListPipelineExecutionsPaginatorOptions is the paginator options for +// ListPipelineExecutions +type ListPipelineExecutionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Pipeline + // history is limited to the most recent 12 months, based on pipeline execution + // start times. Default value is 100. + 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 +} + +// ListPipelineExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListPipelineExecutions +type ListPipelineExecutionsPaginator struct { + options ListPipelineExecutionsPaginatorOptions + client ListPipelineExecutionsAPIClient + params *ListPipelineExecutionsInput + nextToken *string + firstPage bool +} + +// NewListPipelineExecutionsPaginator returns a new ListPipelineExecutionsPaginator +func NewListPipelineExecutionsPaginator(client ListPipelineExecutionsAPIClient, params *ListPipelineExecutionsInput, optFns ...func(*ListPipelineExecutionsPaginatorOptions)) *ListPipelineExecutionsPaginator { + options := ListPipelineExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelineExecutionsInput{} + } + + return &ListPipelineExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelineExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPipelineExecutions page. +func (p *ListPipelineExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelineExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPipelineExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelineExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListPipelines.go b/service/codepipeline/api_op_ListPipelines.go index 09c61a571ae..2ab9f8311c9 100644 --- a/service/codepipeline/api_op_ListPipelines.go +++ b/service/codepipeline/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -107,6 +108,79 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // 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 +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListTagsForResource.go b/service/codepipeline/api_op_ListTagsForResource.go index c47e2dcd893..03b755b5230 100644 --- a/service/codepipeline/api_op_ListTagsForResource.go +++ b/service/codepipeline/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -118,6 +119,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/api_op_ListWebhooks.go b/service/codepipeline/api_op_ListWebhooks.go index 87cc00f6fa1..a7522a82326 100644 --- a/service/codepipeline/api_op_ListWebhooks.go +++ b/service/codepipeline/api_op_ListWebhooks.go @@ -4,6 +4,7 @@ package codepipeline 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/codepipeline/types" @@ -112,6 +113,87 @@ func addOperationListWebhooksMiddlewares(stack *middleware.Stack, options Option return nil } +// ListWebhooksAPIClient is a client that implements the ListWebhooks operation. +type ListWebhooksAPIClient interface { + ListWebhooks(context.Context, *ListWebhooksInput, ...func(*Options)) (*ListWebhooksOutput, error) +} + +var _ ListWebhooksAPIClient = (*Client)(nil) + +// ListWebhooksPaginatorOptions is the paginator options for ListWebhooks +type ListWebhooksPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListWebhooksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codepipeline.ListWebhooks +type ListWebhooksPaginator struct { + options ListWebhooksPaginatorOptions + client ListWebhooksAPIClient + params *ListWebhooksInput + nextToken *string + firstPage bool +} + +// NewListWebhooksPaginator returns a new ListWebhooksPaginator +func NewListWebhooksPaginator(client ListWebhooksAPIClient, params *ListWebhooksInput, optFns ...func(*ListWebhooksPaginatorOptions)) *ListWebhooksPaginator { + options := ListWebhooksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebhooksInput{} + } + + return &ListWebhooksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebhooksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWebhooks page. +func (p *ListWebhooksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebhooksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWebhooks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebhooks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codepipeline/endpoints.go b/service/codepipeline/endpoints.go index 6eaa7f2bb62..7a7c0358ab2 100644 --- a/service/codepipeline/endpoints.go +++ b/service/codepipeline/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codestar/endpoints.go b/service/codestar/endpoints.go index d6e4d664b99..71bb6b1baf2 100644 --- a/service/codestar/endpoints.go +++ b/service/codestar/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codestarconnections/api_op_ListConnections.go b/service/codestarconnections/api_op_ListConnections.go index 041286ae451..50d3a512804 100644 --- a/service/codestarconnections/api_op_ListConnections.go +++ b/service/codestarconnections/api_op_ListConnections.go @@ -4,6 +4,7 @@ package codestarconnections 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/codestarconnections/types" @@ -117,6 +118,88 @@ func addOperationListConnectionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListConnectionsAPIClient is a client that implements the ListConnections +// operation. +type ListConnectionsAPIClient interface { + ListConnections(context.Context, *ListConnectionsInput, ...func(*Options)) (*ListConnectionsOutput, error) +} + +var _ ListConnectionsAPIClient = (*Client)(nil) + +// ListConnectionsPaginatorOptions is the paginator options for ListConnections +type ListConnectionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarconnections.ListConnections +type ListConnectionsPaginator struct { + options ListConnectionsPaginatorOptions + client ListConnectionsAPIClient + params *ListConnectionsInput + nextToken *string + firstPage bool +} + +// NewListConnectionsPaginator returns a new ListConnectionsPaginator +func NewListConnectionsPaginator(client ListConnectionsAPIClient, params *ListConnectionsInput, optFns ...func(*ListConnectionsPaginatorOptions)) *ListConnectionsPaginator { + options := ListConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConnectionsInput{} + } + + return &ListConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConnections page. +func (p *ListConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarconnections/api_op_ListHosts.go b/service/codestarconnections/api_op_ListHosts.go index 71853337892..15234177417 100644 --- a/service/codestarconnections/api_op_ListHosts.go +++ b/service/codestarconnections/api_op_ListHosts.go @@ -4,6 +4,7 @@ package codestarconnections 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/codestarconnections/types" @@ -110,6 +111,87 @@ func addOperationListHostsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListHostsAPIClient is a client that implements the ListHosts operation. +type ListHostsAPIClient interface { + ListHosts(context.Context, *ListHostsInput, ...func(*Options)) (*ListHostsOutput, error) +} + +var _ ListHostsAPIClient = (*Client)(nil) + +// ListHostsPaginatorOptions is the paginator options for ListHosts +type ListHostsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListHostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarconnections.ListHosts +type ListHostsPaginator struct { + options ListHostsPaginatorOptions + client ListHostsAPIClient + params *ListHostsInput + nextToken *string + firstPage bool +} + +// NewListHostsPaginator returns a new ListHostsPaginator +func NewListHostsPaginator(client ListHostsAPIClient, params *ListHostsInput, optFns ...func(*ListHostsPaginatorOptions)) *ListHostsPaginator { + options := ListHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHostsInput{} + } + + return &ListHostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHostsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHosts page. +func (p *ListHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListHosts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHosts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarconnections/endpoints.go b/service/codestarconnections/endpoints.go index d6c3644f112..8b707a4613a 100644 --- a/service/codestarconnections/endpoints.go +++ b/service/codestarconnections/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/codestarnotifications/api_op_ListEventTypes.go b/service/codestarnotifications/api_op_ListEventTypes.go index 7d02afd16a2..86f3252c5c4 100644 --- a/service/codestarnotifications/api_op_ListEventTypes.go +++ b/service/codestarnotifications/api_op_ListEventTypes.go @@ -4,6 +4,7 @@ package codestarnotifications 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/codestarnotifications/types" @@ -116,6 +117,88 @@ func addOperationListEventTypesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListEventTypesAPIClient is a client that implements the ListEventTypes +// operation. +type ListEventTypesAPIClient interface { + ListEventTypes(context.Context, *ListEventTypesInput, ...func(*Options)) (*ListEventTypesOutput, error) +} + +var _ ListEventTypesAPIClient = (*Client)(nil) + +// ListEventTypesPaginatorOptions is the paginator options for ListEventTypes +type ListEventTypesPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The default + // number is 50. The maximum number of results that can be returned is 100. + 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 +} + +// ListEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListEventTypes +type ListEventTypesPaginator struct { + options ListEventTypesPaginatorOptions + client ListEventTypesAPIClient + params *ListEventTypesInput + nextToken *string + firstPage bool +} + +// NewListEventTypesPaginator returns a new ListEventTypesPaginator +func NewListEventTypesPaginator(client ListEventTypesAPIClient, params *ListEventTypesInput, optFns ...func(*ListEventTypesPaginatorOptions)) *ListEventTypesPaginator { + options := ListEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventTypesInput{} + } + + return &ListEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEventTypes page. +func (p *ListEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/api_op_ListNotificationRules.go b/service/codestarnotifications/api_op_ListNotificationRules.go index 9791496babc..ae895f9c3a2 100644 --- a/service/codestarnotifications/api_op_ListNotificationRules.go +++ b/service/codestarnotifications/api_op_ListNotificationRules.go @@ -4,6 +4,7 @@ package codestarnotifications 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/codestarnotifications/types" @@ -118,6 +119,89 @@ func addOperationListNotificationRulesMiddlewares(stack *middleware.Stack, optio return nil } +// ListNotificationRulesAPIClient is a client that implements the +// ListNotificationRules operation. +type ListNotificationRulesAPIClient interface { + ListNotificationRules(context.Context, *ListNotificationRulesInput, ...func(*Options)) (*ListNotificationRulesOutput, error) +} + +var _ ListNotificationRulesAPIClient = (*Client)(nil) + +// ListNotificationRulesPaginatorOptions is the paginator options for +// ListNotificationRules +type ListNotificationRulesPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The maximum + // number of results that can be returned is 100. + 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 +} + +// ListNotificationRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListNotificationRules +type ListNotificationRulesPaginator struct { + options ListNotificationRulesPaginatorOptions + client ListNotificationRulesAPIClient + params *ListNotificationRulesInput + nextToken *string + firstPage bool +} + +// NewListNotificationRulesPaginator returns a new ListNotificationRulesPaginator +func NewListNotificationRulesPaginator(client ListNotificationRulesAPIClient, params *ListNotificationRulesInput, optFns ...func(*ListNotificationRulesPaginatorOptions)) *ListNotificationRulesPaginator { + options := ListNotificationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotificationRulesInput{} + } + + return &ListNotificationRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNotificationRules page. +func (p *ListNotificationRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListNotificationRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotificationRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/api_op_ListTargets.go b/service/codestarnotifications/api_op_ListTargets.go index 099ea6b72d6..dca471bdfed 100644 --- a/service/codestarnotifications/api_op_ListTargets.go +++ b/service/codestarnotifications/api_op_ListTargets.go @@ -4,6 +4,7 @@ package codestarnotifications 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/codestarnotifications/types" @@ -117,6 +118,87 @@ func addOperationListTargetsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListTargetsAPIClient is a client that implements the ListTargets operation. +type ListTargetsAPIClient interface { + ListTargets(context.Context, *ListTargetsInput, ...func(*Options)) (*ListTargetsOutput, error) +} + +var _ ListTargetsAPIClient = (*Client)(nil) + +// ListTargetsPaginatorOptions is the paginator options for ListTargets +type ListTargetsPaginatorOptions struct { + // A non-negative integer used to limit the number of returned results. The maximum + // number of results that can be returned is 100. + 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 +} + +// ListTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/codestarnotifications.ListTargets +type ListTargetsPaginator struct { + options ListTargetsPaginatorOptions + client ListTargetsAPIClient + params *ListTargetsInput + nextToken *string + firstPage bool +} + +// NewListTargetsPaginator returns a new ListTargetsPaginator +func NewListTargetsPaginator(client ListTargetsAPIClient, params *ListTargetsInput, optFns ...func(*ListTargetsPaginatorOptions)) *ListTargetsPaginator { + options := ListTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsInput{} + } + + return &ListTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTargets page. +func (p *ListTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/codestarnotifications/endpoints.go b/service/codestarnotifications/endpoints.go index f97d126edd8..a69508236be 100644 --- a/service/codestarnotifications/endpoints.go +++ b/service/codestarnotifications/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cognitoidentity/endpoints.go b/service/cognitoidentity/endpoints.go index 42e033a3fdf..294cd621d20 100644 --- a/service/cognitoidentity/endpoints.go +++ b/service/cognitoidentity/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go b/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go index 929c0367120..d4232a2a89b 100644 --- a/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go +++ b/service/cognitoidentityprovider/api_op_AdminListGroupsForUser.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -121,6 +122,88 @@ func addOperationAdminListGroupsForUserMiddlewares(stack *middleware.Stack, opti return nil } +// AdminListGroupsForUserAPIClient is a client that implements the +// AdminListGroupsForUser operation. +type AdminListGroupsForUserAPIClient interface { + AdminListGroupsForUser(context.Context, *AdminListGroupsForUserInput, ...func(*Options)) (*AdminListGroupsForUserOutput, error) +} + +var _ AdminListGroupsForUserAPIClient = (*Client)(nil) + +// AdminListGroupsForUserPaginatorOptions is the paginator options for +// AdminListGroupsForUser +type AdminListGroupsForUserPaginatorOptions struct { + // The limit of the request to list groups. + 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 +} + +// AdminListGroupsForUserPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.AdminListGroupsForUser +type AdminListGroupsForUserPaginator struct { + options AdminListGroupsForUserPaginatorOptions + client AdminListGroupsForUserAPIClient + params *AdminListGroupsForUserInput + nextToken *string + firstPage bool +} + +// NewAdminListGroupsForUserPaginator returns a new AdminListGroupsForUserPaginator +func NewAdminListGroupsForUserPaginator(client AdminListGroupsForUserAPIClient, params *AdminListGroupsForUserInput, optFns ...func(*AdminListGroupsForUserPaginatorOptions)) *AdminListGroupsForUserPaginator { + options := AdminListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &AdminListGroupsForUserInput{} + } + + return &AdminListGroupsForUserPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *AdminListGroupsForUserPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next AdminListGroupsForUser page. +func (p *AdminListGroupsForUserPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*AdminListGroupsForUserOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.AdminListGroupsForUser(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opAdminListGroupsForUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go b/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go index 87fca4fd48d..03c1a4a5da7 100644 --- a/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go +++ b/service/cognitoidentityprovider/api_op_AdminListUserAuthEvents.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -120,6 +121,89 @@ func addOperationAdminListUserAuthEventsMiddlewares(stack *middleware.Stack, opt return nil } +// AdminListUserAuthEventsAPIClient is a client that implements the +// AdminListUserAuthEvents operation. +type AdminListUserAuthEventsAPIClient interface { + AdminListUserAuthEvents(context.Context, *AdminListUserAuthEventsInput, ...func(*Options)) (*AdminListUserAuthEventsOutput, error) +} + +var _ AdminListUserAuthEventsAPIClient = (*Client)(nil) + +// AdminListUserAuthEventsPaginatorOptions is the paginator options for +// AdminListUserAuthEvents +type AdminListUserAuthEventsPaginatorOptions struct { + // The maximum number of authentication events 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 +} + +// AdminListUserAuthEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.AdminListUserAuthEvents +type AdminListUserAuthEventsPaginator struct { + options AdminListUserAuthEventsPaginatorOptions + client AdminListUserAuthEventsAPIClient + params *AdminListUserAuthEventsInput + nextToken *string + firstPage bool +} + +// NewAdminListUserAuthEventsPaginator returns a new +// AdminListUserAuthEventsPaginator +func NewAdminListUserAuthEventsPaginator(client AdminListUserAuthEventsAPIClient, params *AdminListUserAuthEventsInput, optFns ...func(*AdminListUserAuthEventsPaginatorOptions)) *AdminListUserAuthEventsPaginator { + options := AdminListUserAuthEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &AdminListUserAuthEventsInput{} + } + + return &AdminListUserAuthEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *AdminListUserAuthEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next AdminListUserAuthEvents page. +func (p *AdminListUserAuthEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*AdminListUserAuthEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.AdminListUserAuthEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opAdminListUserAuthEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListGroups.go b/service/cognitoidentityprovider/api_op_ListGroups.go index 97fc1e76b24..963ba3578c9 100644 --- a/service/cognitoidentityprovider/api_op_ListGroups.go +++ b/service/cognitoidentityprovider/api_op_ListGroups.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -116,6 +117,86 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The limit of the request to list groups. + 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 +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListIdentityProviders.go b/service/cognitoidentityprovider/api_op_ListIdentityProviders.go index d8483e6b624..8e8a7dd53e5 100644 --- a/service/cognitoidentityprovider/api_op_ListIdentityProviders.go +++ b/service/cognitoidentityprovider/api_op_ListIdentityProviders.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -115,6 +116,88 @@ func addOperationListIdentityProvidersMiddlewares(stack *middleware.Stack, optio return nil } +// ListIdentityProvidersAPIClient is a client that implements the +// ListIdentityProviders operation. +type ListIdentityProvidersAPIClient interface { + ListIdentityProviders(context.Context, *ListIdentityProvidersInput, ...func(*Options)) (*ListIdentityProvidersOutput, error) +} + +var _ ListIdentityProvidersAPIClient = (*Client)(nil) + +// ListIdentityProvidersPaginatorOptions is the paginator options for +// ListIdentityProviders +type ListIdentityProvidersPaginatorOptions struct { + // The maximum number of identity providers 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 +} + +// ListIdentityProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListIdentityProviders +type ListIdentityProvidersPaginator struct { + options ListIdentityProvidersPaginatorOptions + client ListIdentityProvidersAPIClient + params *ListIdentityProvidersInput + nextToken *string + firstPage bool +} + +// NewListIdentityProvidersPaginator returns a new ListIdentityProvidersPaginator +func NewListIdentityProvidersPaginator(client ListIdentityProvidersAPIClient, params *ListIdentityProvidersInput, optFns ...func(*ListIdentityProvidersPaginatorOptions)) *ListIdentityProvidersPaginator { + options := ListIdentityProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIdentityProvidersInput{} + } + + return &ListIdentityProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentityProvidersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIdentityProviders page. +func (p *ListIdentityProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentityProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListIdentityProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIdentityProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListResourceServers.go b/service/cognitoidentityprovider/api_op_ListResourceServers.go index 63c9a3a94db..e2fecad8c07 100644 --- a/service/cognitoidentityprovider/api_op_ListResourceServers.go +++ b/service/cognitoidentityprovider/api_op_ListResourceServers.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -115,6 +116,88 @@ func addOperationListResourceServersMiddlewares(stack *middleware.Stack, options return nil } +// ListResourceServersAPIClient is a client that implements the ListResourceServers +// operation. +type ListResourceServersAPIClient interface { + ListResourceServers(context.Context, *ListResourceServersInput, ...func(*Options)) (*ListResourceServersOutput, error) +} + +var _ ListResourceServersAPIClient = (*Client)(nil) + +// ListResourceServersPaginatorOptions is the paginator options for +// ListResourceServers +type ListResourceServersPaginatorOptions struct { + // The maximum number of resource servers 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 +} + +// ListResourceServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListResourceServers +type ListResourceServersPaginator struct { + options ListResourceServersPaginatorOptions + client ListResourceServersAPIClient + params *ListResourceServersInput + nextToken *string + firstPage bool +} + +// NewListResourceServersPaginator returns a new ListResourceServersPaginator +func NewListResourceServersPaginator(client ListResourceServersAPIClient, params *ListResourceServersInput, optFns ...func(*ListResourceServersPaginatorOptions)) *ListResourceServersPaginator { + options := ListResourceServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceServersInput{} + } + + return &ListResourceServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceServersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourceServers page. +func (p *ListResourceServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListResourceServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUserPoolClients.go b/service/cognitoidentityprovider/api_op_ListUserPoolClients.go index 175213d71bb..2d0e2fccd38 100644 --- a/service/cognitoidentityprovider/api_op_ListUserPoolClients.go +++ b/service/cognitoidentityprovider/api_op_ListUserPoolClients.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -118,6 +119,89 @@ func addOperationListUserPoolClientsMiddlewares(stack *middleware.Stack, options return nil } +// ListUserPoolClientsAPIClient is a client that implements the ListUserPoolClients +// operation. +type ListUserPoolClientsAPIClient interface { + ListUserPoolClients(context.Context, *ListUserPoolClientsInput, ...func(*Options)) (*ListUserPoolClientsOutput, error) +} + +var _ ListUserPoolClientsAPIClient = (*Client)(nil) + +// ListUserPoolClientsPaginatorOptions is the paginator options for +// ListUserPoolClients +type ListUserPoolClientsPaginatorOptions struct { + // The maximum number of results you want the request to return when listing the + // user pool clients. + 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 +} + +// ListUserPoolClientsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUserPoolClients +type ListUserPoolClientsPaginator struct { + options ListUserPoolClientsPaginatorOptions + client ListUserPoolClientsAPIClient + params *ListUserPoolClientsInput + nextToken *string + firstPage bool +} + +// NewListUserPoolClientsPaginator returns a new ListUserPoolClientsPaginator +func NewListUserPoolClientsPaginator(client ListUserPoolClientsAPIClient, params *ListUserPoolClientsInput, optFns ...func(*ListUserPoolClientsPaginatorOptions)) *ListUserPoolClientsPaginator { + options := ListUserPoolClientsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserPoolClientsInput{} + } + + return &ListUserPoolClientsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserPoolClientsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUserPoolClients page. +func (p *ListUserPoolClientsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserPoolClientsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListUserPoolClients(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserPoolClients(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUsers.go b/service/cognitoidentityprovider/api_op_ListUsers.go index 01bd547a32b..4c76ecabfe4 100644 --- a/service/cognitoidentityprovider/api_op_ListUsers.go +++ b/service/cognitoidentityprovider/api_op_ListUsers.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -172,6 +173,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Maximum number of users to be returned. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/api_op_ListUsersInGroup.go b/service/cognitoidentityprovider/api_op_ListUsersInGroup.go index a1a1975915e..f5e90112611 100644 --- a/service/cognitoidentityprovider/api_op_ListUsersInGroup.go +++ b/service/cognitoidentityprovider/api_op_ListUsersInGroup.go @@ -4,6 +4,7 @@ package cognitoidentityprovider 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/cognitoidentityprovider/types" @@ -121,6 +122,87 @@ func addOperationListUsersInGroupMiddlewares(stack *middleware.Stack, options Op return nil } +// ListUsersInGroupAPIClient is a client that implements the ListUsersInGroup +// operation. +type ListUsersInGroupAPIClient interface { + ListUsersInGroup(context.Context, *ListUsersInGroupInput, ...func(*Options)) (*ListUsersInGroupOutput, error) +} + +var _ ListUsersInGroupAPIClient = (*Client)(nil) + +// ListUsersInGroupPaginatorOptions is the paginator options for ListUsersInGroup +type ListUsersInGroupPaginatorOptions struct { + // The limit of the request to list users. + 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 +} + +// ListUsersInGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider.ListUsersInGroup +type ListUsersInGroupPaginator struct { + options ListUsersInGroupPaginatorOptions + client ListUsersInGroupAPIClient + params *ListUsersInGroupInput + nextToken *string + firstPage bool +} + +// NewListUsersInGroupPaginator returns a new ListUsersInGroupPaginator +func NewListUsersInGroupPaginator(client ListUsersInGroupAPIClient, params *ListUsersInGroupInput, optFns ...func(*ListUsersInGroupPaginatorOptions)) *ListUsersInGroupPaginator { + options := ListUsersInGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInGroupInput{} + } + + return &ListUsersInGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersInGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsersInGroup page. +func (p *ListUsersInGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersInGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListUsersInGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsersInGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/cognitoidentityprovider/endpoints.go b/service/cognitoidentityprovider/endpoints.go index 624acbe9f58..c5844e61e14 100644 --- a/service/cognitoidentityprovider/endpoints.go +++ b/service/cognitoidentityprovider/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/cognitosync/endpoints.go b/service/cognitosync/endpoints.go index 73022d75134..60014b27add 100644 --- a/service/cognitosync/endpoints.go +++ b/service/cognitosync/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/comprehend/api_op_ListDocumentClassificationJobs.go b/service/comprehend/api_op_ListDocumentClassificationJobs.go index b854a4e7175..cc104dd1476 100644 --- a/service/comprehend/api_op_ListDocumentClassificationJobs.go +++ b/service/comprehend/api_op_ListDocumentClassificationJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListDocumentClassificationJobsMiddlewares(stack *middleware.Sta return nil } +// ListDocumentClassificationJobsAPIClient is a client that implements the +// ListDocumentClassificationJobs operation. +type ListDocumentClassificationJobsAPIClient interface { + ListDocumentClassificationJobs(context.Context, *ListDocumentClassificationJobsInput, ...func(*Options)) (*ListDocumentClassificationJobsOutput, error) +} + +var _ ListDocumentClassificationJobsAPIClient = (*Client)(nil) + +// ListDocumentClassificationJobsPaginatorOptions is the paginator options for +// ListDocumentClassificationJobs +type ListDocumentClassificationJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListDocumentClassificationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDocumentClassificationJobs +type ListDocumentClassificationJobsPaginator struct { + options ListDocumentClassificationJobsPaginatorOptions + client ListDocumentClassificationJobsAPIClient + params *ListDocumentClassificationJobsInput + nextToken *string + firstPage bool +} + +// NewListDocumentClassificationJobsPaginator returns a new +// ListDocumentClassificationJobsPaginator +func NewListDocumentClassificationJobsPaginator(client ListDocumentClassificationJobsAPIClient, params *ListDocumentClassificationJobsInput, optFns ...func(*ListDocumentClassificationJobsPaginatorOptions)) *ListDocumentClassificationJobsPaginator { + options := ListDocumentClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentClassificationJobsInput{} + } + + return &ListDocumentClassificationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentClassificationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDocumentClassificationJobs page. +func (p *ListDocumentClassificationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentClassificationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDocumentClassificationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentClassificationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListDocumentClassifiers.go b/service/comprehend/api_op_ListDocumentClassifiers.go index 689ee228fa7..4f0bf8480bc 100644 --- a/service/comprehend/api_op_ListDocumentClassifiers.go +++ b/service/comprehend/api_op_ListDocumentClassifiers.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListDocumentClassifiersMiddlewares(stack *middleware.Stack, opt return nil } +// ListDocumentClassifiersAPIClient is a client that implements the +// ListDocumentClassifiers operation. +type ListDocumentClassifiersAPIClient interface { + ListDocumentClassifiers(context.Context, *ListDocumentClassifiersInput, ...func(*Options)) (*ListDocumentClassifiersOutput, error) +} + +var _ ListDocumentClassifiersAPIClient = (*Client)(nil) + +// ListDocumentClassifiersPaginatorOptions is the paginator options for +// ListDocumentClassifiers +type ListDocumentClassifiersPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListDocumentClassifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDocumentClassifiers +type ListDocumentClassifiersPaginator struct { + options ListDocumentClassifiersPaginatorOptions + client ListDocumentClassifiersAPIClient + params *ListDocumentClassifiersInput + nextToken *string + firstPage bool +} + +// NewListDocumentClassifiersPaginator returns a new +// ListDocumentClassifiersPaginator +func NewListDocumentClassifiersPaginator(client ListDocumentClassifiersAPIClient, params *ListDocumentClassifiersInput, optFns ...func(*ListDocumentClassifiersPaginatorOptions)) *ListDocumentClassifiersPaginator { + options := ListDocumentClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentClassifiersInput{} + } + + return &ListDocumentClassifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentClassifiersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDocumentClassifiers page. +func (p *ListDocumentClassifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentClassifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDocumentClassifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentClassifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go b/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go index ca9c611dbb4..290b502a54d 100644 --- a/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go +++ b/service/comprehend/api_op_ListDominantLanguageDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListDominantLanguageDetectionJobsMiddlewares(stack *middleware. return nil } +// ListDominantLanguageDetectionJobsAPIClient is a client that implements the +// ListDominantLanguageDetectionJobs operation. +type ListDominantLanguageDetectionJobsAPIClient interface { + ListDominantLanguageDetectionJobs(context.Context, *ListDominantLanguageDetectionJobsInput, ...func(*Options)) (*ListDominantLanguageDetectionJobsOutput, error) +} + +var _ ListDominantLanguageDetectionJobsAPIClient = (*Client)(nil) + +// ListDominantLanguageDetectionJobsPaginatorOptions is the paginator options for +// ListDominantLanguageDetectionJobs +type ListDominantLanguageDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListDominantLanguageDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListDominantLanguageDetectionJobs +type ListDominantLanguageDetectionJobsPaginator struct { + options ListDominantLanguageDetectionJobsPaginatorOptions + client ListDominantLanguageDetectionJobsAPIClient + params *ListDominantLanguageDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListDominantLanguageDetectionJobsPaginator returns a new +// ListDominantLanguageDetectionJobsPaginator +func NewListDominantLanguageDetectionJobsPaginator(client ListDominantLanguageDetectionJobsAPIClient, params *ListDominantLanguageDetectionJobsInput, optFns ...func(*ListDominantLanguageDetectionJobsPaginatorOptions)) *ListDominantLanguageDetectionJobsPaginator { + options := ListDominantLanguageDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDominantLanguageDetectionJobsInput{} + } + + return &ListDominantLanguageDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDominantLanguageDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDominantLanguageDetectionJobs page. +func (p *ListDominantLanguageDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDominantLanguageDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDominantLanguageDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDominantLanguageDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListEntitiesDetectionJobs.go b/service/comprehend/api_op_ListEntitiesDetectionJobs.go index 6468d705a31..bb7fb014cdb 100644 --- a/service/comprehend/api_op_ListEntitiesDetectionJobs.go +++ b/service/comprehend/api_op_ListEntitiesDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListEntitiesDetectionJobsMiddlewares(stack *middleware.Stack, o return nil } +// ListEntitiesDetectionJobsAPIClient is a client that implements the +// ListEntitiesDetectionJobs operation. +type ListEntitiesDetectionJobsAPIClient interface { + ListEntitiesDetectionJobs(context.Context, *ListEntitiesDetectionJobsInput, ...func(*Options)) (*ListEntitiesDetectionJobsOutput, error) +} + +var _ ListEntitiesDetectionJobsAPIClient = (*Client)(nil) + +// ListEntitiesDetectionJobsPaginatorOptions is the paginator options for +// ListEntitiesDetectionJobs +type ListEntitiesDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListEntitiesDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListEntitiesDetectionJobs +type ListEntitiesDetectionJobsPaginator struct { + options ListEntitiesDetectionJobsPaginatorOptions + client ListEntitiesDetectionJobsAPIClient + params *ListEntitiesDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListEntitiesDetectionJobsPaginator returns a new +// ListEntitiesDetectionJobsPaginator +func NewListEntitiesDetectionJobsPaginator(client ListEntitiesDetectionJobsAPIClient, params *ListEntitiesDetectionJobsInput, optFns ...func(*ListEntitiesDetectionJobsPaginatorOptions)) *ListEntitiesDetectionJobsPaginator { + options := ListEntitiesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesDetectionJobsInput{} + } + + return &ListEntitiesDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEntitiesDetectionJobs page. +func (p *ListEntitiesDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEntitiesDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitiesDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListEntityRecognizers.go b/service/comprehend/api_op_ListEntityRecognizers.go index af0afc3078c..4451bde8e7c 100644 --- a/service/comprehend/api_op_ListEntityRecognizers.go +++ b/service/comprehend/api_op_ListEntityRecognizers.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -114,6 +115,88 @@ func addOperationListEntityRecognizersMiddlewares(stack *middleware.Stack, optio return nil } +// ListEntityRecognizersAPIClient is a client that implements the +// ListEntityRecognizers operation. +type ListEntityRecognizersAPIClient interface { + ListEntityRecognizers(context.Context, *ListEntityRecognizersInput, ...func(*Options)) (*ListEntityRecognizersOutput, error) +} + +var _ ListEntityRecognizersAPIClient = (*Client)(nil) + +// ListEntityRecognizersPaginatorOptions is the paginator options for +// ListEntityRecognizers +type ListEntityRecognizersPaginatorOptions struct { + // The maximum number of results to return on each page. The default is 100. + 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 +} + +// ListEntityRecognizersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListEntityRecognizers +type ListEntityRecognizersPaginator struct { + options ListEntityRecognizersPaginatorOptions + client ListEntityRecognizersAPIClient + params *ListEntityRecognizersInput + nextToken *string + firstPage bool +} + +// NewListEntityRecognizersPaginator returns a new ListEntityRecognizersPaginator +func NewListEntityRecognizersPaginator(client ListEntityRecognizersAPIClient, params *ListEntityRecognizersInput, optFns ...func(*ListEntityRecognizersPaginatorOptions)) *ListEntityRecognizersPaginator { + options := ListEntityRecognizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntityRecognizersInput{} + } + + return &ListEntityRecognizersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntityRecognizersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEntityRecognizers page. +func (p *ListEntityRecognizersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntityRecognizersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEntityRecognizers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntityRecognizers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go b/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go index 95be5b94879..b21625374d9 100644 --- a/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go +++ b/service/comprehend/api_op_ListKeyPhrasesDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListKeyPhrasesDetectionJobsMiddlewares(stack *middleware.Stack, return nil } +// ListKeyPhrasesDetectionJobsAPIClient is a client that implements the +// ListKeyPhrasesDetectionJobs operation. +type ListKeyPhrasesDetectionJobsAPIClient interface { + ListKeyPhrasesDetectionJobs(context.Context, *ListKeyPhrasesDetectionJobsInput, ...func(*Options)) (*ListKeyPhrasesDetectionJobsOutput, error) +} + +var _ ListKeyPhrasesDetectionJobsAPIClient = (*Client)(nil) + +// ListKeyPhrasesDetectionJobsPaginatorOptions is the paginator options for +// ListKeyPhrasesDetectionJobs +type ListKeyPhrasesDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListKeyPhrasesDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListKeyPhrasesDetectionJobs +type ListKeyPhrasesDetectionJobsPaginator struct { + options ListKeyPhrasesDetectionJobsPaginatorOptions + client ListKeyPhrasesDetectionJobsAPIClient + params *ListKeyPhrasesDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListKeyPhrasesDetectionJobsPaginator returns a new +// ListKeyPhrasesDetectionJobsPaginator +func NewListKeyPhrasesDetectionJobsPaginator(client ListKeyPhrasesDetectionJobsAPIClient, params *ListKeyPhrasesDetectionJobsInput, optFns ...func(*ListKeyPhrasesDetectionJobsPaginatorOptions)) *ListKeyPhrasesDetectionJobsPaginator { + options := ListKeyPhrasesDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeyPhrasesDetectionJobsInput{} + } + + return &ListKeyPhrasesDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeyPhrasesDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListKeyPhrasesDetectionJobs page. +func (p *ListKeyPhrasesDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyPhrasesDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListKeyPhrasesDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeyPhrasesDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListSentimentDetectionJobs.go b/service/comprehend/api_op_ListSentimentDetectionJobs.go index 46471295bb7..3e3f7aac779 100644 --- a/service/comprehend/api_op_ListSentimentDetectionJobs.go +++ b/service/comprehend/api_op_ListSentimentDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListSentimentDetectionJobsMiddlewares(stack *middleware.Stack, return nil } +// ListSentimentDetectionJobsAPIClient is a client that implements the +// ListSentimentDetectionJobs operation. +type ListSentimentDetectionJobsAPIClient interface { + ListSentimentDetectionJobs(context.Context, *ListSentimentDetectionJobsInput, ...func(*Options)) (*ListSentimentDetectionJobsOutput, error) +} + +var _ ListSentimentDetectionJobsAPIClient = (*Client)(nil) + +// ListSentimentDetectionJobsPaginatorOptions is the paginator options for +// ListSentimentDetectionJobs +type ListSentimentDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListSentimentDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListSentimentDetectionJobs +type ListSentimentDetectionJobsPaginator struct { + options ListSentimentDetectionJobsPaginatorOptions + client ListSentimentDetectionJobsAPIClient + params *ListSentimentDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListSentimentDetectionJobsPaginator returns a new +// ListSentimentDetectionJobsPaginator +func NewListSentimentDetectionJobsPaginator(client ListSentimentDetectionJobsAPIClient, params *ListSentimentDetectionJobsInput, optFns ...func(*ListSentimentDetectionJobsPaginatorOptions)) *ListSentimentDetectionJobsPaginator { + options := ListSentimentDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSentimentDetectionJobsInput{} + } + + return &ListSentimentDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSentimentDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSentimentDetectionJobs page. +func (p *ListSentimentDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSentimentDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSentimentDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSentimentDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/api_op_ListTopicsDetectionJobs.go b/service/comprehend/api_op_ListTopicsDetectionJobs.go index 6caddc285a5..aa8c67b87d6 100644 --- a/service/comprehend/api_op_ListTopicsDetectionJobs.go +++ b/service/comprehend/api_op_ListTopicsDetectionJobs.go @@ -4,6 +4,7 @@ package comprehend 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/comprehend/types" @@ -110,6 +111,89 @@ func addOperationListTopicsDetectionJobsMiddlewares(stack *middleware.Stack, opt return nil } +// ListTopicsDetectionJobsAPIClient is a client that implements the +// ListTopicsDetectionJobs operation. +type ListTopicsDetectionJobsAPIClient interface { + ListTopicsDetectionJobs(context.Context, *ListTopicsDetectionJobsInput, ...func(*Options)) (*ListTopicsDetectionJobsOutput, error) +} + +var _ ListTopicsDetectionJobsAPIClient = (*Client)(nil) + +// ListTopicsDetectionJobsPaginatorOptions is the paginator options for +// ListTopicsDetectionJobs +type ListTopicsDetectionJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default is 100. + 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 +} + +// ListTopicsDetectionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/comprehend.ListTopicsDetectionJobs +type ListTopicsDetectionJobsPaginator struct { + options ListTopicsDetectionJobsPaginatorOptions + client ListTopicsDetectionJobsAPIClient + params *ListTopicsDetectionJobsInput + nextToken *string + firstPage bool +} + +// NewListTopicsDetectionJobsPaginator returns a new +// ListTopicsDetectionJobsPaginator +func NewListTopicsDetectionJobsPaginator(client ListTopicsDetectionJobsAPIClient, params *ListTopicsDetectionJobsInput, optFns ...func(*ListTopicsDetectionJobsPaginatorOptions)) *ListTopicsDetectionJobsPaginator { + options := ListTopicsDetectionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicsDetectionJobsInput{} + } + + return &ListTopicsDetectionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicsDetectionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTopicsDetectionJobs page. +func (p *ListTopicsDetectionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicsDetectionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTopicsDetectionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicsDetectionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/comprehend/endpoints.go b/service/comprehend/endpoints.go index 68fb7bdf861..313f0fb1a1d 100644 --- a/service/comprehend/endpoints.go +++ b/service/comprehend/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/comprehendmedical/endpoints.go b/service/comprehendmedical/endpoints.go index 957b562f8e9..052319b5335 100644 --- a/service/comprehendmedical/endpoints.go +++ b/service/comprehendmedical/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/computeoptimizer/endpoints.go b/service/computeoptimizer/endpoints.go index 7f22bdc16f4..5cbcce2d607 100644 --- a/service/computeoptimizer/endpoints.go +++ b/service/computeoptimizer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/configservice/api_op_DescribeRemediationExceptions.go b/service/configservice/api_op_DescribeRemediationExceptions.go index 8cecd56464c..3c0de6a9e58 100644 --- a/service/configservice/api_op_DescribeRemediationExceptions.go +++ b/service/configservice/api_op_DescribeRemediationExceptions.go @@ -4,6 +4,7 @@ package configservice 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/configservice/types" @@ -129,6 +130,90 @@ func addOperationDescribeRemediationExceptionsMiddlewares(stack *middleware.Stac return nil } +// DescribeRemediationExceptionsAPIClient is a client that implements the +// DescribeRemediationExceptions operation. +type DescribeRemediationExceptionsAPIClient interface { + DescribeRemediationExceptions(context.Context, *DescribeRemediationExceptionsInput, ...func(*Options)) (*DescribeRemediationExceptionsOutput, error) +} + +var _ DescribeRemediationExceptionsAPIClient = (*Client)(nil) + +// DescribeRemediationExceptionsPaginatorOptions is the paginator options for +// DescribeRemediationExceptions +type DescribeRemediationExceptionsPaginatorOptions struct { + // The maximum number of RemediationExceptionResourceKey returned on each page. The + // default is 25. If you specify 0, AWS Config uses the default. + 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 +} + +// DescribeRemediationExceptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.DescribeRemediationExceptions +type DescribeRemediationExceptionsPaginator struct { + options DescribeRemediationExceptionsPaginatorOptions + client DescribeRemediationExceptionsAPIClient + params *DescribeRemediationExceptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeRemediationExceptionsPaginator returns a new +// DescribeRemediationExceptionsPaginator +func NewDescribeRemediationExceptionsPaginator(client DescribeRemediationExceptionsAPIClient, params *DescribeRemediationExceptionsInput, optFns ...func(*DescribeRemediationExceptionsPaginatorOptions)) *DescribeRemediationExceptionsPaginator { + options := DescribeRemediationExceptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRemediationExceptionsInput{} + } + + return &DescribeRemediationExceptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRemediationExceptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeRemediationExceptions page. +func (p *DescribeRemediationExceptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRemediationExceptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.DescribeRemediationExceptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRemediationExceptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_DescribeRemediationExecutionStatus.go b/service/configservice/api_op_DescribeRemediationExecutionStatus.go index 22517bd6c15..3ae7855fb92 100644 --- a/service/configservice/api_op_DescribeRemediationExecutionStatus.go +++ b/service/configservice/api_op_DescribeRemediationExecutionStatus.go @@ -4,6 +4,7 @@ package configservice 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/configservice/types" @@ -123,6 +124,90 @@ func addOperationDescribeRemediationExecutionStatusMiddlewares(stack *middleware return nil } +// DescribeRemediationExecutionStatusAPIClient is a client that implements the +// DescribeRemediationExecutionStatus operation. +type DescribeRemediationExecutionStatusAPIClient interface { + DescribeRemediationExecutionStatus(context.Context, *DescribeRemediationExecutionStatusInput, ...func(*Options)) (*DescribeRemediationExecutionStatusOutput, error) +} + +var _ DescribeRemediationExecutionStatusAPIClient = (*Client)(nil) + +// DescribeRemediationExecutionStatusPaginatorOptions is the paginator options for +// DescribeRemediationExecutionStatus +type DescribeRemediationExecutionStatusPaginatorOptions struct { + // The maximum number of RemediationExecutionStatuses returned on each page. The + // default is maximum. If you specify 0, AWS Config uses the default. + 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 +} + +// DescribeRemediationExecutionStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.DescribeRemediationExecutionStatus +type DescribeRemediationExecutionStatusPaginator struct { + options DescribeRemediationExecutionStatusPaginatorOptions + client DescribeRemediationExecutionStatusAPIClient + params *DescribeRemediationExecutionStatusInput + nextToken *string + firstPage bool +} + +// NewDescribeRemediationExecutionStatusPaginator returns a new +// DescribeRemediationExecutionStatusPaginator +func NewDescribeRemediationExecutionStatusPaginator(client DescribeRemediationExecutionStatusAPIClient, params *DescribeRemediationExecutionStatusInput, optFns ...func(*DescribeRemediationExecutionStatusPaginatorOptions)) *DescribeRemediationExecutionStatusPaginator { + options := DescribeRemediationExecutionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRemediationExecutionStatusInput{} + } + + return &DescribeRemediationExecutionStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRemediationExecutionStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeRemediationExecutionStatus page. +func (p *DescribeRemediationExecutionStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRemediationExecutionStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.DescribeRemediationExecutionStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRemediationExecutionStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_GetResourceConfigHistory.go b/service/configservice/api_op_GetResourceConfigHistory.go index 90cd3184d8f..09c3a0294d2 100644 --- a/service/configservice/api_op_GetResourceConfigHistory.go +++ b/service/configservice/api_op_GetResourceConfigHistory.go @@ -4,6 +4,7 @@ package configservice 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/configservice/types" @@ -149,6 +150,91 @@ func addOperationGetResourceConfigHistoryMiddlewares(stack *middleware.Stack, op return nil } +// GetResourceConfigHistoryAPIClient is a client that implements the +// GetResourceConfigHistory operation. +type GetResourceConfigHistoryAPIClient interface { + GetResourceConfigHistory(context.Context, *GetResourceConfigHistoryInput, ...func(*Options)) (*GetResourceConfigHistoryOutput, error) +} + +var _ GetResourceConfigHistoryAPIClient = (*Client)(nil) + +// GetResourceConfigHistoryPaginatorOptions is the paginator options for +// GetResourceConfigHistory +type GetResourceConfigHistoryPaginatorOptions struct { + // The maximum number of configuration items returned on each page. The default is + // 10. You cannot specify a number greater than 100. If you specify 0, AWS Config + // uses the default. + 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 +} + +// GetResourceConfigHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.GetResourceConfigHistory +type GetResourceConfigHistoryPaginator struct { + options GetResourceConfigHistoryPaginatorOptions + client GetResourceConfigHistoryAPIClient + params *GetResourceConfigHistoryInput + nextToken *string + firstPage bool +} + +// NewGetResourceConfigHistoryPaginator returns a new +// GetResourceConfigHistoryPaginator +func NewGetResourceConfigHistoryPaginator(client GetResourceConfigHistoryAPIClient, params *GetResourceConfigHistoryInput, optFns ...func(*GetResourceConfigHistoryPaginatorOptions)) *GetResourceConfigHistoryPaginator { + options := GetResourceConfigHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceConfigHistoryInput{} + } + + return &GetResourceConfigHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceConfigHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResourceConfigHistory page. +func (p *GetResourceConfigHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceConfigHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.GetResourceConfigHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceConfigHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/api_op_SelectAggregateResourceConfig.go b/service/configservice/api_op_SelectAggregateResourceConfig.go index 1cebfef0d3e..0322abcee4f 100644 --- a/service/configservice/api_op_SelectAggregateResourceConfig.go +++ b/service/configservice/api_op_SelectAggregateResourceConfig.go @@ -4,6 +4,7 @@ package configservice 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/configservice/types" @@ -133,6 +134,90 @@ func addOperationSelectAggregateResourceConfigMiddlewares(stack *middleware.Stac return nil } +// SelectAggregateResourceConfigAPIClient is a client that implements the +// SelectAggregateResourceConfig operation. +type SelectAggregateResourceConfigAPIClient interface { + SelectAggregateResourceConfig(context.Context, *SelectAggregateResourceConfigInput, ...func(*Options)) (*SelectAggregateResourceConfigOutput, error) +} + +var _ SelectAggregateResourceConfigAPIClient = (*Client)(nil) + +// SelectAggregateResourceConfigPaginatorOptions is the paginator options for +// SelectAggregateResourceConfig +type SelectAggregateResourceConfigPaginatorOptions struct { + // The maximum number of query results returned on each page. AWS Config also + // allows the Limit request parameter. + 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 +} + +// SelectAggregateResourceConfigPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/configservice.SelectAggregateResourceConfig +type SelectAggregateResourceConfigPaginator struct { + options SelectAggregateResourceConfigPaginatorOptions + client SelectAggregateResourceConfigAPIClient + params *SelectAggregateResourceConfigInput + nextToken *string + firstPage bool +} + +// NewSelectAggregateResourceConfigPaginator returns a new +// SelectAggregateResourceConfigPaginator +func NewSelectAggregateResourceConfigPaginator(client SelectAggregateResourceConfigAPIClient, params *SelectAggregateResourceConfigInput, optFns ...func(*SelectAggregateResourceConfigPaginatorOptions)) *SelectAggregateResourceConfigPaginator { + options := SelectAggregateResourceConfigPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SelectAggregateResourceConfigInput{} + } + + return &SelectAggregateResourceConfigPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SelectAggregateResourceConfigPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SelectAggregateResourceConfig page. +func (p *SelectAggregateResourceConfigPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SelectAggregateResourceConfigOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.SelectAggregateResourceConfig(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSelectAggregateResourceConfig(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/configservice/endpoints.go b/service/configservice/endpoints.go index d5336ef0e0f..df9464641b8 100644 --- a/service/configservice/endpoints.go +++ b/service/configservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/connect/api_op_GetCurrentMetricData.go b/service/connect/api_op_GetCurrentMetricData.go index b0ff3e40a31..bd81a08e65f 100644 --- a/service/connect/api_op_GetCurrentMetricData.go +++ b/service/connect/api_op_GetCurrentMetricData.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -182,6 +183,88 @@ func addOperationGetCurrentMetricDataMiddlewares(stack *middleware.Stack, option return nil } +// GetCurrentMetricDataAPIClient is a client that implements the +// GetCurrentMetricData operation. +type GetCurrentMetricDataAPIClient interface { + GetCurrentMetricData(context.Context, *GetCurrentMetricDataInput, ...func(*Options)) (*GetCurrentMetricDataOutput, error) +} + +var _ GetCurrentMetricDataAPIClient = (*Client)(nil) + +// GetCurrentMetricDataPaginatorOptions is the paginator options for +// GetCurrentMetricData +type GetCurrentMetricDataPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// GetCurrentMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.GetCurrentMetricData +type GetCurrentMetricDataPaginator struct { + options GetCurrentMetricDataPaginatorOptions + client GetCurrentMetricDataAPIClient + params *GetCurrentMetricDataInput + nextToken *string + firstPage bool +} + +// NewGetCurrentMetricDataPaginator returns a new GetCurrentMetricDataPaginator +func NewGetCurrentMetricDataPaginator(client GetCurrentMetricDataAPIClient, params *GetCurrentMetricDataInput, optFns ...func(*GetCurrentMetricDataPaginatorOptions)) *GetCurrentMetricDataPaginator { + options := GetCurrentMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCurrentMetricDataInput{} + } + + return &GetCurrentMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCurrentMetricDataPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCurrentMetricData page. +func (p *GetCurrentMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCurrentMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetCurrentMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCurrentMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_GetMetricData.go b/service/connect/api_op_GetMetricData.go index d7866eeea4a..82ef7799e56 100644 --- a/service/connect/api_op_GetMetricData.go +++ b/service/connect/api_op_GetMetricData.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -183,6 +184,86 @@ func addOperationGetMetricDataMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetMetricDataAPIClient is a client that implements the GetMetricData operation. +type GetMetricDataAPIClient interface { + GetMetricData(context.Context, *GetMetricDataInput, ...func(*Options)) (*GetMetricDataOutput, error) +} + +var _ GetMetricDataAPIClient = (*Client)(nil) + +// GetMetricDataPaginatorOptions is the paginator options for GetMetricData +type GetMetricDataPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// GetMetricDataPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.GetMetricData +type GetMetricDataPaginator struct { + options GetMetricDataPaginatorOptions + client GetMetricDataAPIClient + params *GetMetricDataInput + nextToken *string + firstPage bool +} + +// NewGetMetricDataPaginator returns a new GetMetricDataPaginator +func NewGetMetricDataPaginator(client GetMetricDataAPIClient, params *GetMetricDataInput, optFns ...func(*GetMetricDataPaginatorOptions)) *GetMetricDataPaginator { + options := GetMetricDataPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMetricDataInput{} + } + + return &GetMetricDataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMetricDataPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetMetricData page. +func (p *GetMetricDataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMetricDataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetMetricData(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMetricData(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListContactFlows.go b/service/connect/api_op_ListContactFlows.go index af71610b6ff..40846d515da 100644 --- a/service/connect/api_op_ListContactFlows.go +++ b/service/connect/api_op_ListContactFlows.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -123,6 +124,87 @@ func addOperationListContactFlowsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListContactFlowsAPIClient is a client that implements the ListContactFlows +// operation. +type ListContactFlowsAPIClient interface { + ListContactFlows(context.Context, *ListContactFlowsInput, ...func(*Options)) (*ListContactFlowsOutput, error) +} + +var _ ListContactFlowsAPIClient = (*Client)(nil) + +// ListContactFlowsPaginatorOptions is the paginator options for ListContactFlows +type ListContactFlowsPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListContactFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListContactFlows +type ListContactFlowsPaginator struct { + options ListContactFlowsPaginatorOptions + client ListContactFlowsAPIClient + params *ListContactFlowsInput + nextToken *string + firstPage bool +} + +// NewListContactFlowsPaginator returns a new ListContactFlowsPaginator +func NewListContactFlowsPaginator(client ListContactFlowsAPIClient, params *ListContactFlowsInput, optFns ...func(*ListContactFlowsPaginatorOptions)) *ListContactFlowsPaginator { + options := ListContactFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactFlowsInput{} + } + + return &ListContactFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactFlowsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContactFlows page. +func (p *ListContactFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListContactFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContactFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListHoursOfOperations.go b/service/connect/api_op_ListHoursOfOperations.go index 92f13acc214..78f60fdcde2 100644 --- a/service/connect/api_op_ListHoursOfOperations.go +++ b/service/connect/api_op_ListHoursOfOperations.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -118,6 +119,88 @@ func addOperationListHoursOfOperationsMiddlewares(stack *middleware.Stack, optio return nil } +// ListHoursOfOperationsAPIClient is a client that implements the +// ListHoursOfOperations operation. +type ListHoursOfOperationsAPIClient interface { + ListHoursOfOperations(context.Context, *ListHoursOfOperationsInput, ...func(*Options)) (*ListHoursOfOperationsOutput, error) +} + +var _ ListHoursOfOperationsAPIClient = (*Client)(nil) + +// ListHoursOfOperationsPaginatorOptions is the paginator options for +// ListHoursOfOperations +type ListHoursOfOperationsPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListHoursOfOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListHoursOfOperations +type ListHoursOfOperationsPaginator struct { + options ListHoursOfOperationsPaginatorOptions + client ListHoursOfOperationsAPIClient + params *ListHoursOfOperationsInput + nextToken *string + firstPage bool +} + +// NewListHoursOfOperationsPaginator returns a new ListHoursOfOperationsPaginator +func NewListHoursOfOperationsPaginator(client ListHoursOfOperationsAPIClient, params *ListHoursOfOperationsInput, optFns ...func(*ListHoursOfOperationsPaginatorOptions)) *ListHoursOfOperationsPaginator { + options := ListHoursOfOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHoursOfOperationsInput{} + } + + return &ListHoursOfOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHoursOfOperationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHoursOfOperations page. +func (p *ListHoursOfOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHoursOfOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListHoursOfOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHoursOfOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListPhoneNumbers.go b/service/connect/api_op_ListPhoneNumbers.go index 23e0d1bec36..c5cd7fe0dc5 100644 --- a/service/connect/api_op_ListPhoneNumbers.go +++ b/service/connect/api_op_ListPhoneNumbers.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -124,6 +125,87 @@ func addOperationListPhoneNumbersMiddlewares(stack *middleware.Stack, options Op return nil } +// ListPhoneNumbersAPIClient is a client that implements the ListPhoneNumbers +// operation. +type ListPhoneNumbersAPIClient interface { + ListPhoneNumbers(context.Context, *ListPhoneNumbersInput, ...func(*Options)) (*ListPhoneNumbersOutput, error) +} + +var _ ListPhoneNumbersAPIClient = (*Client)(nil) + +// ListPhoneNumbersPaginatorOptions is the paginator options for ListPhoneNumbers +type ListPhoneNumbersPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListPhoneNumbersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListPhoneNumbers +type ListPhoneNumbersPaginator struct { + options ListPhoneNumbersPaginatorOptions + client ListPhoneNumbersAPIClient + params *ListPhoneNumbersInput + nextToken *string + firstPage bool +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + options := ListPhoneNumbersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPhoneNumbersInput{} + } + + return &ListPhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumbersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPhoneNumbers page. +func (p *ListPhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListPrompts.go b/service/connect/api_op_ListPrompts.go index 7e8b884272b..d5aa036b54b 100644 --- a/service/connect/api_op_ListPrompts.go +++ b/service/connect/api_op_ListPrompts.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -115,6 +116,86 @@ func addOperationListPromptsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListPromptsAPIClient is a client that implements the ListPrompts operation. +type ListPromptsAPIClient interface { + ListPrompts(context.Context, *ListPromptsInput, ...func(*Options)) (*ListPromptsOutput, error) +} + +var _ ListPromptsAPIClient = (*Client)(nil) + +// ListPromptsPaginatorOptions is the paginator options for ListPrompts +type ListPromptsPaginatorOptions struct { + // The maximum number of results to return per page. + 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 +} + +// ListPromptsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListPrompts +type ListPromptsPaginator struct { + options ListPromptsPaginatorOptions + client ListPromptsAPIClient + params *ListPromptsInput + nextToken *string + firstPage bool +} + +// NewListPromptsPaginator returns a new ListPromptsPaginator +func NewListPromptsPaginator(client ListPromptsAPIClient, params *ListPromptsInput, optFns ...func(*ListPromptsPaginatorOptions)) *ListPromptsPaginator { + options := ListPromptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPromptsInput{} + } + + return &ListPromptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPromptsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPrompts page. +func (p *ListPromptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPromptsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPrompts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrompts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListQueues.go b/service/connect/api_op_ListQueues.go index ba38cb3c159..9ba3f14ddbc 100644 --- a/service/connect/api_op_ListQueues.go +++ b/service/connect/api_op_ListQueues.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -120,6 +121,86 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListRoutingProfileQueues.go b/service/connect/api_op_ListRoutingProfileQueues.go index aa7b9e1e2c3..72ba3ee74b4 100644 --- a/service/connect/api_op_ListRoutingProfileQueues.go +++ b/service/connect/api_op_ListRoutingProfileQueues.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -119,6 +120,89 @@ func addOperationListRoutingProfileQueuesMiddlewares(stack *middleware.Stack, op return nil } +// ListRoutingProfileQueuesAPIClient is a client that implements the +// ListRoutingProfileQueues operation. +type ListRoutingProfileQueuesAPIClient interface { + ListRoutingProfileQueues(context.Context, *ListRoutingProfileQueuesInput, ...func(*Options)) (*ListRoutingProfileQueuesOutput, error) +} + +var _ ListRoutingProfileQueuesAPIClient = (*Client)(nil) + +// ListRoutingProfileQueuesPaginatorOptions is the paginator options for +// ListRoutingProfileQueues +type ListRoutingProfileQueuesPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListRoutingProfileQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListRoutingProfileQueues +type ListRoutingProfileQueuesPaginator struct { + options ListRoutingProfileQueuesPaginatorOptions + client ListRoutingProfileQueuesAPIClient + params *ListRoutingProfileQueuesInput + nextToken *string + firstPage bool +} + +// NewListRoutingProfileQueuesPaginator returns a new +// ListRoutingProfileQueuesPaginator +func NewListRoutingProfileQueuesPaginator(client ListRoutingProfileQueuesAPIClient, params *ListRoutingProfileQueuesInput, optFns ...func(*ListRoutingProfileQueuesPaginatorOptions)) *ListRoutingProfileQueuesPaginator { + options := ListRoutingProfileQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutingProfileQueuesInput{} + } + + return &ListRoutingProfileQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutingProfileQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoutingProfileQueues page. +func (p *ListRoutingProfileQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingProfileQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListRoutingProfileQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoutingProfileQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListRoutingProfiles.go b/service/connect/api_op_ListRoutingProfiles.go index 976ed766b00..b20c1f0ad42 100644 --- a/service/connect/api_op_ListRoutingProfiles.go +++ b/service/connect/api_op_ListRoutingProfiles.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -120,6 +121,88 @@ func addOperationListRoutingProfilesMiddlewares(stack *middleware.Stack, options return nil } +// ListRoutingProfilesAPIClient is a client that implements the ListRoutingProfiles +// operation. +type ListRoutingProfilesAPIClient interface { + ListRoutingProfiles(context.Context, *ListRoutingProfilesInput, ...func(*Options)) (*ListRoutingProfilesOutput, error) +} + +var _ ListRoutingProfilesAPIClient = (*Client)(nil) + +// ListRoutingProfilesPaginatorOptions is the paginator options for +// ListRoutingProfiles +type ListRoutingProfilesPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListRoutingProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListRoutingProfiles +type ListRoutingProfilesPaginator struct { + options ListRoutingProfilesPaginatorOptions + client ListRoutingProfilesAPIClient + params *ListRoutingProfilesInput + nextToken *string + firstPage bool +} + +// NewListRoutingProfilesPaginator returns a new ListRoutingProfilesPaginator +func NewListRoutingProfilesPaginator(client ListRoutingProfilesAPIClient, params *ListRoutingProfilesInput, optFns ...func(*ListRoutingProfilesPaginatorOptions)) *ListRoutingProfilesPaginator { + options := ListRoutingProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoutingProfilesInput{} + } + + return &ListRoutingProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoutingProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoutingProfiles page. +func (p *ListRoutingProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoutingProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListRoutingProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoutingProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListSecurityProfiles.go b/service/connect/api_op_ListSecurityProfiles.go index 23883c03435..f1eb219cad3 100644 --- a/service/connect/api_op_ListSecurityProfiles.go +++ b/service/connect/api_op_ListSecurityProfiles.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -118,6 +119,88 @@ func addOperationListSecurityProfilesMiddlewares(stack *middleware.Stack, option return nil } +// ListSecurityProfilesAPIClient is a client that implements the +// ListSecurityProfiles operation. +type ListSecurityProfilesAPIClient interface { + ListSecurityProfiles(context.Context, *ListSecurityProfilesInput, ...func(*Options)) (*ListSecurityProfilesOutput, error) +} + +var _ ListSecurityProfilesAPIClient = (*Client)(nil) + +// ListSecurityProfilesPaginatorOptions is the paginator options for +// ListSecurityProfiles +type ListSecurityProfilesPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListSecurityProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListSecurityProfiles +type ListSecurityProfilesPaginator struct { + options ListSecurityProfilesPaginatorOptions + client ListSecurityProfilesAPIClient + params *ListSecurityProfilesInput + nextToken *string + firstPage bool +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesInput{} + } + + return &ListSecurityProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecurityProfiles page. +func (p *ListSecurityProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListSecurityProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListUserHierarchyGroups.go b/service/connect/api_op_ListUserHierarchyGroups.go index 80a37692f57..cece75c9bbd 100644 --- a/service/connect/api_op_ListUserHierarchyGroups.go +++ b/service/connect/api_op_ListUserHierarchyGroups.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -118,6 +119,89 @@ func addOperationListUserHierarchyGroupsMiddlewares(stack *middleware.Stack, opt return nil } +// ListUserHierarchyGroupsAPIClient is a client that implements the +// ListUserHierarchyGroups operation. +type ListUserHierarchyGroupsAPIClient interface { + ListUserHierarchyGroups(context.Context, *ListUserHierarchyGroupsInput, ...func(*Options)) (*ListUserHierarchyGroupsOutput, error) +} + +var _ ListUserHierarchyGroupsAPIClient = (*Client)(nil) + +// ListUserHierarchyGroupsPaginatorOptions is the paginator options for +// ListUserHierarchyGroups +type ListUserHierarchyGroupsPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListUserHierarchyGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListUserHierarchyGroups +type ListUserHierarchyGroupsPaginator struct { + options ListUserHierarchyGroupsPaginatorOptions + client ListUserHierarchyGroupsAPIClient + params *ListUserHierarchyGroupsInput + nextToken *string + firstPage bool +} + +// NewListUserHierarchyGroupsPaginator returns a new +// ListUserHierarchyGroupsPaginator +func NewListUserHierarchyGroupsPaginator(client ListUserHierarchyGroupsAPIClient, params *ListUserHierarchyGroupsInput, optFns ...func(*ListUserHierarchyGroupsPaginatorOptions)) *ListUserHierarchyGroupsPaginator { + options := ListUserHierarchyGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserHierarchyGroupsInput{} + } + + return &ListUserHierarchyGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserHierarchyGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUserHierarchyGroups page. +func (p *ListUserHierarchyGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserHierarchyGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListUserHierarchyGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserHierarchyGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/api_op_ListUsers.go b/service/connect/api_op_ListUsers.go index 1569a74f528..64cdc0c29de 100644 --- a/service/connect/api_op_ListUsers.go +++ b/service/connect/api_op_ListUsers.go @@ -4,6 +4,7 @@ package connect 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/connect/types" @@ -115,6 +116,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connect.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connect/endpoints.go b/service/connect/endpoints.go index e2f1981b2dc..7c7212a163f 100644 --- a/service/connect/endpoints.go +++ b/service/connect/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/connectparticipant/api_op_GetTranscript.go b/service/connectparticipant/api_op_GetTranscript.go index 90c08200abd..f2d73956ca3 100644 --- a/service/connectparticipant/api_op_GetTranscript.go +++ b/service/connectparticipant/api_op_GetTranscript.go @@ -4,6 +4,7 @@ package connectparticipant 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/connectparticipant/types" @@ -132,6 +133,86 @@ func addOperationGetTranscriptMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetTranscriptAPIClient is a client that implements the GetTranscript operation. +type GetTranscriptAPIClient interface { + GetTranscript(context.Context, *GetTranscriptInput, ...func(*Options)) (*GetTranscriptOutput, error) +} + +var _ GetTranscriptAPIClient = (*Client)(nil) + +// GetTranscriptPaginatorOptions is the paginator options for GetTranscript +type GetTranscriptPaginatorOptions struct { + // The maximum number of results to return in the page. Default: 10. + 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 +} + +// GetTranscriptPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/connectparticipant.GetTranscript +type GetTranscriptPaginator struct { + options GetTranscriptPaginatorOptions + client GetTranscriptAPIClient + params *GetTranscriptInput + nextToken *string + firstPage bool +} + +// NewGetTranscriptPaginator returns a new GetTranscriptPaginator +func NewGetTranscriptPaginator(client GetTranscriptAPIClient, params *GetTranscriptInput, optFns ...func(*GetTranscriptPaginatorOptions)) *GetTranscriptPaginator { + options := GetTranscriptPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTranscriptInput{} + } + + return &GetTranscriptPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTranscriptPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTranscript page. +func (p *GetTranscriptPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTranscriptOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTranscript(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTranscript(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/connectparticipant/endpoints.go b/service/connectparticipant/endpoints.go index 505e398e071..3934bafef7a 100644 --- a/service/connectparticipant/endpoints.go +++ b/service/connectparticipant/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/costandusagereportservice/api_op_DescribeReportDefinitions.go b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go index 26c1ea0b5fa..360c4b41506 100644 --- a/service/costandusagereportservice/api_op_DescribeReportDefinitions.go +++ b/service/costandusagereportservice/api_op_DescribeReportDefinitions.go @@ -4,6 +4,7 @@ package costandusagereportservice 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/costandusagereportservice/types" @@ -107,6 +108,89 @@ func addOperationDescribeReportDefinitionsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeReportDefinitionsAPIClient is a client that implements the +// DescribeReportDefinitions operation. +type DescribeReportDefinitionsAPIClient interface { + DescribeReportDefinitions(context.Context, *DescribeReportDefinitionsInput, ...func(*Options)) (*DescribeReportDefinitionsOutput, error) +} + +var _ DescribeReportDefinitionsAPIClient = (*Client)(nil) + +// DescribeReportDefinitionsPaginatorOptions is the paginator options for +// DescribeReportDefinitions +type DescribeReportDefinitionsPaginatorOptions struct { + // The maximum number of results that AWS returns for the operation. + 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 +} + +// DescribeReportDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costandusagereportservice.DescribeReportDefinitions +type DescribeReportDefinitionsPaginator struct { + options DescribeReportDefinitionsPaginatorOptions + client DescribeReportDefinitionsAPIClient + params *DescribeReportDefinitionsInput + nextToken *string + firstPage bool +} + +// NewDescribeReportDefinitionsPaginator returns a new +// DescribeReportDefinitionsPaginator +func NewDescribeReportDefinitionsPaginator(client DescribeReportDefinitionsAPIClient, params *DescribeReportDefinitionsInput, optFns ...func(*DescribeReportDefinitionsPaginatorOptions)) *DescribeReportDefinitionsPaginator { + options := DescribeReportDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReportDefinitionsInput{} + } + + return &DescribeReportDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReportDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReportDefinitions page. +func (p *DescribeReportDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReportDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeReportDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReportDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costandusagereportservice/endpoints.go b/service/costandusagereportservice/endpoints.go index 6d78611bb54..e340d6fe536 100644 --- a/service/costandusagereportservice/endpoints.go +++ b/service/costandusagereportservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/costexplorer/api_op_GetSavingsPlansCoverage.go b/service/costexplorer/api_op_GetSavingsPlansCoverage.go index 2328fd30a38..1312ff6cf8d 100644 --- a/service/costexplorer/api_op_GetSavingsPlansCoverage.go +++ b/service/costexplorer/api_op_GetSavingsPlansCoverage.go @@ -4,6 +4,7 @@ package costexplorer 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/costexplorer/types" @@ -170,6 +171,90 @@ func addOperationGetSavingsPlansCoverageMiddlewares(stack *middleware.Stack, opt return nil } +// GetSavingsPlansCoverageAPIClient is a client that implements the +// GetSavingsPlansCoverage operation. +type GetSavingsPlansCoverageAPIClient interface { + GetSavingsPlansCoverage(context.Context, *GetSavingsPlansCoverageInput, ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) +} + +var _ GetSavingsPlansCoverageAPIClient = (*Client)(nil) + +// GetSavingsPlansCoveragePaginatorOptions is the paginator options for +// GetSavingsPlansCoverage +type GetSavingsPlansCoveragePaginatorOptions struct { + // The number of items to be returned in a response. The default is 20, with a + // minimum value of 1. + 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 +} + +// GetSavingsPlansCoveragePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.GetSavingsPlansCoverage +type GetSavingsPlansCoveragePaginator struct { + options GetSavingsPlansCoveragePaginatorOptions + client GetSavingsPlansCoverageAPIClient + params *GetSavingsPlansCoverageInput + nextToken *string + firstPage bool +} + +// NewGetSavingsPlansCoveragePaginator returns a new +// GetSavingsPlansCoveragePaginator +func NewGetSavingsPlansCoveragePaginator(client GetSavingsPlansCoverageAPIClient, params *GetSavingsPlansCoverageInput, optFns ...func(*GetSavingsPlansCoveragePaginatorOptions)) *GetSavingsPlansCoveragePaginator { + options := GetSavingsPlansCoveragePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSavingsPlansCoverageInput{} + } + + return &GetSavingsPlansCoveragePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSavingsPlansCoveragePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSavingsPlansCoverage page. +func (p *GetSavingsPlansCoveragePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetSavingsPlansCoverage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSavingsPlansCoverage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go b/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go index 6823b5d0cfe..9bd86b24990 100644 --- a/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go +++ b/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go @@ -4,6 +4,7 @@ package costexplorer 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/costexplorer/types" @@ -157,6 +158,90 @@ func addOperationGetSavingsPlansUtilizationDetailsMiddlewares(stack *middleware. return nil } +// GetSavingsPlansUtilizationDetailsAPIClient is a client that implements the +// GetSavingsPlansUtilizationDetails operation. +type GetSavingsPlansUtilizationDetailsAPIClient interface { + GetSavingsPlansUtilizationDetails(context.Context, *GetSavingsPlansUtilizationDetailsInput, ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) +} + +var _ GetSavingsPlansUtilizationDetailsAPIClient = (*Client)(nil) + +// GetSavingsPlansUtilizationDetailsPaginatorOptions is the paginator options for +// GetSavingsPlansUtilizationDetails +type GetSavingsPlansUtilizationDetailsPaginatorOptions struct { + // The number of items to be returned in a response. The default is 20, with a + // minimum value of 1. + 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 +} + +// GetSavingsPlansUtilizationDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.GetSavingsPlansUtilizationDetails +type GetSavingsPlansUtilizationDetailsPaginator struct { + options GetSavingsPlansUtilizationDetailsPaginatorOptions + client GetSavingsPlansUtilizationDetailsAPIClient + params *GetSavingsPlansUtilizationDetailsInput + nextToken *string + firstPage bool +} + +// NewGetSavingsPlansUtilizationDetailsPaginator returns a new +// GetSavingsPlansUtilizationDetailsPaginator +func NewGetSavingsPlansUtilizationDetailsPaginator(client GetSavingsPlansUtilizationDetailsAPIClient, params *GetSavingsPlansUtilizationDetailsInput, optFns ...func(*GetSavingsPlansUtilizationDetailsPaginatorOptions)) *GetSavingsPlansUtilizationDetailsPaginator { + options := GetSavingsPlansUtilizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSavingsPlansUtilizationDetailsInput{} + } + + return &GetSavingsPlansUtilizationDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSavingsPlansUtilizationDetailsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSavingsPlansUtilizationDetails page. +func (p *GetSavingsPlansUtilizationDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetSavingsPlansUtilizationDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSavingsPlansUtilizationDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/api_op_ListCostCategoryDefinitions.go b/service/costexplorer/api_op_ListCostCategoryDefinitions.go index 70cc942f7e5..c74f9ccb8e8 100644 --- a/service/costexplorer/api_op_ListCostCategoryDefinitions.go +++ b/service/costexplorer/api_op_ListCostCategoryDefinitions.go @@ -4,6 +4,7 @@ package costexplorer 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/costexplorer/types" @@ -119,6 +120,89 @@ func addOperationListCostCategoryDefinitionsMiddlewares(stack *middleware.Stack, return nil } +// ListCostCategoryDefinitionsAPIClient is a client that implements the +// ListCostCategoryDefinitions operation. +type ListCostCategoryDefinitionsAPIClient interface { + ListCostCategoryDefinitions(context.Context, *ListCostCategoryDefinitionsInput, ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) +} + +var _ ListCostCategoryDefinitionsAPIClient = (*Client)(nil) + +// ListCostCategoryDefinitionsPaginatorOptions is the paginator options for +// ListCostCategoryDefinitions +type ListCostCategoryDefinitionsPaginatorOptions struct { + // The number of entries a paginated response contains. + 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 +} + +// ListCostCategoryDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/costexplorer.ListCostCategoryDefinitions +type ListCostCategoryDefinitionsPaginator struct { + options ListCostCategoryDefinitionsPaginatorOptions + client ListCostCategoryDefinitionsAPIClient + params *ListCostCategoryDefinitionsInput + nextToken *string + firstPage bool +} + +// NewListCostCategoryDefinitionsPaginator returns a new +// ListCostCategoryDefinitionsPaginator +func NewListCostCategoryDefinitionsPaginator(client ListCostCategoryDefinitionsAPIClient, params *ListCostCategoryDefinitionsInput, optFns ...func(*ListCostCategoryDefinitionsPaginatorOptions)) *ListCostCategoryDefinitionsPaginator { + options := ListCostCategoryDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCostCategoryDefinitionsInput{} + } + + return &ListCostCategoryDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCostCategoryDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCostCategoryDefinitions page. +func (p *ListCostCategoryDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListCostCategoryDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCostCategoryDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/costexplorer/endpoints.go b/service/costexplorer/endpoints.go index b211d36bb67..1cfd5ed40a8 100644 --- a/service/costexplorer/endpoints.go +++ b/service/costexplorer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go b/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go index b8d19ad5c09..fa2f3cce61c 100644 --- a/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go +++ b/service/databasemigrationservice/api_op_DescribeApplicableIndividualAssessments.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -156,6 +157,91 @@ func addOperationDescribeApplicableIndividualAssessmentsMiddlewares(stack *middl return nil } +// DescribeApplicableIndividualAssessmentsAPIClient is a client that implements the +// DescribeApplicableIndividualAssessments operation. +type DescribeApplicableIndividualAssessmentsAPIClient interface { + DescribeApplicableIndividualAssessments(context.Context, *DescribeApplicableIndividualAssessmentsInput, ...func(*Options)) (*DescribeApplicableIndividualAssessmentsOutput, error) +} + +var _ DescribeApplicableIndividualAssessmentsAPIClient = (*Client)(nil) + +// DescribeApplicableIndividualAssessmentsPaginatorOptions is the paginator options +// for DescribeApplicableIndividualAssessments +type DescribeApplicableIndividualAssessmentsPaginatorOptions struct { + // Maximum number of records to include in the response. If more records exist than + // the specified MaxRecords value, a pagination token called a marker is included + // in the response so that the remaining results can be retrieved. + 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 +} + +// DescribeApplicableIndividualAssessmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeApplicableIndividualAssessments +type DescribeApplicableIndividualAssessmentsPaginator struct { + options DescribeApplicableIndividualAssessmentsPaginatorOptions + client DescribeApplicableIndividualAssessmentsAPIClient + params *DescribeApplicableIndividualAssessmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeApplicableIndividualAssessmentsPaginator returns a new +// DescribeApplicableIndividualAssessmentsPaginator +func NewDescribeApplicableIndividualAssessmentsPaginator(client DescribeApplicableIndividualAssessmentsAPIClient, params *DescribeApplicableIndividualAssessmentsInput, optFns ...func(*DescribeApplicableIndividualAssessmentsPaginatorOptions)) *DescribeApplicableIndividualAssessmentsPaginator { + options := DescribeApplicableIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeApplicableIndividualAssessmentsInput{} + } + + return &DescribeApplicableIndividualAssessmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeApplicableIndividualAssessmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeApplicableIndividualAssessments page. +func (p *DescribeApplicableIndividualAssessmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeApplicableIndividualAssessmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeApplicableIndividualAssessments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeApplicableIndividualAssessments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeCertificates.go b/service/databasemigrationservice/api_op_DescribeCertificates.go index 1397aa9e430..d2f3640bccd 100644 --- a/service/databasemigrationservice/api_op_DescribeCertificates.go +++ b/service/databasemigrationservice/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -117,6 +118,91 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 10 + 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 +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeConnections.go b/service/databasemigrationservice/api_op_DescribeConnections.go index ddf891a6a53..430667cef7c 100644 --- a/service/databasemigrationservice/api_op_DescribeConnections.go +++ b/service/databasemigrationservice/api_op_DescribeConnections.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -123,6 +124,91 @@ func addOperationDescribeConnectionsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeConnectionsAPIClient is a client that implements the DescribeConnections +// operation. +type DescribeConnectionsAPIClient interface { + DescribeConnections(context.Context, *DescribeConnectionsInput, ...func(*Options)) (*DescribeConnectionsOutput, error) +} + +var _ DescribeConnectionsAPIClient = (*Client)(nil) + +// DescribeConnectionsPaginatorOptions is the paginator options for +// DescribeConnections +type DescribeConnectionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeConnections +type DescribeConnectionsPaginator struct { + options DescribeConnectionsPaginatorOptions + client DescribeConnectionsAPIClient + params *DescribeConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeConnectionsPaginator returns a new DescribeConnectionsPaginator +func NewDescribeConnectionsPaginator(client DescribeConnectionsAPIClient, params *DescribeConnectionsInput, optFns ...func(*DescribeConnectionsPaginatorOptions)) *DescribeConnectionsPaginator { + options := DescribeConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeConnectionsInput{} + } + + return &DescribeConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeConnections page. +func (p *DescribeConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEndpointTypes.go b/service/databasemigrationservice/api_op_DescribeEndpointTypes.go index 6492142aef4..0aaf652096d 100644 --- a/service/databasemigrationservice/api_op_DescribeEndpointTypes.go +++ b/service/databasemigrationservice/api_op_DescribeEndpointTypes.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -121,6 +122,91 @@ func addOperationDescribeEndpointTypesMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeEndpointTypesAPIClient is a client that implements the +// DescribeEndpointTypes operation. +type DescribeEndpointTypesAPIClient interface { + DescribeEndpointTypes(context.Context, *DescribeEndpointTypesInput, ...func(*Options)) (*DescribeEndpointTypesOutput, error) +} + +var _ DescribeEndpointTypesAPIClient = (*Client)(nil) + +// DescribeEndpointTypesPaginatorOptions is the paginator options for +// DescribeEndpointTypes +type DescribeEndpointTypesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEndpointTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEndpointTypes +type DescribeEndpointTypesPaginator struct { + options DescribeEndpointTypesPaginatorOptions + client DescribeEndpointTypesAPIClient + params *DescribeEndpointTypesInput + nextToken *string + firstPage bool +} + +// NewDescribeEndpointTypesPaginator returns a new DescribeEndpointTypesPaginator +func NewDescribeEndpointTypesPaginator(client DescribeEndpointTypesAPIClient, params *DescribeEndpointTypesInput, optFns ...func(*DescribeEndpointTypesPaginatorOptions)) *DescribeEndpointTypesPaginator { + options := DescribeEndpointTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointTypesInput{} + } + + return &DescribeEndpointTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEndpointTypes page. +func (p *DescribeEndpointTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEndpointTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpointTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEndpoints.go b/service/databasemigrationservice/api_op_DescribeEndpoints.go index 6663b9614b7..16f768e62db 100644 --- a/service/databasemigrationservice/api_op_DescribeEndpoints.go +++ b/service/databasemigrationservice/api_op_DescribeEndpoints.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -121,6 +122,90 @@ func addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeEndpointsAPIClient is a client that implements the DescribeEndpoints +// operation. +type DescribeEndpointsAPIClient interface { + DescribeEndpoints(context.Context, *DescribeEndpointsInput, ...func(*Options)) (*DescribeEndpointsOutput, error) +} + +var _ DescribeEndpointsAPIClient = (*Client)(nil) + +// DescribeEndpointsPaginatorOptions is the paginator options for DescribeEndpoints +type DescribeEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEndpoints +type DescribeEndpointsPaginator struct { + options DescribeEndpointsPaginatorOptions + client DescribeEndpointsAPIClient + params *DescribeEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointsInput{} + } + + return &DescribeEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEndpoints page. +func (p *DescribeEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go b/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go index 536f22a9cbf..f0ce76ea305 100644 --- a/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go +++ b/service/databasemigrationservice/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -126,6 +127,92 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeEvents.go b/service/databasemigrationservice/api_op_DescribeEvents.go index f4e171ec0f1..fb4b7e45b68 100644 --- a/service/databasemigrationservice/api_op_DescribeEvents.go +++ b/service/databasemigrationservice/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -144,6 +145,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go b/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go index eea289a9914..9b2b4149a12 100644 --- a/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go +++ b/service/databasemigrationservice/api_op_DescribeOrderableReplicationInstances.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -115,6 +116,92 @@ func addOperationDescribeOrderableReplicationInstancesMiddlewares(stack *middlew return nil } +// DescribeOrderableReplicationInstancesAPIClient is a client that implements the +// DescribeOrderableReplicationInstances operation. +type DescribeOrderableReplicationInstancesAPIClient interface { + DescribeOrderableReplicationInstances(context.Context, *DescribeOrderableReplicationInstancesInput, ...func(*Options)) (*DescribeOrderableReplicationInstancesOutput, error) +} + +var _ DescribeOrderableReplicationInstancesAPIClient = (*Client)(nil) + +// DescribeOrderableReplicationInstancesPaginatorOptions is the paginator options +// for DescribeOrderableReplicationInstances +type DescribeOrderableReplicationInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOrderableReplicationInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeOrderableReplicationInstances +type DescribeOrderableReplicationInstancesPaginator struct { + options DescribeOrderableReplicationInstancesPaginatorOptions + client DescribeOrderableReplicationInstancesAPIClient + params *DescribeOrderableReplicationInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableReplicationInstancesPaginator returns a new +// DescribeOrderableReplicationInstancesPaginator +func NewDescribeOrderableReplicationInstancesPaginator(client DescribeOrderableReplicationInstancesAPIClient, params *DescribeOrderableReplicationInstancesInput, optFns ...func(*DescribeOrderableReplicationInstancesPaginatorOptions)) *DescribeOrderableReplicationInstancesPaginator { + options := DescribeOrderableReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableReplicationInstancesInput{} + } + + return &DescribeOrderableReplicationInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableReplicationInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOrderableReplicationInstances page. +func (p *DescribeOrderableReplicationInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableReplicationInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOrderableReplicationInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableReplicationInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go b/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go index f232b9d4a17..189c00e4ddf 100644 --- a/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go +++ b/service/databasemigrationservice/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -123,6 +124,92 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return nil } +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go b/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go index 82d522774c6..722b9f64494 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationInstanceTaskLogs.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -124,6 +125,92 @@ func addOperationDescribeReplicationInstanceTaskLogsMiddlewares(stack *middlewar return nil } +// DescribeReplicationInstanceTaskLogsAPIClient is a client that implements the +// DescribeReplicationInstanceTaskLogs operation. +type DescribeReplicationInstanceTaskLogsAPIClient interface { + DescribeReplicationInstanceTaskLogs(context.Context, *DescribeReplicationInstanceTaskLogsInput, ...func(*Options)) (*DescribeReplicationInstanceTaskLogsOutput, error) +} + +var _ DescribeReplicationInstanceTaskLogsAPIClient = (*Client)(nil) + +// DescribeReplicationInstanceTaskLogsPaginatorOptions is the paginator options for +// DescribeReplicationInstanceTaskLogs +type DescribeReplicationInstanceTaskLogsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReplicationInstanceTaskLogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationInstanceTaskLogs +type DescribeReplicationInstanceTaskLogsPaginator struct { + options DescribeReplicationInstanceTaskLogsPaginatorOptions + client DescribeReplicationInstanceTaskLogsAPIClient + params *DescribeReplicationInstanceTaskLogsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationInstanceTaskLogsPaginator returns a new +// DescribeReplicationInstanceTaskLogsPaginator +func NewDescribeReplicationInstanceTaskLogsPaginator(client DescribeReplicationInstanceTaskLogsAPIClient, params *DescribeReplicationInstanceTaskLogsInput, optFns ...func(*DescribeReplicationInstanceTaskLogsPaginatorOptions)) *DescribeReplicationInstanceTaskLogsPaginator { + options := DescribeReplicationInstanceTaskLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationInstanceTaskLogsInput{} + } + + return &DescribeReplicationInstanceTaskLogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationInstanceTaskLogsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationInstanceTaskLogs page. +func (p *DescribeReplicationInstanceTaskLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationInstanceTaskLogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationInstanceTaskLogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationInstanceTaskLogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationInstances.go b/service/databasemigrationservice/api_op_DescribeReplicationInstances.go index 4a24d9ede2a..7412d104064 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationInstances.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationInstances.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -123,6 +124,92 @@ func addOperationDescribeReplicationInstancesMiddlewares(stack *middleware.Stack return nil } +// DescribeReplicationInstancesAPIClient is a client that implements the +// DescribeReplicationInstances operation. +type DescribeReplicationInstancesAPIClient interface { + DescribeReplicationInstances(context.Context, *DescribeReplicationInstancesInput, ...func(*Options)) (*DescribeReplicationInstancesOutput, error) +} + +var _ DescribeReplicationInstancesAPIClient = (*Client)(nil) + +// DescribeReplicationInstancesPaginatorOptions is the paginator options for +// DescribeReplicationInstances +type DescribeReplicationInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReplicationInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationInstances +type DescribeReplicationInstancesPaginator struct { + options DescribeReplicationInstancesPaginatorOptions + client DescribeReplicationInstancesAPIClient + params *DescribeReplicationInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationInstancesPaginator returns a new +// DescribeReplicationInstancesPaginator +func NewDescribeReplicationInstancesPaginator(client DescribeReplicationInstancesAPIClient, params *DescribeReplicationInstancesInput, optFns ...func(*DescribeReplicationInstancesPaginatorOptions)) *DescribeReplicationInstancesPaginator { + options := DescribeReplicationInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationInstancesInput{} + } + + return &DescribeReplicationInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationInstances page. +func (p *DescribeReplicationInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go b/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go index a05db334919..647081d7f9d 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationSubnetGroups.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -121,6 +122,92 @@ func addOperationDescribeReplicationSubnetGroupsMiddlewares(stack *middleware.St return nil } +// DescribeReplicationSubnetGroupsAPIClient is a client that implements the +// DescribeReplicationSubnetGroups operation. +type DescribeReplicationSubnetGroupsAPIClient interface { + DescribeReplicationSubnetGroups(context.Context, *DescribeReplicationSubnetGroupsInput, ...func(*Options)) (*DescribeReplicationSubnetGroupsOutput, error) +} + +var _ DescribeReplicationSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeReplicationSubnetGroupsPaginatorOptions is the paginator options for +// DescribeReplicationSubnetGroups +type DescribeReplicationSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReplicationSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationSubnetGroups +type DescribeReplicationSubnetGroupsPaginator struct { + options DescribeReplicationSubnetGroupsPaginatorOptions + client DescribeReplicationSubnetGroupsAPIClient + params *DescribeReplicationSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationSubnetGroupsPaginator returns a new +// DescribeReplicationSubnetGroupsPaginator +func NewDescribeReplicationSubnetGroupsPaginator(client DescribeReplicationSubnetGroupsAPIClient, params *DescribeReplicationSubnetGroupsInput, optFns ...func(*DescribeReplicationSubnetGroupsPaginatorOptions)) *DescribeReplicationSubnetGroupsPaginator { + options := DescribeReplicationSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationSubnetGroupsInput{} + } + + return &DescribeReplicationSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationSubnetGroups page. +func (p *DescribeReplicationSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go index d24bc667759..559b9bb8a15 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentResults.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -123,6 +124,92 @@ func addOperationDescribeReplicationTaskAssessmentResultsMiddlewares(stack *midd return nil } +// DescribeReplicationTaskAssessmentResultsAPIClient is a client that implements +// the DescribeReplicationTaskAssessmentResults operation. +type DescribeReplicationTaskAssessmentResultsAPIClient interface { + DescribeReplicationTaskAssessmentResults(context.Context, *DescribeReplicationTaskAssessmentResultsInput, ...func(*Options)) (*DescribeReplicationTaskAssessmentResultsOutput, error) +} + +var _ DescribeReplicationTaskAssessmentResultsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskAssessmentResultsPaginatorOptions is the paginator +// options for DescribeReplicationTaskAssessmentResults +type DescribeReplicationTaskAssessmentResultsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReplicationTaskAssessmentResultsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskAssessmentResults +type DescribeReplicationTaskAssessmentResultsPaginator struct { + options DescribeReplicationTaskAssessmentResultsPaginatorOptions + client DescribeReplicationTaskAssessmentResultsAPIClient + params *DescribeReplicationTaskAssessmentResultsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationTaskAssessmentResultsPaginator returns a new +// DescribeReplicationTaskAssessmentResultsPaginator +func NewDescribeReplicationTaskAssessmentResultsPaginator(client DescribeReplicationTaskAssessmentResultsAPIClient, params *DescribeReplicationTaskAssessmentResultsInput, optFns ...func(*DescribeReplicationTaskAssessmentResultsPaginatorOptions)) *DescribeReplicationTaskAssessmentResultsPaginator { + options := DescribeReplicationTaskAssessmentResultsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskAssessmentResultsInput{} + } + + return &DescribeReplicationTaskAssessmentResultsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskAssessmentResultsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationTaskAssessmentResults page. +func (p *DescribeReplicationTaskAssessmentResultsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskAssessmentResultsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationTaskAssessmentResults(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskAssessmentResults(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go index a9f6de209c9..95700f29209 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskAssessmentRuns.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -127,6 +128,91 @@ func addOperationDescribeReplicationTaskAssessmentRunsMiddlewares(stack *middlew return nil } +// DescribeReplicationTaskAssessmentRunsAPIClient is a client that implements the +// DescribeReplicationTaskAssessmentRuns operation. +type DescribeReplicationTaskAssessmentRunsAPIClient interface { + DescribeReplicationTaskAssessmentRuns(context.Context, *DescribeReplicationTaskAssessmentRunsInput, ...func(*Options)) (*DescribeReplicationTaskAssessmentRunsOutput, error) +} + +var _ DescribeReplicationTaskAssessmentRunsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskAssessmentRunsPaginatorOptions is the paginator options +// for DescribeReplicationTaskAssessmentRuns +type DescribeReplicationTaskAssessmentRunsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + 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 +} + +// DescribeReplicationTaskAssessmentRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskAssessmentRuns +type DescribeReplicationTaskAssessmentRunsPaginator struct { + options DescribeReplicationTaskAssessmentRunsPaginatorOptions + client DescribeReplicationTaskAssessmentRunsAPIClient + params *DescribeReplicationTaskAssessmentRunsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationTaskAssessmentRunsPaginator returns a new +// DescribeReplicationTaskAssessmentRunsPaginator +func NewDescribeReplicationTaskAssessmentRunsPaginator(client DescribeReplicationTaskAssessmentRunsAPIClient, params *DescribeReplicationTaskAssessmentRunsInput, optFns ...func(*DescribeReplicationTaskAssessmentRunsPaginatorOptions)) *DescribeReplicationTaskAssessmentRunsPaginator { + options := DescribeReplicationTaskAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskAssessmentRunsInput{} + } + + return &DescribeReplicationTaskAssessmentRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskAssessmentRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationTaskAssessmentRuns page. +func (p *DescribeReplicationTaskAssessmentRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskAssessmentRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationTaskAssessmentRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go b/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go index 2c01216e14b..f3ecb139391 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTaskIndividualAssessments.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -124,6 +125,91 @@ func addOperationDescribeReplicationTaskIndividualAssessmentsMiddlewares(stack * return nil } +// DescribeReplicationTaskIndividualAssessmentsAPIClient is a client that +// implements the DescribeReplicationTaskIndividualAssessments operation. +type DescribeReplicationTaskIndividualAssessmentsAPIClient interface { + DescribeReplicationTaskIndividualAssessments(context.Context, *DescribeReplicationTaskIndividualAssessmentsInput, ...func(*Options)) (*DescribeReplicationTaskIndividualAssessmentsOutput, error) +} + +var _ DescribeReplicationTaskIndividualAssessmentsAPIClient = (*Client)(nil) + +// DescribeReplicationTaskIndividualAssessmentsPaginatorOptions is the paginator +// options for DescribeReplicationTaskIndividualAssessments +type DescribeReplicationTaskIndividualAssessmentsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + 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 +} + +// DescribeReplicationTaskIndividualAssessmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTaskIndividualAssessments +type DescribeReplicationTaskIndividualAssessmentsPaginator struct { + options DescribeReplicationTaskIndividualAssessmentsPaginatorOptions + client DescribeReplicationTaskIndividualAssessmentsAPIClient + params *DescribeReplicationTaskIndividualAssessmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationTaskIndividualAssessmentsPaginator returns a new +// DescribeReplicationTaskIndividualAssessmentsPaginator +func NewDescribeReplicationTaskIndividualAssessmentsPaginator(client DescribeReplicationTaskIndividualAssessmentsAPIClient, params *DescribeReplicationTaskIndividualAssessmentsInput, optFns ...func(*DescribeReplicationTaskIndividualAssessmentsPaginatorOptions)) *DescribeReplicationTaskIndividualAssessmentsPaginator { + options := DescribeReplicationTaskIndividualAssessmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTaskIndividualAssessmentsInput{} + } + + return &DescribeReplicationTaskIndividualAssessmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTaskIndividualAssessmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationTaskIndividualAssessments page. +func (p *DescribeReplicationTaskIndividualAssessmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTaskIndividualAssessmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationTaskIndividualAssessments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTaskIndividualAssessments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeReplicationTasks.go b/service/databasemigrationservice/api_op_DescribeReplicationTasks.go index de51ac1d8e0..bb45e11d110 100644 --- a/service/databasemigrationservice/api_op_DescribeReplicationTasks.go +++ b/service/databasemigrationservice/api_op_DescribeReplicationTasks.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -127,6 +128,92 @@ func addOperationDescribeReplicationTasksMiddlewares(stack *middleware.Stack, op return nil } +// DescribeReplicationTasksAPIClient is a client that implements the +// DescribeReplicationTasks operation. +type DescribeReplicationTasksAPIClient interface { + DescribeReplicationTasks(context.Context, *DescribeReplicationTasksInput, ...func(*Options)) (*DescribeReplicationTasksOutput, error) +} + +var _ DescribeReplicationTasksAPIClient = (*Client)(nil) + +// DescribeReplicationTasksPaginatorOptions is the paginator options for +// DescribeReplicationTasks +type DescribeReplicationTasksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReplicationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeReplicationTasks +type DescribeReplicationTasksPaginator struct { + options DescribeReplicationTasksPaginatorOptions + client DescribeReplicationTasksAPIClient + params *DescribeReplicationTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationTasksPaginator returns a new +// DescribeReplicationTasksPaginator +func NewDescribeReplicationTasksPaginator(client DescribeReplicationTasksAPIClient, params *DescribeReplicationTasksInput, optFns ...func(*DescribeReplicationTasksPaginatorOptions)) *DescribeReplicationTasksPaginator { + options := DescribeReplicationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationTasksInput{} + } + + return &DescribeReplicationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationTasks page. +func (p *DescribeReplicationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeSchemas.go b/service/databasemigrationservice/api_op_DescribeSchemas.go index 067db691dbc..d707d89458b 100644 --- a/service/databasemigrationservice/api_op_DescribeSchemas.go +++ b/service/databasemigrationservice/api_op_DescribeSchemas.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/awslabs/smithy-go/middleware" @@ -121,6 +122,90 @@ func addOperationDescribeSchemasMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeSchemasAPIClient is a client that implements the DescribeSchemas +// operation. +type DescribeSchemasAPIClient interface { + DescribeSchemas(context.Context, *DescribeSchemasInput, ...func(*Options)) (*DescribeSchemasOutput, error) +} + +var _ DescribeSchemasAPIClient = (*Client)(nil) + +// DescribeSchemasPaginatorOptions is the paginator options for DescribeSchemas +type DescribeSchemasPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeSchemas +type DescribeSchemasPaginator struct { + options DescribeSchemasPaginatorOptions + client DescribeSchemasAPIClient + params *DescribeSchemasInput + nextToken *string + firstPage bool +} + +// NewDescribeSchemasPaginator returns a new DescribeSchemasPaginator +func NewDescribeSchemasPaginator(client DescribeSchemasAPIClient, params *DescribeSchemasInput, optFns ...func(*DescribeSchemasPaginatorOptions)) *DescribeSchemasPaginator { + options := DescribeSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSchemasInput{} + } + + return &DescribeSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSchemasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSchemas page. +func (p *DescribeSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/api_op_DescribeTableStatistics.go b/service/databasemigrationservice/api_op_DescribeTableStatistics.go index 3453ca7df81..c6d4c16bc61 100644 --- a/service/databasemigrationservice/api_op_DescribeTableStatistics.go +++ b/service/databasemigrationservice/api_op_DescribeTableStatistics.go @@ -4,6 +4,7 @@ package databasemigrationservice 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/databasemigrationservice/types" @@ -134,6 +135,92 @@ func addOperationDescribeTableStatisticsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeTableStatisticsAPIClient is a client that implements the +// DescribeTableStatistics operation. +type DescribeTableStatisticsAPIClient interface { + DescribeTableStatistics(context.Context, *DescribeTableStatisticsInput, ...func(*Options)) (*DescribeTableStatisticsOutput, error) +} + +var _ DescribeTableStatisticsAPIClient = (*Client)(nil) + +// DescribeTableStatisticsPaginatorOptions is the paginator options for +// DescribeTableStatistics +type DescribeTableStatisticsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 500. + 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 +} + +// DescribeTableStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/databasemigrationservice.DescribeTableStatistics +type DescribeTableStatisticsPaginator struct { + options DescribeTableStatisticsPaginatorOptions + client DescribeTableStatisticsAPIClient + params *DescribeTableStatisticsInput + nextToken *string + firstPage bool +} + +// NewDescribeTableStatisticsPaginator returns a new +// DescribeTableStatisticsPaginator +func NewDescribeTableStatisticsPaginator(client DescribeTableStatisticsAPIClient, params *DescribeTableStatisticsInput, optFns ...func(*DescribeTableStatisticsPaginatorOptions)) *DescribeTableStatisticsPaginator { + options := DescribeTableStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTableStatisticsInput{} + } + + return &DescribeTableStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTableStatisticsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTableStatistics page. +func (p *DescribeTableStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTableStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeTableStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTableStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/databasemigrationservice/endpoints.go b/service/databasemigrationservice/endpoints.go index 09fd7f17d2b..38f09bf81c8 100644 --- a/service/databasemigrationservice/endpoints.go +++ b/service/databasemigrationservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/dataexchange/api_op_ListDataSetRevisions.go b/service/dataexchange/api_op_ListDataSetRevisions.go index 98d6c21786c..078ba6247f2 100644 --- a/service/dataexchange/api_op_ListDataSetRevisions.go +++ b/service/dataexchange/api_op_ListDataSetRevisions.go @@ -4,6 +4,7 @@ package dataexchange 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/dataexchange/types" @@ -116,6 +117,88 @@ func addOperationListDataSetRevisionsMiddlewares(stack *middleware.Stack, option return nil } +// ListDataSetRevisionsAPIClient is a client that implements the +// ListDataSetRevisions operation. +type ListDataSetRevisionsAPIClient interface { + ListDataSetRevisions(context.Context, *ListDataSetRevisionsInput, ...func(*Options)) (*ListDataSetRevisionsOutput, error) +} + +var _ ListDataSetRevisionsAPIClient = (*Client)(nil) + +// ListDataSetRevisionsPaginatorOptions is the paginator options for +// ListDataSetRevisions +type ListDataSetRevisionsPaginatorOptions struct { + // The maximum number of results returned by a single call. + 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 +} + +// ListDataSetRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListDataSetRevisions +type ListDataSetRevisionsPaginator struct { + options ListDataSetRevisionsPaginatorOptions + client ListDataSetRevisionsAPIClient + params *ListDataSetRevisionsInput + nextToken *string + firstPage bool +} + +// NewListDataSetRevisionsPaginator returns a new ListDataSetRevisionsPaginator +func NewListDataSetRevisionsPaginator(client ListDataSetRevisionsAPIClient, params *ListDataSetRevisionsInput, optFns ...func(*ListDataSetRevisionsPaginatorOptions)) *ListDataSetRevisionsPaginator { + options := ListDataSetRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetRevisionsInput{} + } + + return &ListDataSetRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetRevisionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSetRevisions page. +func (p *ListDataSetRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDataSetRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSetRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListDataSets.go b/service/dataexchange/api_op_ListDataSets.go index e0c5896e4fb..a55e1d7c1f0 100644 --- a/service/dataexchange/api_op_ListDataSets.go +++ b/service/dataexchange/api_op_ListDataSets.go @@ -4,6 +4,7 @@ package dataexchange 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/dataexchange/types" @@ -113,6 +114,86 @@ func addOperationListDataSetsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListDataSetsAPIClient is a client that implements the ListDataSets operation. +type ListDataSetsAPIClient interface { + ListDataSets(context.Context, *ListDataSetsInput, ...func(*Options)) (*ListDataSetsOutput, error) +} + +var _ ListDataSetsAPIClient = (*Client)(nil) + +// ListDataSetsPaginatorOptions is the paginator options for ListDataSets +type ListDataSetsPaginatorOptions struct { + // The maximum number of results returned by a single call. + 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 +} + +// ListDataSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListDataSets +type ListDataSetsPaginator struct { + options ListDataSetsPaginatorOptions + client ListDataSetsAPIClient + params *ListDataSetsInput + nextToken *string + firstPage bool +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetsInput{} + } + + return &ListDataSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSets page. +func (p *ListDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDataSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListJobs.go b/service/dataexchange/api_op_ListJobs.go index f5119b9f325..2343360b45c 100644 --- a/service/dataexchange/api_op_ListJobs.go +++ b/service/dataexchange/api_op_ListJobs.go @@ -4,6 +4,7 @@ package dataexchange 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/dataexchange/types" @@ -113,6 +114,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results returned by a single call. + 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/api_op_ListRevisionAssets.go b/service/dataexchange/api_op_ListRevisionAssets.go index 8d9089f2b90..83e2ef91ed6 100644 --- a/service/dataexchange/api_op_ListRevisionAssets.go +++ b/service/dataexchange/api_op_ListRevisionAssets.go @@ -4,6 +4,7 @@ package dataexchange 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/dataexchange/types" @@ -121,6 +122,88 @@ func addOperationListRevisionAssetsMiddlewares(stack *middleware.Stack, options return nil } +// ListRevisionAssetsAPIClient is a client that implements the ListRevisionAssets +// operation. +type ListRevisionAssetsAPIClient interface { + ListRevisionAssets(context.Context, *ListRevisionAssetsInput, ...func(*Options)) (*ListRevisionAssetsOutput, error) +} + +var _ ListRevisionAssetsAPIClient = (*Client)(nil) + +// ListRevisionAssetsPaginatorOptions is the paginator options for +// ListRevisionAssets +type ListRevisionAssetsPaginatorOptions struct { + // The maximum number of results returned by a single call. + 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 +} + +// ListRevisionAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dataexchange.ListRevisionAssets +type ListRevisionAssetsPaginator struct { + options ListRevisionAssetsPaginatorOptions + client ListRevisionAssetsAPIClient + params *ListRevisionAssetsInput + nextToken *string + firstPage bool +} + +// NewListRevisionAssetsPaginator returns a new ListRevisionAssetsPaginator +func NewListRevisionAssetsPaginator(client ListRevisionAssetsAPIClient, params *ListRevisionAssetsInput, optFns ...func(*ListRevisionAssetsPaginatorOptions)) *ListRevisionAssetsPaginator { + options := ListRevisionAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRevisionAssetsInput{} + } + + return &ListRevisionAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRevisionAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRevisionAssets page. +func (p *ListRevisionAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRevisionAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListRevisionAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRevisionAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dataexchange/endpoints.go b/service/dataexchange/endpoints.go index e4549d05814..39edfc9ce69 100644 --- a/service/dataexchange/endpoints.go +++ b/service/dataexchange/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/datapipeline/api_op_DescribeObjects.go b/service/datapipeline/api_op_DescribeObjects.go index 0837b6f767b..249162c4e7d 100644 --- a/service/datapipeline/api_op_DescribeObjects.go +++ b/service/datapipeline/api_op_DescribeObjects.go @@ -4,6 +4,7 @@ package datapipeline 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/datapipeline/types" @@ -134,6 +135,80 @@ func addOperationDescribeObjectsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeObjectsAPIClient is a client that implements the DescribeObjects +// operation. +type DescribeObjectsAPIClient interface { + DescribeObjects(context.Context, *DescribeObjectsInput, ...func(*Options)) (*DescribeObjectsOutput, error) +} + +var _ DescribeObjectsAPIClient = (*Client)(nil) + +// DescribeObjectsPaginatorOptions is the paginator options for DescribeObjects +type DescribeObjectsPaginatorOptions struct { + // 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 +} + +// DescribeObjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.DescribeObjects +type DescribeObjectsPaginator struct { + options DescribeObjectsPaginatorOptions + client DescribeObjectsAPIClient + params *DescribeObjectsInput + nextToken *string + firstPage bool +} + +// NewDescribeObjectsPaginator returns a new DescribeObjectsPaginator +func NewDescribeObjectsPaginator(client DescribeObjectsAPIClient, params *DescribeObjectsInput, optFns ...func(*DescribeObjectsPaginatorOptions)) *DescribeObjectsPaginator { + options := DescribeObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeObjectsInput{} + } + + return &DescribeObjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeObjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeObjects page. +func (p *DescribeObjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeObjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeObjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeObjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/api_op_ListPipelines.go b/service/datapipeline/api_op_ListPipelines.go index a010ac486b6..c48f5f041e8 100644 --- a/service/datapipeline/api_op_ListPipelines.go +++ b/service/datapipeline/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package datapipeline 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/datapipeline/types" @@ -118,6 +119,79 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // 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 +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/api_op_QueryObjects.go b/service/datapipeline/api_op_QueryObjects.go index be61b935517..9a893c5df09 100644 --- a/service/datapipeline/api_op_QueryObjects.go +++ b/service/datapipeline/api_op_QueryObjects.go @@ -4,6 +4,7 @@ package datapipeline 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/datapipeline/types" @@ -138,6 +139,87 @@ func addOperationQueryObjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// QueryObjectsAPIClient is a client that implements the QueryObjects operation. +type QueryObjectsAPIClient interface { + QueryObjects(context.Context, *QueryObjectsInput, ...func(*Options)) (*QueryObjectsOutput, error) +} + +var _ QueryObjectsAPIClient = (*Client)(nil) + +// QueryObjectsPaginatorOptions is the paginator options for QueryObjects +type QueryObjectsPaginatorOptions struct { + // The maximum number of object names that QueryObjects will return in a single + // call. The default value is 100. + 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 +} + +// QueryObjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datapipeline.QueryObjects +type QueryObjectsPaginator struct { + options QueryObjectsPaginatorOptions + client QueryObjectsAPIClient + params *QueryObjectsInput + nextToken *string + firstPage bool +} + +// NewQueryObjectsPaginator returns a new QueryObjectsPaginator +func NewQueryObjectsPaginator(client QueryObjectsAPIClient, params *QueryObjectsInput, optFns ...func(*QueryObjectsPaginatorOptions)) *QueryObjectsPaginator { + options := QueryObjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &QueryObjectsInput{} + } + + return &QueryObjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *QueryObjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next QueryObjects page. +func (p *QueryObjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*QueryObjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.QueryObjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opQueryObjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datapipeline/endpoints.go b/service/datapipeline/endpoints.go index ffb75f7223f..ca07890ce48 100644 --- a/service/datapipeline/endpoints.go +++ b/service/datapipeline/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/datasync/api_op_ListAgents.go b/service/datasync/api_op_ListAgents.go index 44d38c81900..43e1f1a632f 100644 --- a/service/datasync/api_op_ListAgents.go +++ b/service/datasync/api_op_ListAgents.go @@ -4,6 +4,7 @@ package datasync 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/datasync/types" @@ -116,6 +117,86 @@ func addOperationListAgentsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListAgentsAPIClient is a client that implements the ListAgents operation. +type ListAgentsAPIClient interface { + ListAgents(context.Context, *ListAgentsInput, ...func(*Options)) (*ListAgentsOutput, error) +} + +var _ ListAgentsAPIClient = (*Client)(nil) + +// ListAgentsPaginatorOptions is the paginator options for ListAgents +type ListAgentsPaginatorOptions struct { + // The maximum number of agents to list. + 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 +} + +// ListAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListAgents +type ListAgentsPaginator struct { + options ListAgentsPaginatorOptions + client ListAgentsAPIClient + params *ListAgentsInput + nextToken *string + firstPage bool +} + +// NewListAgentsPaginator returns a new ListAgentsPaginator +func NewListAgentsPaginator(client ListAgentsAPIClient, params *ListAgentsInput, optFns ...func(*ListAgentsPaginatorOptions)) *ListAgentsPaginator { + options := ListAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAgentsInput{} + } + + return &ListAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAgentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAgents page. +func (p *ListAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListLocations.go b/service/datasync/api_op_ListLocations.go index ac1f01fd907..541c665ab36 100644 --- a/service/datasync/api_op_ListLocations.go +++ b/service/datasync/api_op_ListLocations.go @@ -4,6 +4,7 @@ package datasync 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/datasync/types" @@ -120,6 +121,86 @@ func addOperationListLocationsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListLocationsAPIClient is a client that implements the ListLocations operation. +type ListLocationsAPIClient interface { + ListLocations(context.Context, *ListLocationsInput, ...func(*Options)) (*ListLocationsOutput, error) +} + +var _ ListLocationsAPIClient = (*Client)(nil) + +// ListLocationsPaginatorOptions is the paginator options for ListLocations +type ListLocationsPaginatorOptions struct { + // The maximum number of locations 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 +} + +// ListLocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListLocations +type ListLocationsPaginator struct { + options ListLocationsPaginatorOptions + client ListLocationsAPIClient + params *ListLocationsInput + nextToken *string + firstPage bool +} + +// NewListLocationsPaginator returns a new ListLocationsPaginator +func NewListLocationsPaginator(client ListLocationsAPIClient, params *ListLocationsInput, optFns ...func(*ListLocationsPaginatorOptions)) *ListLocationsPaginator { + options := ListLocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLocationsInput{} + } + + return &ListLocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLocationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLocations page. +func (p *ListLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTagsForResource.go b/service/datasync/api_op_ListTagsForResource.go index d428393df69..0274453c075 100644 --- a/service/datasync/api_op_ListTagsForResource.go +++ b/service/datasync/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package datasync 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/datasync/types" @@ -117,6 +118,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of locations 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTaskExecutions.go b/service/datasync/api_op_ListTaskExecutions.go index 66bc4a51900..af1d6566596 100644 --- a/service/datasync/api_op_ListTaskExecutions.go +++ b/service/datasync/api_op_ListTaskExecutions.go @@ -4,6 +4,7 @@ package datasync 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/datasync/types" @@ -112,6 +113,88 @@ func addOperationListTaskExecutionsMiddlewares(stack *middleware.Stack, options return nil } +// ListTaskExecutionsAPIClient is a client that implements the ListTaskExecutions +// operation. +type ListTaskExecutionsAPIClient interface { + ListTaskExecutions(context.Context, *ListTaskExecutionsInput, ...func(*Options)) (*ListTaskExecutionsOutput, error) +} + +var _ ListTaskExecutionsAPIClient = (*Client)(nil) + +// ListTaskExecutionsPaginatorOptions is the paginator options for +// ListTaskExecutions +type ListTaskExecutionsPaginatorOptions struct { + // The maximum number of executed tasks to list. + 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 +} + +// ListTaskExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTaskExecutions +type ListTaskExecutionsPaginator struct { + options ListTaskExecutionsPaginatorOptions + client ListTaskExecutionsAPIClient + params *ListTaskExecutionsInput + nextToken *string + firstPage bool +} + +// NewListTaskExecutionsPaginator returns a new ListTaskExecutionsPaginator +func NewListTaskExecutionsPaginator(client ListTaskExecutionsAPIClient, params *ListTaskExecutionsInput, optFns ...func(*ListTaskExecutionsPaginatorOptions)) *ListTaskExecutionsPaginator { + options := ListTaskExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskExecutionsInput{} + } + + return &ListTaskExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTaskExecutions page. +func (p *ListTaskExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTaskExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/api_op_ListTasks.go b/service/datasync/api_op_ListTasks.go index 3f6d2cd7519..39f4a40420c 100644 --- a/service/datasync/api_op_ListTasks.go +++ b/service/datasync/api_op_ListTasks.go @@ -4,6 +4,7 @@ package datasync 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/datasync/types" @@ -118,6 +119,86 @@ func addOperationListTasksMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTasksAPIClient is a client that implements the ListTasks operation. +type ListTasksAPIClient interface { + ListTasks(context.Context, *ListTasksInput, ...func(*Options)) (*ListTasksOutput, error) +} + +var _ ListTasksAPIClient = (*Client)(nil) + +// ListTasksPaginatorOptions is the paginator options for ListTasks +type ListTasksPaginatorOptions struct { + // The maximum number of tasks 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 +} + +// ListTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/datasync.ListTasks +type ListTasksPaginator struct { + options ListTasksPaginatorOptions + client ListTasksAPIClient + params *ListTasksInput + nextToken *string + firstPage bool +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTasksInput{} + } + + return &ListTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTasks page. +func (p *ListTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/datasync/endpoints.go b/service/datasync/endpoints.go index 3617863ffc5..9e5d9a0f054 100644 --- a/service/datasync/endpoints.go +++ b/service/datasync/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/dax/endpoints.go b/service/dax/endpoints.go index 35557d884ec..67cbe2c3821 100644 --- a/service/dax/endpoints.go +++ b/service/dax/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/detective/api_op_ListGraphs.go b/service/detective/api_op_ListGraphs.go index 389f000119f..4a8acb91d5e 100644 --- a/service/detective/api_op_ListGraphs.go +++ b/service/detective/api_op_ListGraphs.go @@ -4,6 +4,7 @@ package detective 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/detective/types" @@ -112,6 +113,87 @@ func addOperationListGraphsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGraphsAPIClient is a client that implements the ListGraphs operation. +type ListGraphsAPIClient interface { + ListGraphs(context.Context, *ListGraphsInput, ...func(*Options)) (*ListGraphsOutput, error) +} + +var _ ListGraphsAPIClient = (*Client)(nil) + +// ListGraphsPaginatorOptions is the paginator options for ListGraphs +type ListGraphsPaginatorOptions struct { + // The maximum number of graphs to return at a time. The total must be less than + // the overall limit on the number of results to return, which is currently 200. + 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 +} + +// ListGraphsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListGraphs +type ListGraphsPaginator struct { + options ListGraphsPaginatorOptions + client ListGraphsAPIClient + params *ListGraphsInput + nextToken *string + firstPage bool +} + +// NewListGraphsPaginator returns a new ListGraphsPaginator +func NewListGraphsPaginator(client ListGraphsAPIClient, params *ListGraphsInput, optFns ...func(*ListGraphsPaginatorOptions)) *ListGraphsPaginator { + options := ListGraphsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGraphsInput{} + } + + return &ListGraphsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGraphsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGraphs page. +func (p *ListGraphsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGraphsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGraphs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGraphs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/api_op_ListInvitations.go b/service/detective/api_op_ListInvitations.go index b798f55271e..8fbc3afeb70 100644 --- a/service/detective/api_op_ListInvitations.go +++ b/service/detective/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package detective 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/detective/types" @@ -116,6 +117,89 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of behavior graph invitations to return in the response. The + // total must be less than the overall limit on the number of results to return, + // which is currently 200. + 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 +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/api_op_ListMembers.go b/service/detective/api_op_ListMembers.go index d2f490c87c1..d6acd2a185b 100644 --- a/service/detective/api_op_ListMembers.go +++ b/service/detective/api_op_ListMembers.go @@ -4,6 +4,7 @@ package detective 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/detective/types" @@ -122,6 +123,88 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of member accounts to include in the response. The total must + // be less than the overall limit on the number of results to return, which is + // currently 200. + 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 +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/detective.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/detective/endpoints.go b/service/detective/endpoints.go index 80082155d2f..d24311b0921 100644 --- a/service/detective/endpoints.go +++ b/service/detective/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/devicefarm/api_op_GetOfferingStatus.go b/service/devicefarm/api_op_GetOfferingStatus.go index 5bedb4ebdd0..a2099d3bc3e 100644 --- a/service/devicefarm/api_op_GetOfferingStatus.go +++ b/service/devicefarm/api_op_GetOfferingStatus.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,80 @@ func addOperationGetOfferingStatusMiddlewares(stack *middleware.Stack, options O return nil } +// GetOfferingStatusAPIClient is a client that implements the GetOfferingStatus +// operation. +type GetOfferingStatusAPIClient interface { + GetOfferingStatus(context.Context, *GetOfferingStatusInput, ...func(*Options)) (*GetOfferingStatusOutput, error) +} + +var _ GetOfferingStatusAPIClient = (*Client)(nil) + +// GetOfferingStatusPaginatorOptions is the paginator options for GetOfferingStatus +type GetOfferingStatusPaginatorOptions struct { + // 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 +} + +// GetOfferingStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.GetOfferingStatus +type GetOfferingStatusPaginator struct { + options GetOfferingStatusPaginatorOptions + client GetOfferingStatusAPIClient + params *GetOfferingStatusInput + nextToken *string + firstPage bool +} + +// NewGetOfferingStatusPaginator returns a new GetOfferingStatusPaginator +func NewGetOfferingStatusPaginator(client GetOfferingStatusAPIClient, params *GetOfferingStatusInput, optFns ...func(*GetOfferingStatusPaginatorOptions)) *GetOfferingStatusPaginator { + options := GetOfferingStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOfferingStatusInput{} + } + + return &GetOfferingStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOfferingStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetOfferingStatus page. +func (p *GetOfferingStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOfferingStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetOfferingStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOfferingStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListArtifacts.go b/service/devicefarm/api_op_ListArtifacts.go index 8b3d9707c97..f244b4170f7 100644 --- a/service/devicefarm/api_op_ListArtifacts.go +++ b/service/devicefarm/api_op_ListArtifacts.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -126,6 +127,79 @@ func addOperationListArtifactsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListArtifactsAPIClient is a client that implements the ListArtifacts operation. +type ListArtifactsAPIClient interface { + ListArtifacts(context.Context, *ListArtifactsInput, ...func(*Options)) (*ListArtifactsOutput, error) +} + +var _ ListArtifactsAPIClient = (*Client)(nil) + +// ListArtifactsPaginatorOptions is the paginator options for ListArtifacts +type ListArtifactsPaginatorOptions struct { + // 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 +} + +// ListArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListArtifacts +type ListArtifactsPaginator struct { + options ListArtifactsPaginatorOptions + client ListArtifactsAPIClient + params *ListArtifactsInput + nextToken *string + firstPage bool +} + +// NewListArtifactsPaginator returns a new ListArtifactsPaginator +func NewListArtifactsPaginator(client ListArtifactsAPIClient, params *ListArtifactsInput, optFns ...func(*ListArtifactsPaginatorOptions)) *ListArtifactsPaginator { + options := ListArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListArtifactsInput{} + } + + return &ListArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListArtifactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListArtifacts page. +func (p *ListArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListDevicePools.go b/service/devicefarm/api_op_ListDevicePools.go index 8ec8e8cb5a2..a0cb6607f6f 100644 --- a/service/devicefarm/api_op_ListDevicePools.go +++ b/service/devicefarm/api_op_ListDevicePools.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -124,6 +125,80 @@ func addOperationListDevicePoolsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDevicePoolsAPIClient is a client that implements the ListDevicePools +// operation. +type ListDevicePoolsAPIClient interface { + ListDevicePools(context.Context, *ListDevicePoolsInput, ...func(*Options)) (*ListDevicePoolsOutput, error) +} + +var _ ListDevicePoolsAPIClient = (*Client)(nil) + +// ListDevicePoolsPaginatorOptions is the paginator options for ListDevicePools +type ListDevicePoolsPaginatorOptions struct { + // 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 +} + +// ListDevicePoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListDevicePools +type ListDevicePoolsPaginator struct { + options ListDevicePoolsPaginatorOptions + client ListDevicePoolsAPIClient + params *ListDevicePoolsInput + nextToken *string + firstPage bool +} + +// NewListDevicePoolsPaginator returns a new ListDevicePoolsPaginator +func NewListDevicePoolsPaginator(client ListDevicePoolsAPIClient, params *ListDevicePoolsInput, optFns ...func(*ListDevicePoolsPaginatorOptions)) *ListDevicePoolsPaginator { + options := ListDevicePoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicePoolsInput{} + } + + return &ListDevicePoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicePoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDevicePools page. +func (p *ListDevicePoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicePoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDevicePools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevicePools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListDevices.go b/service/devicefarm/api_op_ListDevices.go index 7bbf1722027..9db72d2b4c9 100644 --- a/service/devicefarm/api_op_ListDevices.go +++ b/service/devicefarm/api_op_ListDevices.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -185,6 +186,79 @@ func addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDevicesAPIClient is a client that implements the ListDevices operation. +type ListDevicesAPIClient interface { + ListDevices(context.Context, *ListDevicesInput, ...func(*Options)) (*ListDevicesOutput, error) +} + +var _ ListDevicesAPIClient = (*Client)(nil) + +// ListDevicesPaginatorOptions is the paginator options for ListDevices +type ListDevicesPaginatorOptions struct { + // 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 +} + +// ListDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListDevices +type ListDevicesPaginator struct { + options ListDevicesPaginatorOptions + client ListDevicesAPIClient + params *ListDevicesInput + nextToken *string + firstPage bool +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicesInput{} + } + + return &ListDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDevices page. +func (p *ListDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListJobs.go b/service/devicefarm/api_op_ListJobs.go index f0cc11ad77c..2cbfadbaae2 100644 --- a/service/devicefarm/api_op_ListJobs.go +++ b/service/devicefarm/api_op_ListJobs.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,79 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListOfferingTransactions.go b/service/devicefarm/api_op_ListOfferingTransactions.go index 02aae7f4755..40e03f5e95f 100644 --- a/service/devicefarm/api_op_ListOfferingTransactions.go +++ b/service/devicefarm/api_op_ListOfferingTransactions.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -112,6 +113,82 @@ func addOperationListOfferingTransactionsMiddlewares(stack *middleware.Stack, op return nil } +// ListOfferingTransactionsAPIClient is a client that implements the +// ListOfferingTransactions operation. +type ListOfferingTransactionsAPIClient interface { + ListOfferingTransactions(context.Context, *ListOfferingTransactionsInput, ...func(*Options)) (*ListOfferingTransactionsOutput, error) +} + +var _ ListOfferingTransactionsAPIClient = (*Client)(nil) + +// ListOfferingTransactionsPaginatorOptions is the paginator options for +// ListOfferingTransactions +type ListOfferingTransactionsPaginatorOptions struct { + // 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 +} + +// ListOfferingTransactionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListOfferingTransactions +type ListOfferingTransactionsPaginator struct { + options ListOfferingTransactionsPaginatorOptions + client ListOfferingTransactionsAPIClient + params *ListOfferingTransactionsInput + nextToken *string + firstPage bool +} + +// NewListOfferingTransactionsPaginator returns a new +// ListOfferingTransactionsPaginator +func NewListOfferingTransactionsPaginator(client ListOfferingTransactionsAPIClient, params *ListOfferingTransactionsInput, optFns ...func(*ListOfferingTransactionsPaginatorOptions)) *ListOfferingTransactionsPaginator { + options := ListOfferingTransactionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingTransactionsInput{} + } + + return &ListOfferingTransactionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingTransactionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOfferingTransactions page. +func (p *ListOfferingTransactionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingTransactionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListOfferingTransactions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferingTransactions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListOfferings.go b/service/devicefarm/api_op_ListOfferings.go index 56c1d2a8110..bda9b4d8052 100644 --- a/service/devicefarm/api_op_ListOfferings.go +++ b/service/devicefarm/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -111,6 +112,79 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // 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 +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListProjects.go b/service/devicefarm/api_op_ListProjects.go index 18dcd91dd46..99ba08928dd 100644 --- a/service/devicefarm/api_op_ListProjects.go +++ b/service/devicefarm/api_op_ListProjects.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -112,6 +113,79 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // 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 +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListRuns.go b/service/devicefarm/api_op_ListRuns.go index 4771e7bbeb2..0dd1b633ac2 100644 --- a/service/devicefarm/api_op_ListRuns.go +++ b/service/devicefarm/api_op_ListRuns.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,79 @@ func addOperationListRunsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListRunsAPIClient is a client that implements the ListRuns operation. +type ListRunsAPIClient interface { + ListRuns(context.Context, *ListRunsInput, ...func(*Options)) (*ListRunsOutput, error) +} + +var _ ListRunsAPIClient = (*Client)(nil) + +// ListRunsPaginatorOptions is the paginator options for ListRuns +type ListRunsPaginatorOptions struct { + // 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 +} + +// ListRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListRuns +type ListRunsPaginator struct { + options ListRunsPaginatorOptions + client ListRunsAPIClient + params *ListRunsInput + nextToken *string + firstPage bool +} + +// NewListRunsPaginator returns a new ListRunsPaginator +func NewListRunsPaginator(client ListRunsAPIClient, params *ListRunsInput, optFns ...func(*ListRunsPaginatorOptions)) *ListRunsPaginator { + options := ListRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRunsInput{} + } + + return &ListRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRuns page. +func (p *ListRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListSamples.go b/service/devicefarm/api_op_ListSamples.go index fb70aa16749..4f77d2d13da 100644 --- a/service/devicefarm/api_op_ListSamples.go +++ b/service/devicefarm/api_op_ListSamples.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,79 @@ func addOperationListSamplesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListSamplesAPIClient is a client that implements the ListSamples operation. +type ListSamplesAPIClient interface { + ListSamples(context.Context, *ListSamplesInput, ...func(*Options)) (*ListSamplesOutput, error) +} + +var _ ListSamplesAPIClient = (*Client)(nil) + +// ListSamplesPaginatorOptions is the paginator options for ListSamples +type ListSamplesPaginatorOptions struct { + // 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 +} + +// ListSamplesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListSamples +type ListSamplesPaginator struct { + options ListSamplesPaginatorOptions + client ListSamplesAPIClient + params *ListSamplesInput + nextToken *string + firstPage bool +} + +// NewListSamplesPaginator returns a new ListSamplesPaginator +func NewListSamplesPaginator(client ListSamplesAPIClient, params *ListSamplesInput, optFns ...func(*ListSamplesPaginatorOptions)) *ListSamplesPaginator { + options := ListSamplesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSamplesInput{} + } + + return &ListSamplesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSamplesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSamples page. +func (p *ListSamplesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSamplesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSamples(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSamples(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListSuites.go b/service/devicefarm/api_op_ListSuites.go index a907b391dfb..9ebd0742899 100644 --- a/service/devicefarm/api_op_ListSuites.go +++ b/service/devicefarm/api_op_ListSuites.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,79 @@ func addOperationListSuitesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListSuitesAPIClient is a client that implements the ListSuites operation. +type ListSuitesAPIClient interface { + ListSuites(context.Context, *ListSuitesInput, ...func(*Options)) (*ListSuitesOutput, error) +} + +var _ ListSuitesAPIClient = (*Client)(nil) + +// ListSuitesPaginatorOptions is the paginator options for ListSuites +type ListSuitesPaginatorOptions struct { + // 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 +} + +// ListSuitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListSuites +type ListSuitesPaginator struct { + options ListSuitesPaginatorOptions + client ListSuitesAPIClient + params *ListSuitesInput + nextToken *string + firstPage bool +} + +// NewListSuitesPaginator returns a new ListSuitesPaginator +func NewListSuitesPaginator(client ListSuitesAPIClient, params *ListSuitesInput, optFns ...func(*ListSuitesPaginatorOptions)) *ListSuitesPaginator { + options := ListSuitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuitesInput{} + } + + return &ListSuitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuitesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSuites page. +func (p *ListSuitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSuites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSuites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridProjects.go b/service/devicefarm/api_op_ListTestGridProjects.go index 56ea6c59032..b8b90084cd6 100644 --- a/service/devicefarm/api_op_ListTestGridProjects.go +++ b/service/devicefarm/api_op_ListTestGridProjects.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -106,6 +107,88 @@ func addOperationListTestGridProjectsMiddlewares(stack *middleware.Stack, option return nil } +// ListTestGridProjectsAPIClient is a client that implements the +// ListTestGridProjects operation. +type ListTestGridProjectsAPIClient interface { + ListTestGridProjects(context.Context, *ListTestGridProjectsInput, ...func(*Options)) (*ListTestGridProjectsOutput, error) +} + +var _ ListTestGridProjectsAPIClient = (*Client)(nil) + +// ListTestGridProjectsPaginatorOptions is the paginator options for +// ListTestGridProjects +type ListTestGridProjectsPaginatorOptions struct { + // Return no more than this number of results. + 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 +} + +// ListTestGridProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridProjects +type ListTestGridProjectsPaginator struct { + options ListTestGridProjectsPaginatorOptions + client ListTestGridProjectsAPIClient + params *ListTestGridProjectsInput + nextToken *string + firstPage bool +} + +// NewListTestGridProjectsPaginator returns a new ListTestGridProjectsPaginator +func NewListTestGridProjectsPaginator(client ListTestGridProjectsAPIClient, params *ListTestGridProjectsInput, optFns ...func(*ListTestGridProjectsPaginatorOptions)) *ListTestGridProjectsPaginator { + options := ListTestGridProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridProjectsInput{} + } + + return &ListTestGridProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTestGridProjects page. +func (p *ListTestGridProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResult = &p.options.Limit + } + + result, err := p.client.ListTestGridProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessionActions.go b/service/devicefarm/api_op_ListTestGridSessionActions.go index 9a371bce1d9..8c42e2d6373 100644 --- a/service/devicefarm/api_op_ListTestGridSessionActions.go +++ b/service/devicefarm/api_op_ListTestGridSessionActions.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -113,6 +114,89 @@ func addOperationListTestGridSessionActionsMiddlewares(stack *middleware.Stack, return nil } +// ListTestGridSessionActionsAPIClient is a client that implements the +// ListTestGridSessionActions operation. +type ListTestGridSessionActionsAPIClient interface { + ListTestGridSessionActions(context.Context, *ListTestGridSessionActionsInput, ...func(*Options)) (*ListTestGridSessionActionsOutput, error) +} + +var _ ListTestGridSessionActionsAPIClient = (*Client)(nil) + +// ListTestGridSessionActionsPaginatorOptions is the paginator options for +// ListTestGridSessionActions +type ListTestGridSessionActionsPaginatorOptions struct { + // The maximum number of sessions to return per response. + 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 +} + +// ListTestGridSessionActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessionActions +type ListTestGridSessionActionsPaginator struct { + options ListTestGridSessionActionsPaginatorOptions + client ListTestGridSessionActionsAPIClient + params *ListTestGridSessionActionsInput + nextToken *string + firstPage bool +} + +// NewListTestGridSessionActionsPaginator returns a new +// ListTestGridSessionActionsPaginator +func NewListTestGridSessionActionsPaginator(client ListTestGridSessionActionsAPIClient, params *ListTestGridSessionActionsInput, optFns ...func(*ListTestGridSessionActionsPaginatorOptions)) *ListTestGridSessionActionsPaginator { + options := ListTestGridSessionActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionActionsInput{} + } + + return &ListTestGridSessionActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTestGridSessionActions page. +func (p *ListTestGridSessionActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResult = &p.options.Limit + } + + result, err := p.client.ListTestGridSessionActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessionActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessionArtifacts.go b/service/devicefarm/api_op_ListTestGridSessionArtifacts.go index 5723ffe1a10..a5d22ccf3b0 100644 --- a/service/devicefarm/api_op_ListTestGridSessionArtifacts.go +++ b/service/devicefarm/api_op_ListTestGridSessionArtifacts.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -116,6 +117,89 @@ func addOperationListTestGridSessionArtifactsMiddlewares(stack *middleware.Stack return nil } +// ListTestGridSessionArtifactsAPIClient is a client that implements the +// ListTestGridSessionArtifacts operation. +type ListTestGridSessionArtifactsAPIClient interface { + ListTestGridSessionArtifacts(context.Context, *ListTestGridSessionArtifactsInput, ...func(*Options)) (*ListTestGridSessionArtifactsOutput, error) +} + +var _ ListTestGridSessionArtifactsAPIClient = (*Client)(nil) + +// ListTestGridSessionArtifactsPaginatorOptions is the paginator options for +// ListTestGridSessionArtifacts +type ListTestGridSessionArtifactsPaginatorOptions struct { + // The maximum number of results to be returned by a request. + 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 +} + +// ListTestGridSessionArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessionArtifacts +type ListTestGridSessionArtifactsPaginator struct { + options ListTestGridSessionArtifactsPaginatorOptions + client ListTestGridSessionArtifactsAPIClient + params *ListTestGridSessionArtifactsInput + nextToken *string + firstPage bool +} + +// NewListTestGridSessionArtifactsPaginator returns a new +// ListTestGridSessionArtifactsPaginator +func NewListTestGridSessionArtifactsPaginator(client ListTestGridSessionArtifactsAPIClient, params *ListTestGridSessionArtifactsInput, optFns ...func(*ListTestGridSessionArtifactsPaginatorOptions)) *ListTestGridSessionArtifactsPaginator { + options := ListTestGridSessionArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionArtifactsInput{} + } + + return &ListTestGridSessionArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionArtifactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTestGridSessionArtifacts page. +func (p *ListTestGridSessionArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResult = &p.options.Limit + } + + result, err := p.client.ListTestGridSessionArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessionArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTestGridSessions.go b/service/devicefarm/api_op_ListTestGridSessions.go index 8402fd2384b..529e3fd4017 100644 --- a/service/devicefarm/api_op_ListTestGridSessions.go +++ b/service/devicefarm/api_op_ListTestGridSessions.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -129,6 +130,88 @@ func addOperationListTestGridSessionsMiddlewares(stack *middleware.Stack, option return nil } +// ListTestGridSessionsAPIClient is a client that implements the +// ListTestGridSessions operation. +type ListTestGridSessionsAPIClient interface { + ListTestGridSessions(context.Context, *ListTestGridSessionsInput, ...func(*Options)) (*ListTestGridSessionsOutput, error) +} + +var _ ListTestGridSessionsAPIClient = (*Client)(nil) + +// ListTestGridSessionsPaginatorOptions is the paginator options for +// ListTestGridSessions +type ListTestGridSessionsPaginatorOptions struct { + // Return only this many results at a time. + 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 +} + +// ListTestGridSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTestGridSessions +type ListTestGridSessionsPaginator struct { + options ListTestGridSessionsPaginatorOptions + client ListTestGridSessionsAPIClient + params *ListTestGridSessionsInput + nextToken *string + firstPage bool +} + +// NewListTestGridSessionsPaginator returns a new ListTestGridSessionsPaginator +func NewListTestGridSessionsPaginator(client ListTestGridSessionsAPIClient, params *ListTestGridSessionsInput, optFns ...func(*ListTestGridSessionsPaginatorOptions)) *ListTestGridSessionsPaginator { + options := ListTestGridSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestGridSessionsInput{} + } + + return &ListTestGridSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestGridSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTestGridSessions page. +func (p *ListTestGridSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestGridSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResult = &p.options.Limit + } + + result, err := p.client.ListTestGridSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTestGridSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListTests.go b/service/devicefarm/api_op_ListTests.go index 9e26cf251c8..7c55a7636df 100644 --- a/service/devicefarm/api_op_ListTests.go +++ b/service/devicefarm/api_op_ListTests.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -115,6 +116,79 @@ func addOperationListTestsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTestsAPIClient is a client that implements the ListTests operation. +type ListTestsAPIClient interface { + ListTests(context.Context, *ListTestsInput, ...func(*Options)) (*ListTestsOutput, error) +} + +var _ ListTestsAPIClient = (*Client)(nil) + +// ListTestsPaginatorOptions is the paginator options for ListTests +type ListTestsPaginatorOptions struct { + // 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 +} + +// ListTestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListTests +type ListTestsPaginator struct { + options ListTestsPaginatorOptions + client ListTestsAPIClient + params *ListTestsInput + nextToken *string + firstPage bool +} + +// NewListTestsPaginator returns a new ListTestsPaginator +func NewListTestsPaginator(client ListTestsAPIClient, params *ListTestsInput, optFns ...func(*ListTestsPaginatorOptions)) *ListTestsPaginator { + options := ListTestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestsInput{} + } + + return &ListTestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTests page. +func (p *ListTestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListUniqueProblems.go b/service/devicefarm/api_op_ListUniqueProblems.go index 0c01fa46a67..319477de7b2 100644 --- a/service/devicefarm/api_op_ListUniqueProblems.go +++ b/service/devicefarm/api_op_ListUniqueProblems.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -134,6 +135,81 @@ func addOperationListUniqueProblemsMiddlewares(stack *middleware.Stack, options return nil } +// ListUniqueProblemsAPIClient is a client that implements the ListUniqueProblems +// operation. +type ListUniqueProblemsAPIClient interface { + ListUniqueProblems(context.Context, *ListUniqueProblemsInput, ...func(*Options)) (*ListUniqueProblemsOutput, error) +} + +var _ ListUniqueProblemsAPIClient = (*Client)(nil) + +// ListUniqueProblemsPaginatorOptions is the paginator options for +// ListUniqueProblems +type ListUniqueProblemsPaginatorOptions struct { + // 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 +} + +// ListUniqueProblemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListUniqueProblems +type ListUniqueProblemsPaginator struct { + options ListUniqueProblemsPaginatorOptions + client ListUniqueProblemsAPIClient + params *ListUniqueProblemsInput + nextToken *string + firstPage bool +} + +// NewListUniqueProblemsPaginator returns a new ListUniqueProblemsPaginator +func NewListUniqueProblemsPaginator(client ListUniqueProblemsAPIClient, params *ListUniqueProblemsInput, optFns ...func(*ListUniqueProblemsPaginatorOptions)) *ListUniqueProblemsPaginator { + options := ListUniqueProblemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUniqueProblemsInput{} + } + + return &ListUniqueProblemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUniqueProblemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUniqueProblems page. +func (p *ListUniqueProblemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUniqueProblemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListUniqueProblems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUniqueProblems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/api_op_ListUploads.go b/service/devicefarm/api_op_ListUploads.go index 21fcdeaae17..cc0d84d87bd 100644 --- a/service/devicefarm/api_op_ListUploads.go +++ b/service/devicefarm/api_op_ListUploads.go @@ -4,6 +4,7 @@ package devicefarm 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/devicefarm/types" @@ -196,6 +197,79 @@ func addOperationListUploadsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListUploadsAPIClient is a client that implements the ListUploads operation. +type ListUploadsAPIClient interface { + ListUploads(context.Context, *ListUploadsInput, ...func(*Options)) (*ListUploadsOutput, error) +} + +var _ ListUploadsAPIClient = (*Client)(nil) + +// ListUploadsPaginatorOptions is the paginator options for ListUploads +type ListUploadsPaginatorOptions struct { + // 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 +} + +// ListUploadsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/devicefarm.ListUploads +type ListUploadsPaginator struct { + options ListUploadsPaginatorOptions + client ListUploadsAPIClient + params *ListUploadsInput + nextToken *string + firstPage bool +} + +// NewListUploadsPaginator returns a new ListUploadsPaginator +func NewListUploadsPaginator(client ListUploadsAPIClient, params *ListUploadsInput, optFns ...func(*ListUploadsPaginatorOptions)) *ListUploadsPaginator { + options := ListUploadsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUploadsInput{} + } + + return &ListUploadsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUploadsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUploads page. +func (p *ListUploadsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUploadsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListUploads(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUploads(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/devicefarm/endpoints.go b/service/devicefarm/endpoints.go index a14cca15b24..4d407ba720f 100644 --- a/service/devicefarm/endpoints.go +++ b/service/devicefarm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/directconnect/endpoints.go b/service/directconnect/endpoints.go index 950b89f19cc..61962341d0c 100644 --- a/service/directconnect/endpoints.go +++ b/service/directconnect/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/directoryservice/api_op_DescribeDomainControllers.go b/service/directoryservice/api_op_DescribeDomainControllers.go index 419cceb0317..3e322495569 100644 --- a/service/directoryservice/api_op_DescribeDomainControllers.go +++ b/service/directoryservice/api_op_DescribeDomainControllers.go @@ -4,6 +4,7 @@ package directoryservice 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/directoryservice/types" @@ -121,6 +122,89 @@ func addOperationDescribeDomainControllersMiddlewares(stack *middleware.Stack, o return nil } +// DescribeDomainControllersAPIClient is a client that implements the +// DescribeDomainControllers operation. +type DescribeDomainControllersAPIClient interface { + DescribeDomainControllers(context.Context, *DescribeDomainControllersInput, ...func(*Options)) (*DescribeDomainControllersOutput, error) +} + +var _ DescribeDomainControllersAPIClient = (*Client)(nil) + +// DescribeDomainControllersPaginatorOptions is the paginator options for +// DescribeDomainControllers +type DescribeDomainControllersPaginatorOptions struct { + // The maximum number of items 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 +} + +// DescribeDomainControllersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/directoryservice.DescribeDomainControllers +type DescribeDomainControllersPaginator struct { + options DescribeDomainControllersPaginatorOptions + client DescribeDomainControllersAPIClient + params *DescribeDomainControllersInput + nextToken *string + firstPage bool +} + +// NewDescribeDomainControllersPaginator returns a new +// DescribeDomainControllersPaginator +func NewDescribeDomainControllersPaginator(client DescribeDomainControllersAPIClient, params *DescribeDomainControllersInput, optFns ...func(*DescribeDomainControllersPaginatorOptions)) *DescribeDomainControllersPaginator { + options := DescribeDomainControllersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDomainControllersInput{} + } + + return &DescribeDomainControllersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDomainControllersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDomainControllers page. +func (p *DescribeDomainControllersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDomainControllersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeDomainControllers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDomainControllers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/directoryservice/endpoints.go b/service/directoryservice/endpoints.go index cdcb0deb146..94d227d35e3 100644 --- a/service/directoryservice/endpoints.go +++ b/service/directoryservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/dlm/endpoints.go b/service/dlm/endpoints.go index f6b1e8ef36e..846f9a01d58 100644 --- a/service/dlm/endpoints.go +++ b/service/dlm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/docdb/api_op_DescribeCertificates.go b/service/docdb/api_op_DescribeCertificates.go index cb094c8e3b7..6a1f780d53e 100644 --- a/service/docdb/api_op_DescribeCertificates.go +++ b/service/docdb/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -132,6 +133,95 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: + // + // * Minimum: 20 + // + // * Maximum: 100 + 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 +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterParameterGroups.go b/service/docdb/api_op_DescribeDBClusterParameterGroups.go index 32e835c33d8..328b7bbfd07 100644 --- a/service/docdb/api_op_DescribeDBClusterParameterGroups.go +++ b/service/docdb/api_op_DescribeDBClusterParameterGroups.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -129,6 +130,92 @@ func addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.S return nil } +// DescribeDBClusterParameterGroupsAPIClient is a client that implements the +// DescribeDBClusterParameterGroups operation. +type DescribeDBClusterParameterGroupsAPIClient interface { + DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) +} + +var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginator struct { + options DescribeDBClusterParameterGroupsPaginatorOptions + client DescribeDBClusterParameterGroupsAPIClient + params *DescribeDBClusterParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + return &DescribeDBClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterParameterGroups page. +func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterParameters.go b/service/docdb/api_op_DescribeDBClusterParameters.go index 79f896b2ee7..d1ca6abf298 100644 --- a/service/docdb/api_op_DescribeDBClusterParameters.go +++ b/service/docdb/api_op_DescribeDBClusterParameters.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -133,6 +134,92 @@ func addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterParametersAPIClient is a client that implements the +// DescribeDBClusterParameters operation. +type DescribeDBClusterParametersAPIClient interface { + DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) +} + +var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) + +// DescribeDBClusterParametersPaginatorOptions is the paginator options for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterParameters +type DescribeDBClusterParametersPaginator struct { + options DescribeDBClusterParametersPaginatorOptions + client DescribeDBClusterParametersAPIClient + params *DescribeDBClusterParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + return &DescribeDBClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterParameters page. +func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusterSnapshots.go b/service/docdb/api_op_DescribeDBClusterSnapshots.go index 1a68261c037..f51c780cccb 100644 --- a/service/docdb/api_op_DescribeDBClusterSnapshots.go +++ b/service/docdb/api_op_DescribeDBClusterSnapshots.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -176,6 +177,92 @@ func addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterSnapshotsAPIClient is a client that implements the +// DescribeDBClusterSnapshots operation. +type DescribeDBClusterSnapshotsAPIClient interface { + DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) +} + +var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginator struct { + options DescribeDBClusterSnapshotsPaginatorOptions + client DescribeDBClusterSnapshotsAPIClient + params *DescribeDBClusterSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + return &DescribeDBClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterSnapshots page. +func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBClusters.go b/service/docdb/api_op_DescribeDBClusters.go index a0ddb589061..0451b528968 100644 --- a/service/docdb/api_op_DescribeDBClusters.go +++ b/service/docdb/api_op_DescribeDBClusters.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -138,6 +139,91 @@ func addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters +// operation. +type DescribeDBClustersAPIClient interface { + DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) +} + +var _ DescribeDBClustersAPIClient = (*Client)(nil) + +// DescribeDBClustersPaginatorOptions is the paginator options for +// DescribeDBClusters +type DescribeDBClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBClusters +type DescribeDBClustersPaginator struct { + options DescribeDBClustersPaginatorOptions + client DescribeDBClustersAPIClient + params *DescribeDBClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClustersInput{} + } + + return &DescribeDBClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusters page. +func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBEngineVersions.go b/service/docdb/api_op_DescribeDBEngineVersions.go index fa3de146ca0..a87e3db0214 100644 --- a/service/docdb/api_op_DescribeDBEngineVersions.go +++ b/service/docdb/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -146,6 +147,92 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBInstances.go b/service/docdb/api_op_DescribeDBInstances.go index 00f1d5b56ff..19161650bc3 100644 --- a/service/docdb/api_op_DescribeDBInstances.go +++ b/service/docdb/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -139,6 +140,91 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeDBSubnetGroups.go b/service/docdb/api_op_DescribeDBSubnetGroups.go index 3bcafe7020f..bbc0a508529 100644 --- a/service/docdb/api_op_DescribeDBSubnetGroups.go +++ b/service/docdb/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -125,6 +126,91 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeEvents.go b/service/docdb/api_op_DescribeEvents.go index bfc932c3d87..61ccf9ed53c 100644 --- a/service/docdb/api_op_DescribeEvents.go +++ b/service/docdb/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -166,6 +167,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go b/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go index 7554951d767..c36f3683257 100644 --- a/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/docdb/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -141,6 +142,92 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return nil } +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/api_op_DescribePendingMaintenanceActions.go b/service/docdb/api_op_DescribePendingMaintenanceActions.go index f178f81fa12..2d1d8574f8f 100644 --- a/service/docdb/api_op_DescribePendingMaintenanceActions.go +++ b/service/docdb/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package docdb 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/docdb/types" @@ -133,6 +134,92 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return nil } +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token (marker) is included in + // the response so that the remaining results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/docdb.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/docdb/endpoints.go b/service/docdb/endpoints.go index abd1c688240..1afc36cf814 100644 --- a/service/docdb/endpoints.go +++ b/service/docdb/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/dynamodb/api_op_ListContributorInsights.go b/service/dynamodb/api_op_ListContributorInsights.go index 4b4f3d38b9e..1d7f899961a 100644 --- a/service/dynamodb/api_op_ListContributorInsights.go +++ b/service/dynamodb/api_op_ListContributorInsights.go @@ -4,6 +4,7 @@ package dynamodb 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/dynamodb/types" @@ -115,6 +116,89 @@ func addOperationListContributorInsightsMiddlewares(stack *middleware.Stack, opt return nil } +// ListContributorInsightsAPIClient is a client that implements the +// ListContributorInsights operation. +type ListContributorInsightsAPIClient interface { + ListContributorInsights(context.Context, *ListContributorInsightsInput, ...func(*Options)) (*ListContributorInsightsOutput, error) +} + +var _ ListContributorInsightsAPIClient = (*Client)(nil) + +// ListContributorInsightsPaginatorOptions is the paginator options for +// ListContributorInsights +type ListContributorInsightsPaginatorOptions struct { + // Maximum number of results to return per page. + 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 +} + +// ListContributorInsightsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dynamodb.ListContributorInsights +type ListContributorInsightsPaginator struct { + options ListContributorInsightsPaginatorOptions + client ListContributorInsightsAPIClient + params *ListContributorInsightsInput + nextToken *string + firstPage bool +} + +// NewListContributorInsightsPaginator returns a new +// ListContributorInsightsPaginator +func NewListContributorInsightsPaginator(client ListContributorInsightsAPIClient, params *ListContributorInsightsInput, optFns ...func(*ListContributorInsightsPaginatorOptions)) *ListContributorInsightsPaginator { + options := ListContributorInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContributorInsightsInput{} + } + + return &ListContributorInsightsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContributorInsightsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContributorInsights page. +func (p *ListContributorInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContributorInsightsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListContributorInsights(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContributorInsights(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dynamodb/api_op_ListTables.go b/service/dynamodb/api_op_ListTables.go index 3858847f394..27e2a3f0ce8 100644 --- a/service/dynamodb/api_op_ListTables.go +++ b/service/dynamodb/api_op_ListTables.go @@ -4,6 +4,7 @@ package dynamodb 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/awslabs/smithy-go/middleware" @@ -125,6 +126,87 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // A maximum number of table names to return. If this parameter is not specified, + // the limit is 100. + 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 +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/dynamodb.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ExclusiveStartTableName = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.LastEvaluatedTableName + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/dynamodb/endpoints.go b/service/dynamodb/endpoints.go index 6457bd27b35..42a363b2fd3 100644 --- a/service/dynamodb/endpoints.go +++ b/service/dynamodb/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/dynamodbstreams/endpoints.go b/service/dynamodbstreams/endpoints.go index 9612aa79cfb..40a410f17ed 100644 --- a/service/dynamodbstreams/endpoints.go +++ b/service/dynamodbstreams/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ebs/api_op_ListChangedBlocks.go b/service/ebs/api_op_ListChangedBlocks.go index 4a0f61ebf27..a624f112e39 100644 --- a/service/ebs/api_op_ListChangedBlocks.go +++ b/service/ebs/api_op_ListChangedBlocks.go @@ -4,6 +4,7 @@ package ebs 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/ebs/types" @@ -136,6 +137,87 @@ func addOperationListChangedBlocksMiddlewares(stack *middleware.Stack, options O return nil } +// ListChangedBlocksAPIClient is a client that implements the ListChangedBlocks +// operation. +type ListChangedBlocksAPIClient interface { + ListChangedBlocks(context.Context, *ListChangedBlocksInput, ...func(*Options)) (*ListChangedBlocksOutput, error) +} + +var _ ListChangedBlocksAPIClient = (*Client)(nil) + +// ListChangedBlocksPaginatorOptions is the paginator options for ListChangedBlocks +type ListChangedBlocksPaginatorOptions struct { + // The number of results 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 +} + +// ListChangedBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ebs.ListChangedBlocks +type ListChangedBlocksPaginator struct { + options ListChangedBlocksPaginatorOptions + client ListChangedBlocksAPIClient + params *ListChangedBlocksInput + nextToken *string + firstPage bool +} + +// NewListChangedBlocksPaginator returns a new ListChangedBlocksPaginator +func NewListChangedBlocksPaginator(client ListChangedBlocksAPIClient, params *ListChangedBlocksInput, optFns ...func(*ListChangedBlocksPaginatorOptions)) *ListChangedBlocksPaginator { + options := ListChangedBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangedBlocksInput{} + } + + return &ListChangedBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangedBlocksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChangedBlocks page. +func (p *ListChangedBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangedBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListChangedBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangedBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ebs/api_op_ListSnapshotBlocks.go b/service/ebs/api_op_ListSnapshotBlocks.go index ca776add988..7eea49d8759 100644 --- a/service/ebs/api_op_ListSnapshotBlocks.go +++ b/service/ebs/api_op_ListSnapshotBlocks.go @@ -4,6 +4,7 @@ package ebs 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/ebs/types" @@ -128,6 +129,88 @@ func addOperationListSnapshotBlocksMiddlewares(stack *middleware.Stack, options return nil } +// ListSnapshotBlocksAPIClient is a client that implements the ListSnapshotBlocks +// operation. +type ListSnapshotBlocksAPIClient interface { + ListSnapshotBlocks(context.Context, *ListSnapshotBlocksInput, ...func(*Options)) (*ListSnapshotBlocksOutput, error) +} + +var _ ListSnapshotBlocksAPIClient = (*Client)(nil) + +// ListSnapshotBlocksPaginatorOptions is the paginator options for +// ListSnapshotBlocks +type ListSnapshotBlocksPaginatorOptions struct { + // The number of results 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 +} + +// ListSnapshotBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ebs.ListSnapshotBlocks +type ListSnapshotBlocksPaginator struct { + options ListSnapshotBlocksPaginatorOptions + client ListSnapshotBlocksAPIClient + params *ListSnapshotBlocksInput + nextToken *string + firstPage bool +} + +// NewListSnapshotBlocksPaginator returns a new ListSnapshotBlocksPaginator +func NewListSnapshotBlocksPaginator(client ListSnapshotBlocksAPIClient, params *ListSnapshotBlocksInput, optFns ...func(*ListSnapshotBlocksPaginatorOptions)) *ListSnapshotBlocksPaginator { + options := ListSnapshotBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSnapshotBlocksInput{} + } + + return &ListSnapshotBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSnapshotBlocksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSnapshotBlocks page. +func (p *ListSnapshotBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSnapshotBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSnapshotBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSnapshotBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ebs/endpoints.go b/service/ebs/endpoints.go index 8c041619f89..1a0b86b51af 100644 --- a/service/ebs/endpoints.go +++ b/service/ebs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ec2/api_op_DescribeCapacityReservations.go b/service/ec2/api_op_DescribeCapacityReservations.go index fb13bcc192b..240c9d3662a 100644 --- a/service/ec2/api_op_DescribeCapacityReservations.go +++ b/service/ec2/api_op_DescribeCapacityReservations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -201,6 +202,92 @@ func addOperationDescribeCapacityReservationsMiddlewares(stack *middleware.Stack return nil } +// DescribeCapacityReservationsAPIClient is a client that implements the +// DescribeCapacityReservations operation. +type DescribeCapacityReservationsAPIClient interface { + DescribeCapacityReservations(context.Context, *DescribeCapacityReservationsInput, ...func(*Options)) (*DescribeCapacityReservationsOutput, error) +} + +var _ DescribeCapacityReservationsAPIClient = (*Client)(nil) + +// DescribeCapacityReservationsPaginatorOptions is the paginator options for +// DescribeCapacityReservations +type DescribeCapacityReservationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + 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 +} + +// DescribeCapacityReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCapacityReservations +type DescribeCapacityReservationsPaginator struct { + options DescribeCapacityReservationsPaginatorOptions + client DescribeCapacityReservationsAPIClient + params *DescribeCapacityReservationsInput + nextToken *string + firstPage bool +} + +// NewDescribeCapacityReservationsPaginator returns a new +// DescribeCapacityReservationsPaginator +func NewDescribeCapacityReservationsPaginator(client DescribeCapacityReservationsAPIClient, params *DescribeCapacityReservationsInput, optFns ...func(*DescribeCapacityReservationsPaginatorOptions)) *DescribeCapacityReservationsPaginator { + options := DescribeCapacityReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCapacityReservationsInput{} + } + + return &DescribeCapacityReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCapacityReservationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCapacityReservations page. +func (p *DescribeCapacityReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeCapacityReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCapacityReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeCarrierGateways.go b/service/ec2/api_op_DescribeCarrierGateways.go index 19e33e87c09..754d8f6fc2c 100644 --- a/service/ec2/api_op_DescribeCarrierGateways.go +++ b/service/ec2/api_op_DescribeCarrierGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -140,6 +141,90 @@ func addOperationDescribeCarrierGatewaysMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeCarrierGatewaysAPIClient is a client that implements the +// DescribeCarrierGateways operation. +type DescribeCarrierGatewaysAPIClient interface { + DescribeCarrierGateways(context.Context, *DescribeCarrierGatewaysInput, ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) +} + +var _ DescribeCarrierGatewaysAPIClient = (*Client)(nil) + +// DescribeCarrierGatewaysPaginatorOptions is the paginator options for +// DescribeCarrierGateways +type DescribeCarrierGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeCarrierGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCarrierGateways +type DescribeCarrierGatewaysPaginator struct { + options DescribeCarrierGatewaysPaginatorOptions + client DescribeCarrierGatewaysAPIClient + params *DescribeCarrierGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeCarrierGatewaysPaginator returns a new +// DescribeCarrierGatewaysPaginator +func NewDescribeCarrierGatewaysPaginator(client DescribeCarrierGatewaysAPIClient, params *DescribeCarrierGatewaysInput, optFns ...func(*DescribeCarrierGatewaysPaginatorOptions)) *DescribeCarrierGatewaysPaginator { + options := DescribeCarrierGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCarrierGatewaysInput{} + } + + return &DescribeCarrierGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCarrierGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCarrierGateways page. +func (p *DescribeCarrierGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCarrierGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeCarrierGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCarrierGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClassicLinkInstances.go b/service/ec2/api_op_DescribeClassicLinkInstances.go index cb17b348cb9..b2b9dbd231a 100644 --- a/service/ec2/api_op_DescribeClassicLinkInstances.go +++ b/service/ec2/api_op_DescribeClassicLinkInstances.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -142,6 +143,91 @@ func addOperationDescribeClassicLinkInstancesMiddlewares(stack *middleware.Stack return nil } +// DescribeClassicLinkInstancesAPIClient is a client that implements the +// DescribeClassicLinkInstances operation. +type DescribeClassicLinkInstancesAPIClient interface { + DescribeClassicLinkInstances(context.Context, *DescribeClassicLinkInstancesInput, ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) +} + +var _ DescribeClassicLinkInstancesAPIClient = (*Client)(nil) + +// DescribeClassicLinkInstancesPaginatorOptions is the paginator options for +// DescribeClassicLinkInstances +type DescribeClassicLinkInstancesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + // Constraint: If the value is greater than 1000, we return only 1000 items. + 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 +} + +// DescribeClassicLinkInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClassicLinkInstances +type DescribeClassicLinkInstancesPaginator struct { + options DescribeClassicLinkInstancesPaginatorOptions + client DescribeClassicLinkInstancesAPIClient + params *DescribeClassicLinkInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeClassicLinkInstancesPaginator returns a new +// DescribeClassicLinkInstancesPaginator +func NewDescribeClassicLinkInstancesPaginator(client DescribeClassicLinkInstancesAPIClient, params *DescribeClassicLinkInstancesInput, optFns ...func(*DescribeClassicLinkInstancesPaginatorOptions)) *DescribeClassicLinkInstancesPaginator { + options := DescribeClassicLinkInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClassicLinkInstancesInput{} + } + + return &DescribeClassicLinkInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClassicLinkInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClassicLinkInstances page. +func (p *DescribeClassicLinkInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClassicLinkInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClassicLinkInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClassicLinkInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go b/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go index 0e606b100e3..11b3d731953 100644 --- a/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go +++ b/service/ec2/api_op_DescribeClientVpnAuthorizationRules.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,91 @@ func addOperationDescribeClientVpnAuthorizationRulesMiddlewares(stack *middlewar return nil } +// DescribeClientVpnAuthorizationRulesAPIClient is a client that implements the +// DescribeClientVpnAuthorizationRules operation. +type DescribeClientVpnAuthorizationRulesAPIClient interface { + DescribeClientVpnAuthorizationRules(context.Context, *DescribeClientVpnAuthorizationRulesInput, ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) +} + +var _ DescribeClientVpnAuthorizationRulesAPIClient = (*Client)(nil) + +// DescribeClientVpnAuthorizationRulesPaginatorOptions is the paginator options for +// DescribeClientVpnAuthorizationRules +type DescribeClientVpnAuthorizationRulesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + 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 +} + +// DescribeClientVpnAuthorizationRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnAuthorizationRules +type DescribeClientVpnAuthorizationRulesPaginator struct { + options DescribeClientVpnAuthorizationRulesPaginatorOptions + client DescribeClientVpnAuthorizationRulesAPIClient + params *DescribeClientVpnAuthorizationRulesInput + nextToken *string + firstPage bool +} + +// NewDescribeClientVpnAuthorizationRulesPaginator returns a new +// DescribeClientVpnAuthorizationRulesPaginator +func NewDescribeClientVpnAuthorizationRulesPaginator(client DescribeClientVpnAuthorizationRulesAPIClient, params *DescribeClientVpnAuthorizationRulesInput, optFns ...func(*DescribeClientVpnAuthorizationRulesPaginatorOptions)) *DescribeClientVpnAuthorizationRulesPaginator { + options := DescribeClientVpnAuthorizationRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnAuthorizationRulesInput{} + } + + return &DescribeClientVpnAuthorizationRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnAuthorizationRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClientVpnAuthorizationRules page. +func (p *DescribeClientVpnAuthorizationRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnAuthorizationRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClientVpnAuthorizationRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnAuthorizationRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnConnections.go b/service/ec2/api_op_DescribeClientVpnConnections.go index 9494ccf7e55..a21f54e5716 100644 --- a/service/ec2/api_op_DescribeClientVpnConnections.go +++ b/service/ec2/api_op_DescribeClientVpnConnections.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -133,6 +134,91 @@ func addOperationDescribeClientVpnConnectionsMiddlewares(stack *middleware.Stack return nil } +// DescribeClientVpnConnectionsAPIClient is a client that implements the +// DescribeClientVpnConnections operation. +type DescribeClientVpnConnectionsAPIClient interface { + DescribeClientVpnConnections(context.Context, *DescribeClientVpnConnectionsInput, ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) +} + +var _ DescribeClientVpnConnectionsAPIClient = (*Client)(nil) + +// DescribeClientVpnConnectionsPaginatorOptions is the paginator options for +// DescribeClientVpnConnections +type DescribeClientVpnConnectionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + 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 +} + +// DescribeClientVpnConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnConnections +type DescribeClientVpnConnectionsPaginator struct { + options DescribeClientVpnConnectionsPaginatorOptions + client DescribeClientVpnConnectionsAPIClient + params *DescribeClientVpnConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeClientVpnConnectionsPaginator returns a new +// DescribeClientVpnConnectionsPaginator +func NewDescribeClientVpnConnectionsPaginator(client DescribeClientVpnConnectionsAPIClient, params *DescribeClientVpnConnectionsInput, optFns ...func(*DescribeClientVpnConnectionsPaginatorOptions)) *DescribeClientVpnConnectionsPaginator { + options := DescribeClientVpnConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnConnectionsInput{} + } + + return &DescribeClientVpnConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClientVpnConnections page. +func (p *DescribeClientVpnConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClientVpnConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnEndpoints.go b/service/ec2/api_op_DescribeClientVpnEndpoints.go index ea44446fbc4..f80ab717144 100644 --- a/service/ec2/api_op_DescribeClientVpnEndpoints.go +++ b/service/ec2/api_op_DescribeClientVpnEndpoints.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -126,6 +127,91 @@ func addOperationDescribeClientVpnEndpointsMiddlewares(stack *middleware.Stack, return nil } +// DescribeClientVpnEndpointsAPIClient is a client that implements the +// DescribeClientVpnEndpoints operation. +type DescribeClientVpnEndpointsAPIClient interface { + DescribeClientVpnEndpoints(context.Context, *DescribeClientVpnEndpointsInput, ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) +} + +var _ DescribeClientVpnEndpointsAPIClient = (*Client)(nil) + +// DescribeClientVpnEndpointsPaginatorOptions is the paginator options for +// DescribeClientVpnEndpoints +type DescribeClientVpnEndpointsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + 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 +} + +// DescribeClientVpnEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnEndpoints +type DescribeClientVpnEndpointsPaginator struct { + options DescribeClientVpnEndpointsPaginatorOptions + client DescribeClientVpnEndpointsAPIClient + params *DescribeClientVpnEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeClientVpnEndpointsPaginator returns a new +// DescribeClientVpnEndpointsPaginator +func NewDescribeClientVpnEndpointsPaginator(client DescribeClientVpnEndpointsAPIClient, params *DescribeClientVpnEndpointsInput, optFns ...func(*DescribeClientVpnEndpointsPaginatorOptions)) *DescribeClientVpnEndpointsPaginator { + options := DescribeClientVpnEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnEndpointsInput{} + } + + return &DescribeClientVpnEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClientVpnEndpoints page. +func (p *DescribeClientVpnEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClientVpnEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnRoutes.go b/service/ec2/api_op_DescribeClientVpnRoutes.go index e7383ba6f95..44b62ced71b 100644 --- a/service/ec2/api_op_DescribeClientVpnRoutes.go +++ b/service/ec2/api_op_DescribeClientVpnRoutes.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,91 @@ func addOperationDescribeClientVpnRoutesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeClientVpnRoutesAPIClient is a client that implements the +// DescribeClientVpnRoutes operation. +type DescribeClientVpnRoutesAPIClient interface { + DescribeClientVpnRoutes(context.Context, *DescribeClientVpnRoutesInput, ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) +} + +var _ DescribeClientVpnRoutesAPIClient = (*Client)(nil) + +// DescribeClientVpnRoutesPaginatorOptions is the paginator options for +// DescribeClientVpnRoutes +type DescribeClientVpnRoutesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + 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 +} + +// DescribeClientVpnRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnRoutes +type DescribeClientVpnRoutesPaginator struct { + options DescribeClientVpnRoutesPaginatorOptions + client DescribeClientVpnRoutesAPIClient + params *DescribeClientVpnRoutesInput + nextToken *string + firstPage bool +} + +// NewDescribeClientVpnRoutesPaginator returns a new +// DescribeClientVpnRoutesPaginator +func NewDescribeClientVpnRoutesPaginator(client DescribeClientVpnRoutesAPIClient, params *DescribeClientVpnRoutesInput, optFns ...func(*DescribeClientVpnRoutesPaginatorOptions)) *DescribeClientVpnRoutesPaginator { + options := DescribeClientVpnRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnRoutesInput{} + } + + return &DescribeClientVpnRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnRoutesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClientVpnRoutes page. +func (p *DescribeClientVpnRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClientVpnRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeClientVpnTargetNetworks.go b/service/ec2/api_op_DescribeClientVpnTargetNetworks.go index 5a07c3a4f14..b8e86c8c867 100644 --- a/service/ec2/api_op_DescribeClientVpnTargetNetworks.go +++ b/service/ec2/api_op_DescribeClientVpnTargetNetworks.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -137,6 +138,91 @@ func addOperationDescribeClientVpnTargetNetworksMiddlewares(stack *middleware.St return nil } +// DescribeClientVpnTargetNetworksAPIClient is a client that implements the +// DescribeClientVpnTargetNetworks operation. +type DescribeClientVpnTargetNetworksAPIClient interface { + DescribeClientVpnTargetNetworks(context.Context, *DescribeClientVpnTargetNetworksInput, ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) +} + +var _ DescribeClientVpnTargetNetworksAPIClient = (*Client)(nil) + +// DescribeClientVpnTargetNetworksPaginatorOptions is the paginator options for +// DescribeClientVpnTargetNetworks +type DescribeClientVpnTargetNetworksPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the nextToken + // value. + 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 +} + +// DescribeClientVpnTargetNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeClientVpnTargetNetworks +type DescribeClientVpnTargetNetworksPaginator struct { + options DescribeClientVpnTargetNetworksPaginatorOptions + client DescribeClientVpnTargetNetworksAPIClient + params *DescribeClientVpnTargetNetworksInput + nextToken *string + firstPage bool +} + +// NewDescribeClientVpnTargetNetworksPaginator returns a new +// DescribeClientVpnTargetNetworksPaginator +func NewDescribeClientVpnTargetNetworksPaginator(client DescribeClientVpnTargetNetworksAPIClient, params *DescribeClientVpnTargetNetworksInput, optFns ...func(*DescribeClientVpnTargetNetworksPaginatorOptions)) *DescribeClientVpnTargetNetworksPaginator { + options := DescribeClientVpnTargetNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClientVpnTargetNetworksInput{} + } + + return &DescribeClientVpnTargetNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClientVpnTargetNetworksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClientVpnTargetNetworks page. +func (p *DescribeClientVpnTargetNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClientVpnTargetNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeClientVpnTargetNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClientVpnTargetNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeCoipPools.go b/service/ec2/api_op_DescribeCoipPools.go index 9fe3f1ddac3..9498e8deedb 100644 --- a/service/ec2/api_op_DescribeCoipPools.go +++ b/service/ec2/api_op_DescribeCoipPools.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -125,6 +126,88 @@ func addOperationDescribeCoipPoolsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeCoipPoolsAPIClient is a client that implements the DescribeCoipPools +// operation. +type DescribeCoipPoolsAPIClient interface { + DescribeCoipPools(context.Context, *DescribeCoipPoolsInput, ...func(*Options)) (*DescribeCoipPoolsOutput, error) +} + +var _ DescribeCoipPoolsAPIClient = (*Client)(nil) + +// DescribeCoipPoolsPaginatorOptions is the paginator options for DescribeCoipPools +type DescribeCoipPoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeCoipPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeCoipPools +type DescribeCoipPoolsPaginator struct { + options DescribeCoipPoolsPaginatorOptions + client DescribeCoipPoolsAPIClient + params *DescribeCoipPoolsInput + nextToken *string + firstPage bool +} + +// NewDescribeCoipPoolsPaginator returns a new DescribeCoipPoolsPaginator +func NewDescribeCoipPoolsPaginator(client DescribeCoipPoolsAPIClient, params *DescribeCoipPoolsInput, optFns ...func(*DescribeCoipPoolsPaginatorOptions)) *DescribeCoipPoolsPaginator { + options := DescribeCoipPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCoipPoolsInput{} + } + + return &DescribeCoipPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCoipPoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCoipPools page. +func (p *DescribeCoipPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCoipPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeCoipPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCoipPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeDhcpOptions.go b/service/ec2/api_op_DescribeDhcpOptions.go index 888a9f587f6..72b49ed6ca5 100644 --- a/service/ec2/api_op_DescribeDhcpOptions.go +++ b/service/ec2/api_op_DescribeDhcpOptions.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -144,6 +145,89 @@ func addOperationDescribeDhcpOptionsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDhcpOptionsAPIClient is a client that implements the DescribeDhcpOptions +// operation. +type DescribeDhcpOptionsAPIClient interface { + DescribeDhcpOptions(context.Context, *DescribeDhcpOptionsInput, ...func(*Options)) (*DescribeDhcpOptionsOutput, error) +} + +var _ DescribeDhcpOptionsAPIClient = (*Client)(nil) + +// DescribeDhcpOptionsPaginatorOptions is the paginator options for +// DescribeDhcpOptions +type DescribeDhcpOptionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeDhcpOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeDhcpOptions +type DescribeDhcpOptionsPaginator struct { + options DescribeDhcpOptionsPaginatorOptions + client DescribeDhcpOptionsAPIClient + params *DescribeDhcpOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDhcpOptionsPaginator returns a new DescribeDhcpOptionsPaginator +func NewDescribeDhcpOptionsPaginator(client DescribeDhcpOptionsAPIClient, params *DescribeDhcpOptionsInput, optFns ...func(*DescribeDhcpOptionsPaginatorOptions)) *DescribeDhcpOptionsPaginator { + options := DescribeDhcpOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDhcpOptionsInput{} + } + + return &DescribeDhcpOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDhcpOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDhcpOptions page. +func (p *DescribeDhcpOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDhcpOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeDhcpOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDhcpOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go b/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go index 86aa4cdcff3..7aadaf57876 100644 --- a/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go +++ b/service/ec2/api_op_DescribeEgressOnlyInternetGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -129,6 +130,90 @@ func addOperationDescribeEgressOnlyInternetGatewaysMiddlewares(stack *middleware return nil } +// DescribeEgressOnlyInternetGatewaysAPIClient is a client that implements the +// DescribeEgressOnlyInternetGateways operation. +type DescribeEgressOnlyInternetGatewaysAPIClient interface { + DescribeEgressOnlyInternetGateways(context.Context, *DescribeEgressOnlyInternetGatewaysInput, ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) +} + +var _ DescribeEgressOnlyInternetGatewaysAPIClient = (*Client)(nil) + +// DescribeEgressOnlyInternetGatewaysPaginatorOptions is the paginator options for +// DescribeEgressOnlyInternetGateways +type DescribeEgressOnlyInternetGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeEgressOnlyInternetGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeEgressOnlyInternetGateways +type DescribeEgressOnlyInternetGatewaysPaginator struct { + options DescribeEgressOnlyInternetGatewaysPaginatorOptions + client DescribeEgressOnlyInternetGatewaysAPIClient + params *DescribeEgressOnlyInternetGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeEgressOnlyInternetGatewaysPaginator returns a new +// DescribeEgressOnlyInternetGatewaysPaginator +func NewDescribeEgressOnlyInternetGatewaysPaginator(client DescribeEgressOnlyInternetGatewaysAPIClient, params *DescribeEgressOnlyInternetGatewaysInput, optFns ...func(*DescribeEgressOnlyInternetGatewaysPaginatorOptions)) *DescribeEgressOnlyInternetGatewaysPaginator { + options := DescribeEgressOnlyInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEgressOnlyInternetGatewaysInput{} + } + + return &DescribeEgressOnlyInternetGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEgressOnlyInternetGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEgressOnlyInternetGateways page. +func (p *DescribeEgressOnlyInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEgressOnlyInternetGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeEgressOnlyInternetGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEgressOnlyInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeExportImageTasks.go b/service/ec2/api_op_DescribeExportImageTasks.go index 8535511c58a..c737f785d0a 100644 --- a/service/ec2/api_op_DescribeExportImageTasks.go +++ b/service/ec2/api_op_DescribeExportImageTasks.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -119,6 +120,89 @@ func addOperationDescribeExportImageTasksMiddlewares(stack *middleware.Stack, op return nil } +// DescribeExportImageTasksAPIClient is a client that implements the +// DescribeExportImageTasks operation. +type DescribeExportImageTasksAPIClient interface { + DescribeExportImageTasks(context.Context, *DescribeExportImageTasksInput, ...func(*Options)) (*DescribeExportImageTasksOutput, error) +} + +var _ DescribeExportImageTasksAPIClient = (*Client)(nil) + +// DescribeExportImageTasksPaginatorOptions is the paginator options for +// DescribeExportImageTasks +type DescribeExportImageTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// DescribeExportImageTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeExportImageTasks +type DescribeExportImageTasksPaginator struct { + options DescribeExportImageTasksPaginatorOptions + client DescribeExportImageTasksAPIClient + params *DescribeExportImageTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeExportImageTasksPaginator returns a new +// DescribeExportImageTasksPaginator +func NewDescribeExportImageTasksPaginator(client DescribeExportImageTasksAPIClient, params *DescribeExportImageTasksInput, optFns ...func(*DescribeExportImageTasksPaginatorOptions)) *DescribeExportImageTasksPaginator { + options := DescribeExportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeExportImageTasksInput{} + } + + return &DescribeExportImageTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportImageTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeExportImageTasks page. +func (p *DescribeExportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportImageTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeExportImageTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeExportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFastSnapshotRestores.go b/service/ec2/api_op_DescribeFastSnapshotRestores.go index 6c297f6ad33..51792e9d014 100644 --- a/service/ec2/api_op_DescribeFastSnapshotRestores.go +++ b/service/ec2/api_op_DescribeFastSnapshotRestores.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -128,6 +129,90 @@ func addOperationDescribeFastSnapshotRestoresMiddlewares(stack *middleware.Stack return nil } +// DescribeFastSnapshotRestoresAPIClient is a client that implements the +// DescribeFastSnapshotRestores operation. +type DescribeFastSnapshotRestoresAPIClient interface { + DescribeFastSnapshotRestores(context.Context, *DescribeFastSnapshotRestoresInput, ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) +} + +var _ DescribeFastSnapshotRestoresAPIClient = (*Client)(nil) + +// DescribeFastSnapshotRestoresPaginatorOptions is the paginator options for +// DescribeFastSnapshotRestores +type DescribeFastSnapshotRestoresPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeFastSnapshotRestoresPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFastSnapshotRestores +type DescribeFastSnapshotRestoresPaginator struct { + options DescribeFastSnapshotRestoresPaginatorOptions + client DescribeFastSnapshotRestoresAPIClient + params *DescribeFastSnapshotRestoresInput + nextToken *string + firstPage bool +} + +// NewDescribeFastSnapshotRestoresPaginator returns a new +// DescribeFastSnapshotRestoresPaginator +func NewDescribeFastSnapshotRestoresPaginator(client DescribeFastSnapshotRestoresAPIClient, params *DescribeFastSnapshotRestoresInput, optFns ...func(*DescribeFastSnapshotRestoresPaginatorOptions)) *DescribeFastSnapshotRestoresPaginator { + options := DescribeFastSnapshotRestoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFastSnapshotRestoresInput{} + } + + return &DescribeFastSnapshotRestoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFastSnapshotRestoresPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFastSnapshotRestores page. +func (p *DescribeFastSnapshotRestoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFastSnapshotRestoresOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeFastSnapshotRestores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFastSnapshotRestores(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFleets.go b/service/ec2/api_op_DescribeFleets.go index 42f34482fa5..f64d4130a8a 100644 --- a/service/ec2/api_op_DescribeFleets.go +++ b/service/ec2/api_op_DescribeFleets.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -137,6 +138,89 @@ func addOperationDescribeFleetsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeFleetsAPIClient is a client that implements the DescribeFleets +// operation. +type DescribeFleetsAPIClient interface { + DescribeFleets(context.Context, *DescribeFleetsInput, ...func(*Options)) (*DescribeFleetsOutput, error) +} + +var _ DescribeFleetsAPIClient = (*Client)(nil) + +// DescribeFleetsPaginatorOptions is the paginator options for DescribeFleets +type DescribeFleetsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + 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 +} + +// DescribeFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFleets +type DescribeFleetsPaginator struct { + options DescribeFleetsPaginatorOptions + client DescribeFleetsAPIClient + params *DescribeFleetsInput + nextToken *string + firstPage bool +} + +// NewDescribeFleetsPaginator returns a new DescribeFleetsPaginator +func NewDescribeFleetsPaginator(client DescribeFleetsAPIClient, params *DescribeFleetsInput, optFns ...func(*DescribeFleetsPaginatorOptions)) *DescribeFleetsPaginator { + options := DescribeFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetsInput{} + } + + return &DescribeFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFleets page. +func (p *DescribeFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFlowLogs.go b/service/ec2/api_op_DescribeFlowLogs.go index d9f88e879db..7661c6f5e4e 100644 --- a/service/ec2/api_op_DescribeFlowLogs.go +++ b/service/ec2/api_op_DescribeFlowLogs.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -148,6 +149,88 @@ func addOperationDescribeFlowLogsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeFlowLogsAPIClient is a client that implements the DescribeFlowLogs +// operation. +type DescribeFlowLogsAPIClient interface { + DescribeFlowLogs(context.Context, *DescribeFlowLogsInput, ...func(*Options)) (*DescribeFlowLogsOutput, error) +} + +var _ DescribeFlowLogsAPIClient = (*Client)(nil) + +// DescribeFlowLogsPaginatorOptions is the paginator options for DescribeFlowLogs +type DescribeFlowLogsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeFlowLogsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFlowLogs +type DescribeFlowLogsPaginator struct { + options DescribeFlowLogsPaginatorOptions + client DescribeFlowLogsAPIClient + params *DescribeFlowLogsInput + nextToken *string + firstPage bool +} + +// NewDescribeFlowLogsPaginator returns a new DescribeFlowLogsPaginator +func NewDescribeFlowLogsPaginator(client DescribeFlowLogsAPIClient, params *DescribeFlowLogsInput, optFns ...func(*DescribeFlowLogsPaginatorOptions)) *DescribeFlowLogsPaginator { + options := DescribeFlowLogsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFlowLogsInput{} + } + + return &DescribeFlowLogsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFlowLogsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFlowLogs page. +func (p *DescribeFlowLogsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFlowLogsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeFlowLogs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFlowLogs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeFpgaImages.go b/service/ec2/api_op_DescribeFpgaImages.go index caaba35d4c8..50eddbf67da 100644 --- a/service/ec2/api_op_DescribeFpgaImages.go +++ b/service/ec2/api_op_DescribeFpgaImages.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -159,6 +160,88 @@ func addOperationDescribeFpgaImagesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeFpgaImagesAPIClient is a client that implements the DescribeFpgaImages +// operation. +type DescribeFpgaImagesAPIClient interface { + DescribeFpgaImages(context.Context, *DescribeFpgaImagesInput, ...func(*Options)) (*DescribeFpgaImagesOutput, error) +} + +var _ DescribeFpgaImagesAPIClient = (*Client)(nil) + +// DescribeFpgaImagesPaginatorOptions is the paginator options for +// DescribeFpgaImages +type DescribeFpgaImagesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// DescribeFpgaImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeFpgaImages +type DescribeFpgaImagesPaginator struct { + options DescribeFpgaImagesPaginatorOptions + client DescribeFpgaImagesAPIClient + params *DescribeFpgaImagesInput + nextToken *string + firstPage bool +} + +// NewDescribeFpgaImagesPaginator returns a new DescribeFpgaImagesPaginator +func NewDescribeFpgaImagesPaginator(client DescribeFpgaImagesAPIClient, params *DescribeFpgaImagesInput, optFns ...func(*DescribeFpgaImagesPaginatorOptions)) *DescribeFpgaImagesPaginator { + options := DescribeFpgaImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFpgaImagesInput{} + } + + return &DescribeFpgaImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFpgaImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFpgaImages page. +func (p *DescribeFpgaImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFpgaImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeFpgaImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFpgaImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHostReservationOfferings.go b/service/ec2/api_op_DescribeHostReservationOfferings.go index 3f3804124cc..dc886a385ff 100644 --- a/service/ec2/api_op_DescribeHostReservationOfferings.go +++ b/service/ec2/api_op_DescribeHostReservationOfferings.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -143,6 +144,92 @@ func addOperationDescribeHostReservationOfferingsMiddlewares(stack *middleware.S return nil } +// DescribeHostReservationOfferingsAPIClient is a client that implements the +// DescribeHostReservationOfferings operation. +type DescribeHostReservationOfferingsAPIClient interface { + DescribeHostReservationOfferings(context.Context, *DescribeHostReservationOfferingsInput, ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) +} + +var _ DescribeHostReservationOfferingsAPIClient = (*Client)(nil) + +// DescribeHostReservationOfferingsPaginatorOptions is the paginator options for +// DescribeHostReservationOfferings +type DescribeHostReservationOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + 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 +} + +// DescribeHostReservationOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHostReservationOfferings +type DescribeHostReservationOfferingsPaginator struct { + options DescribeHostReservationOfferingsPaginatorOptions + client DescribeHostReservationOfferingsAPIClient + params *DescribeHostReservationOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeHostReservationOfferingsPaginator returns a new +// DescribeHostReservationOfferingsPaginator +func NewDescribeHostReservationOfferingsPaginator(client DescribeHostReservationOfferingsAPIClient, params *DescribeHostReservationOfferingsInput, optFns ...func(*DescribeHostReservationOfferingsPaginatorOptions)) *DescribeHostReservationOfferingsPaginator { + options := DescribeHostReservationOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostReservationOfferingsInput{} + } + + return &DescribeHostReservationOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostReservationOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHostReservationOfferings page. +func (p *DescribeHostReservationOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeHostReservationOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHostReservationOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHostReservations.go b/service/ec2/api_op_DescribeHostReservations.go index 38ea0f0de32..01f753bf2bf 100644 --- a/service/ec2/api_op_DescribeHostReservations.go +++ b/service/ec2/api_op_DescribeHostReservations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,92 @@ func addOperationDescribeHostReservationsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeHostReservationsAPIClient is a client that implements the +// DescribeHostReservations operation. +type DescribeHostReservationsAPIClient interface { + DescribeHostReservations(context.Context, *DescribeHostReservationsInput, ...func(*Options)) (*DescribeHostReservationsOutput, error) +} + +var _ DescribeHostReservationsAPIClient = (*Client)(nil) + +// DescribeHostReservationsPaginatorOptions is the paginator options for +// DescribeHostReservations +type DescribeHostReservationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + 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 +} + +// DescribeHostReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHostReservations +type DescribeHostReservationsPaginator struct { + options DescribeHostReservationsPaginatorOptions + client DescribeHostReservationsAPIClient + params *DescribeHostReservationsInput + nextToken *string + firstPage bool +} + +// NewDescribeHostReservationsPaginator returns a new +// DescribeHostReservationsPaginator +func NewDescribeHostReservationsPaginator(client DescribeHostReservationsAPIClient, params *DescribeHostReservationsInput, optFns ...func(*DescribeHostReservationsPaginatorOptions)) *DescribeHostReservationsPaginator { + options := DescribeHostReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostReservationsInput{} + } + + return &DescribeHostReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostReservationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHostReservations page. +func (p *DescribeHostReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeHostReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHostReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeHosts.go b/service/ec2/api_op_DescribeHosts.go index 08b6544c530..5dac8302525 100644 --- a/service/ec2/api_op_DescribeHosts.go +++ b/service/ec2/api_op_DescribeHosts.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -142,6 +143,90 @@ func addOperationDescribeHostsMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeHostsAPIClient is a client that implements the DescribeHosts operation. +type DescribeHostsAPIClient interface { + DescribeHosts(context.Context, *DescribeHostsInput, ...func(*Options)) (*DescribeHostsOutput, error) +} + +var _ DescribeHostsAPIClient = (*Client)(nil) + +// DescribeHostsPaginatorOptions is the paginator options for DescribeHosts +type DescribeHostsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. You cannot specify this parameter + // and the host IDs parameter in the same request. + 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 +} + +// DescribeHostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeHosts +type DescribeHostsPaginator struct { + options DescribeHostsPaginatorOptions + client DescribeHostsAPIClient + params *DescribeHostsInput + nextToken *string + firstPage bool +} + +// NewDescribeHostsPaginator returns a new DescribeHostsPaginator +func NewDescribeHostsPaginator(client DescribeHostsAPIClient, params *DescribeHostsInput, optFns ...func(*DescribeHostsPaginatorOptions)) *DescribeHostsPaginator { + options := DescribeHostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHostsInput{} + } + + return &DescribeHostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHostsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHosts page. +func (p *DescribeHostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeHosts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHosts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go b/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go index 758ce580abe..6b929948bcd 100644 --- a/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go +++ b/service/ec2/api_op_DescribeIamInstanceProfileAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -118,6 +119,90 @@ func addOperationDescribeIamInstanceProfileAssociationsMiddlewares(stack *middle return nil } +// DescribeIamInstanceProfileAssociationsAPIClient is a client that implements the +// DescribeIamInstanceProfileAssociations operation. +type DescribeIamInstanceProfileAssociationsAPIClient interface { + DescribeIamInstanceProfileAssociations(context.Context, *DescribeIamInstanceProfileAssociationsInput, ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) +} + +var _ DescribeIamInstanceProfileAssociationsAPIClient = (*Client)(nil) + +// DescribeIamInstanceProfileAssociationsPaginatorOptions is the paginator options +// for DescribeIamInstanceProfileAssociations +type DescribeIamInstanceProfileAssociationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// DescribeIamInstanceProfileAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeIamInstanceProfileAssociations +type DescribeIamInstanceProfileAssociationsPaginator struct { + options DescribeIamInstanceProfileAssociationsPaginatorOptions + client DescribeIamInstanceProfileAssociationsAPIClient + params *DescribeIamInstanceProfileAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeIamInstanceProfileAssociationsPaginator returns a new +// DescribeIamInstanceProfileAssociationsPaginator +func NewDescribeIamInstanceProfileAssociationsPaginator(client DescribeIamInstanceProfileAssociationsAPIClient, params *DescribeIamInstanceProfileAssociationsInput, optFns ...func(*DescribeIamInstanceProfileAssociationsPaginatorOptions)) *DescribeIamInstanceProfileAssociationsPaginator { + options := DescribeIamInstanceProfileAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeIamInstanceProfileAssociationsInput{} + } + + return &DescribeIamInstanceProfileAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeIamInstanceProfileAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeIamInstanceProfileAssociations page. +func (p *DescribeIamInstanceProfileAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIamInstanceProfileAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeIamInstanceProfileAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeIamInstanceProfileAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeImportImageTasks.go b/service/ec2/api_op_DescribeImportImageTasks.go index 03ce2f872ab..65e0ff0f95e 100644 --- a/service/ec2/api_op_DescribeImportImageTasks.go +++ b/service/ec2/api_op_DescribeImportImageTasks.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -121,6 +122,89 @@ func addOperationDescribeImportImageTasksMiddlewares(stack *middleware.Stack, op return nil } +// DescribeImportImageTasksAPIClient is a client that implements the +// DescribeImportImageTasks operation. +type DescribeImportImageTasksAPIClient interface { + DescribeImportImageTasks(context.Context, *DescribeImportImageTasksInput, ...func(*Options)) (*DescribeImportImageTasksOutput, error) +} + +var _ DescribeImportImageTasksAPIClient = (*Client)(nil) + +// DescribeImportImageTasksPaginatorOptions is the paginator options for +// DescribeImportImageTasks +type DescribeImportImageTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// DescribeImportImageTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeImportImageTasks +type DescribeImportImageTasksPaginator struct { + options DescribeImportImageTasksPaginatorOptions + client DescribeImportImageTasksAPIClient + params *DescribeImportImageTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeImportImageTasksPaginator returns a new +// DescribeImportImageTasksPaginator +func NewDescribeImportImageTasksPaginator(client DescribeImportImageTasksAPIClient, params *DescribeImportImageTasksInput, optFns ...func(*DescribeImportImageTasksPaginatorOptions)) *DescribeImportImageTasksPaginator { + options := DescribeImportImageTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportImageTasksInput{} + } + + return &DescribeImportImageTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportImageTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImportImageTasks page. +func (p *DescribeImportImageTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportImageTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeImportImageTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportImageTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeImportSnapshotTasks.go b/service/ec2/api_op_DescribeImportSnapshotTasks.go index 7f101defd8c..20116777c7a 100644 --- a/service/ec2/api_op_DescribeImportSnapshotTasks.go +++ b/service/ec2/api_op_DescribeImportSnapshotTasks.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -120,6 +121,90 @@ func addOperationDescribeImportSnapshotTasksMiddlewares(stack *middleware.Stack, return nil } +// DescribeImportSnapshotTasksAPIClient is a client that implements the +// DescribeImportSnapshotTasks operation. +type DescribeImportSnapshotTasksAPIClient interface { + DescribeImportSnapshotTasks(context.Context, *DescribeImportSnapshotTasksInput, ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) +} + +var _ DescribeImportSnapshotTasksAPIClient = (*Client)(nil) + +// DescribeImportSnapshotTasksPaginatorOptions is the paginator options for +// DescribeImportSnapshotTasks +type DescribeImportSnapshotTasksPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// DescribeImportSnapshotTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeImportSnapshotTasks +type DescribeImportSnapshotTasksPaginator struct { + options DescribeImportSnapshotTasksPaginatorOptions + client DescribeImportSnapshotTasksAPIClient + params *DescribeImportSnapshotTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeImportSnapshotTasksPaginator returns a new +// DescribeImportSnapshotTasksPaginator +func NewDescribeImportSnapshotTasksPaginator(client DescribeImportSnapshotTasksAPIClient, params *DescribeImportSnapshotTasksInput, optFns ...func(*DescribeImportSnapshotTasksPaginatorOptions)) *DescribeImportSnapshotTasksPaginator { + options := DescribeImportSnapshotTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImportSnapshotTasksInput{} + } + + return &DescribeImportSnapshotTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImportSnapshotTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImportSnapshotTasks page. +func (p *DescribeImportSnapshotTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImportSnapshotTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeImportSnapshotTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImportSnapshotTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceCreditSpecifications.go b/service/ec2/api_op_DescribeInstanceCreditSpecifications.go index 008eb5cdbfb..043af2f7787 100644 --- a/service/ec2/api_op_DescribeInstanceCreditSpecifications.go +++ b/service/ec2/api_op_DescribeInstanceCreditSpecifications.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -141,6 +142,92 @@ func addOperationDescribeInstanceCreditSpecificationsMiddlewares(stack *middlewa return nil } +// DescribeInstanceCreditSpecificationsAPIClient is a client that implements the +// DescribeInstanceCreditSpecifications operation. +type DescribeInstanceCreditSpecificationsAPIClient interface { + DescribeInstanceCreditSpecifications(context.Context, *DescribeInstanceCreditSpecificationsInput, ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) +} + +var _ DescribeInstanceCreditSpecificationsAPIClient = (*Client)(nil) + +// DescribeInstanceCreditSpecificationsPaginatorOptions is the paginator options +// for DescribeInstanceCreditSpecifications +type DescribeInstanceCreditSpecificationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + 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 +} + +// DescribeInstanceCreditSpecificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceCreditSpecifications +type DescribeInstanceCreditSpecificationsPaginator struct { + options DescribeInstanceCreditSpecificationsPaginatorOptions + client DescribeInstanceCreditSpecificationsAPIClient + params *DescribeInstanceCreditSpecificationsInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceCreditSpecificationsPaginator returns a new +// DescribeInstanceCreditSpecificationsPaginator +func NewDescribeInstanceCreditSpecificationsPaginator(client DescribeInstanceCreditSpecificationsAPIClient, params *DescribeInstanceCreditSpecificationsInput, optFns ...func(*DescribeInstanceCreditSpecificationsPaginatorOptions)) *DescribeInstanceCreditSpecificationsPaginator { + options := DescribeInstanceCreditSpecificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceCreditSpecificationsInput{} + } + + return &DescribeInstanceCreditSpecificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceCreditSpecificationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceCreditSpecifications page. +func (p *DescribeInstanceCreditSpecificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceCreditSpecificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstanceCreditSpecifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceCreditSpecifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceStatus.go b/service/ec2/api_op_DescribeInstanceStatus.go index cf7da0f483e..d84ea6af300 100644 --- a/service/ec2/api_op_DescribeInstanceStatus.go +++ b/service/ec2/api_op_DescribeInstanceStatus.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -198,6 +199,91 @@ func addOperationDescribeInstanceStatusMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeInstanceStatusAPIClient is a client that implements the +// DescribeInstanceStatus operation. +type DescribeInstanceStatusAPIClient interface { + DescribeInstanceStatus(context.Context, *DescribeInstanceStatusInput, ...func(*Options)) (*DescribeInstanceStatusOutput, error) +} + +var _ DescribeInstanceStatusAPIClient = (*Client)(nil) + +// DescribeInstanceStatusPaginatorOptions is the paginator options for +// DescribeInstanceStatus +type DescribeInstanceStatusPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + 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 +} + +// DescribeInstanceStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceStatus +type DescribeInstanceStatusPaginator struct { + options DescribeInstanceStatusPaginatorOptions + client DescribeInstanceStatusAPIClient + params *DescribeInstanceStatusInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceStatusPaginator returns a new DescribeInstanceStatusPaginator +func NewDescribeInstanceStatusPaginator(client DescribeInstanceStatusAPIClient, params *DescribeInstanceStatusInput, optFns ...func(*DescribeInstanceStatusPaginatorOptions)) *DescribeInstanceStatusPaginator { + options := DescribeInstanceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceStatusInput{} + } + + return &DescribeInstanceStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceStatus page. +func (p *DescribeInstanceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstanceStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceTypeOfferings.go b/service/ec2/api_op_DescribeInstanceTypeOfferings.go index d6f65b96250..463f8765838 100644 --- a/service/ec2/api_op_DescribeInstanceTypeOfferings.go +++ b/service/ec2/api_op_DescribeInstanceTypeOfferings.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -129,6 +130,91 @@ func addOperationDescribeInstanceTypeOfferingsMiddlewares(stack *middleware.Stac return nil } +// DescribeInstanceTypeOfferingsAPIClient is a client that implements the +// DescribeInstanceTypeOfferings operation. +type DescribeInstanceTypeOfferingsAPIClient interface { + DescribeInstanceTypeOfferings(context.Context, *DescribeInstanceTypeOfferingsInput, ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) +} + +var _ DescribeInstanceTypeOfferingsAPIClient = (*Client)(nil) + +// DescribeInstanceTypeOfferingsPaginatorOptions is the paginator options for +// DescribeInstanceTypeOfferings +type DescribeInstanceTypeOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the next token + // value. + 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 +} + +// DescribeInstanceTypeOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceTypeOfferings +type DescribeInstanceTypeOfferingsPaginator struct { + options DescribeInstanceTypeOfferingsPaginatorOptions + client DescribeInstanceTypeOfferingsAPIClient + params *DescribeInstanceTypeOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceTypeOfferingsPaginator returns a new +// DescribeInstanceTypeOfferingsPaginator +func NewDescribeInstanceTypeOfferingsPaginator(client DescribeInstanceTypeOfferingsAPIClient, params *DescribeInstanceTypeOfferingsInput, optFns ...func(*DescribeInstanceTypeOfferingsPaginatorOptions)) *DescribeInstanceTypeOfferingsPaginator { + options := DescribeInstanceTypeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceTypeOfferingsInput{} + } + + return &DescribeInstanceTypeOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceTypeOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceTypeOfferings page. +func (p *DescribeInstanceTypeOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypeOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeInstanceTypeOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceTypeOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstanceTypes.go b/service/ec2/api_op_DescribeInstanceTypes.go index 4b733458bf4..62058175954 100644 --- a/service/ec2/api_op_DescribeInstanceTypes.go +++ b/service/ec2/api_op_DescribeInstanceTypes.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -268,6 +269,90 @@ func addOperationDescribeInstanceTypesMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeInstanceTypesAPIClient is a client that implements the +// DescribeInstanceTypes operation. +type DescribeInstanceTypesAPIClient interface { + DescribeInstanceTypes(context.Context, *DescribeInstanceTypesInput, ...func(*Options)) (*DescribeInstanceTypesOutput, error) +} + +var _ DescribeInstanceTypesAPIClient = (*Client)(nil) + +// DescribeInstanceTypesPaginatorOptions is the paginator options for +// DescribeInstanceTypes +type DescribeInstanceTypesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the next token + // value. + 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 +} + +// DescribeInstanceTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstanceTypes +type DescribeInstanceTypesPaginator struct { + options DescribeInstanceTypesPaginatorOptions + client DescribeInstanceTypesAPIClient + params *DescribeInstanceTypesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceTypesPaginator returns a new DescribeInstanceTypesPaginator +func NewDescribeInstanceTypesPaginator(client DescribeInstanceTypesAPIClient, params *DescribeInstanceTypesInput, optFns ...func(*DescribeInstanceTypesPaginatorOptions)) *DescribeInstanceTypesPaginator { + options := DescribeInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceTypesInput{} + } + + return &DescribeInstanceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceTypes page. +func (p *DescribeInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeInstanceTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInstances.go b/service/ec2/api_op_DescribeInstances.go index 7b4164e0f6a..cd706676557 100644 --- a/service/ec2/api_op_DescribeInstances.go +++ b/service/ec2/api_op_DescribeInstances.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -436,6 +437,90 @@ func addOperationDescribeInstancesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeInstancesAPIClient is a client that implements the DescribeInstances +// operation. +type DescribeInstancesAPIClient interface { + DescribeInstances(context.Context, *DescribeInstancesInput, ...func(*Options)) (*DescribeInstancesOutput, error) +} + +var _ DescribeInstancesAPIClient = (*Client)(nil) + +// DescribeInstancesPaginatorOptions is the paginator options for DescribeInstances +type DescribeInstancesPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 5 and 1000. You cannot specify this parameter and the + // instance IDs parameter in the same call. + 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 +} + +// DescribeInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInstances +type DescribeInstancesPaginator struct { + options DescribeInstancesPaginatorOptions + client DescribeInstancesAPIClient + params *DescribeInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancesInput{} + } + + return &DescribeInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstances page. +func (p *DescribeInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeInternetGateways.go b/service/ec2/api_op_DescribeInternetGateways.go index 25ffd3c9131..97cbd7c8b1c 100644 --- a/service/ec2/api_op_DescribeInternetGateways.go +++ b/service/ec2/api_op_DescribeInternetGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -141,6 +142,90 @@ func addOperationDescribeInternetGatewaysMiddlewares(stack *middleware.Stack, op return nil } +// DescribeInternetGatewaysAPIClient is a client that implements the +// DescribeInternetGateways operation. +type DescribeInternetGatewaysAPIClient interface { + DescribeInternetGateways(context.Context, *DescribeInternetGatewaysInput, ...func(*Options)) (*DescribeInternetGatewaysOutput, error) +} + +var _ DescribeInternetGatewaysAPIClient = (*Client)(nil) + +// DescribeInternetGatewaysPaginatorOptions is the paginator options for +// DescribeInternetGateways +type DescribeInternetGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeInternetGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeInternetGateways +type DescribeInternetGatewaysPaginator struct { + options DescribeInternetGatewaysPaginatorOptions + client DescribeInternetGatewaysAPIClient + params *DescribeInternetGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeInternetGatewaysPaginator returns a new +// DescribeInternetGatewaysPaginator +func NewDescribeInternetGatewaysPaginator(client DescribeInternetGatewaysAPIClient, params *DescribeInternetGatewaysInput, optFns ...func(*DescribeInternetGatewaysPaginatorOptions)) *DescribeInternetGatewaysPaginator { + options := DescribeInternetGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInternetGatewaysInput{} + } + + return &DescribeInternetGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInternetGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInternetGateways page. +func (p *DescribeInternetGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInternetGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInternetGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInternetGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeIpv6Pools.go b/service/ec2/api_op_DescribeIpv6Pools.go index a42e957a6b7..e722a60405b 100644 --- a/service/ec2/api_op_DescribeIpv6Pools.go +++ b/service/ec2/api_op_DescribeIpv6Pools.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -129,6 +130,88 @@ func addOperationDescribeIpv6PoolsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeIpv6PoolsAPIClient is a client that implements the DescribeIpv6Pools +// operation. +type DescribeIpv6PoolsAPIClient interface { + DescribeIpv6Pools(context.Context, *DescribeIpv6PoolsInput, ...func(*Options)) (*DescribeIpv6PoolsOutput, error) +} + +var _ DescribeIpv6PoolsAPIClient = (*Client)(nil) + +// DescribeIpv6PoolsPaginatorOptions is the paginator options for DescribeIpv6Pools +type DescribeIpv6PoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeIpv6PoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeIpv6Pools +type DescribeIpv6PoolsPaginator struct { + options DescribeIpv6PoolsPaginatorOptions + client DescribeIpv6PoolsAPIClient + params *DescribeIpv6PoolsInput + nextToken *string + firstPage bool +} + +// NewDescribeIpv6PoolsPaginator returns a new DescribeIpv6PoolsPaginator +func NewDescribeIpv6PoolsPaginator(client DescribeIpv6PoolsAPIClient, params *DescribeIpv6PoolsInput, optFns ...func(*DescribeIpv6PoolsPaginatorOptions)) *DescribeIpv6PoolsPaginator { + options := DescribeIpv6PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeIpv6PoolsInput{} + } + + return &DescribeIpv6PoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeIpv6PoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeIpv6Pools page. +func (p *DescribeIpv6PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeIpv6PoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeIpv6Pools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeIpv6Pools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLaunchTemplateVersions.go b/service/ec2/api_op_DescribeLaunchTemplateVersions.go index dad5875354a..11f13045e03 100644 --- a/service/ec2/api_op_DescribeLaunchTemplateVersions.go +++ b/service/ec2/api_op_DescribeLaunchTemplateVersions.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -170,6 +171,91 @@ func addOperationDescribeLaunchTemplateVersionsMiddlewares(stack *middleware.Sta return nil } +// DescribeLaunchTemplateVersionsAPIClient is a client that implements the +// DescribeLaunchTemplateVersions operation. +type DescribeLaunchTemplateVersionsAPIClient interface { + DescribeLaunchTemplateVersions(context.Context, *DescribeLaunchTemplateVersionsInput, ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) +} + +var _ DescribeLaunchTemplateVersionsAPIClient = (*Client)(nil) + +// DescribeLaunchTemplateVersionsPaginatorOptions is the paginator options for +// DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 1 and 200. + 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 +} + +// DescribeLaunchTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLaunchTemplateVersions +type DescribeLaunchTemplateVersionsPaginator struct { + options DescribeLaunchTemplateVersionsPaginatorOptions + client DescribeLaunchTemplateVersionsAPIClient + params *DescribeLaunchTemplateVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeLaunchTemplateVersionsPaginator returns a new +// DescribeLaunchTemplateVersionsPaginator +func NewDescribeLaunchTemplateVersionsPaginator(client DescribeLaunchTemplateVersionsAPIClient, params *DescribeLaunchTemplateVersionsInput, optFns ...func(*DescribeLaunchTemplateVersionsPaginatorOptions)) *DescribeLaunchTemplateVersionsPaginator { + options := DescribeLaunchTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchTemplateVersionsInput{} + } + + return &DescribeLaunchTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchTemplateVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLaunchTemplateVersions page. +func (p *DescribeLaunchTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLaunchTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLaunchTemplates.go b/service/ec2/api_op_DescribeLaunchTemplates.go index 1fc1afb2b52..de14423c714 100644 --- a/service/ec2/api_op_DescribeLaunchTemplates.go +++ b/service/ec2/api_op_DescribeLaunchTemplates.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -138,6 +139,91 @@ func addOperationDescribeLaunchTemplatesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeLaunchTemplatesAPIClient is a client that implements the +// DescribeLaunchTemplates operation. +type DescribeLaunchTemplatesAPIClient interface { + DescribeLaunchTemplates(context.Context, *DescribeLaunchTemplatesInput, ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) +} + +var _ DescribeLaunchTemplatesAPIClient = (*Client)(nil) + +// DescribeLaunchTemplatesPaginatorOptions is the paginator options for +// DescribeLaunchTemplates +type DescribeLaunchTemplatesPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. This + // value can be between 1 and 200. + 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 +} + +// DescribeLaunchTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLaunchTemplates +type DescribeLaunchTemplatesPaginator struct { + options DescribeLaunchTemplatesPaginatorOptions + client DescribeLaunchTemplatesAPIClient + params *DescribeLaunchTemplatesInput + nextToken *string + firstPage bool +} + +// NewDescribeLaunchTemplatesPaginator returns a new +// DescribeLaunchTemplatesPaginator +func NewDescribeLaunchTemplatesPaginator(client DescribeLaunchTemplatesAPIClient, params *DescribeLaunchTemplatesInput, optFns ...func(*DescribeLaunchTemplatesPaginatorOptions)) *DescribeLaunchTemplatesPaginator { + options := DescribeLaunchTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLaunchTemplatesInput{} + } + + return &DescribeLaunchTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLaunchTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLaunchTemplates page. +func (p *DescribeLaunchTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLaunchTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLaunchTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLaunchTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go b/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go index c3cb8013830..a6d08179b6b 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,95 @@ func addOperationDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations return nil } +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient is a +// client that implements the +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation. +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient interface { + DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(context.Context, *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) +} + +var _ DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions +// is the paginator options for +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator is a +// paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator struct { + options DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions + client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient + params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +// returns a new +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator(client DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput{} + } + + return &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations page. +func (p *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go b/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go index 39aba80e8e4..3061a4151dd 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTableVpcAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -133,6 +134,90 @@ func addOperationDescribeLocalGatewayRouteTableVpcAssociationsMiddlewares(stack return nil } +// DescribeLocalGatewayRouteTableVpcAssociationsAPIClient is a client that +// implements the DescribeLocalGatewayRouteTableVpcAssociations operation. +type DescribeLocalGatewayRouteTableVpcAssociationsAPIClient interface { + DescribeLocalGatewayRouteTableVpcAssociations(context.Context, *DescribeLocalGatewayRouteTableVpcAssociationsInput, ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) +} + +var _ DescribeLocalGatewayRouteTableVpcAssociationsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions is the paginator +// options for DescribeLocalGatewayRouteTableVpcAssociations +type DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewayRouteTableVpcAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTableVpcAssociations +type DescribeLocalGatewayRouteTableVpcAssociationsPaginator struct { + options DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions + client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient + params *DescribeLocalGatewayRouteTableVpcAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator returns a new +// DescribeLocalGatewayRouteTableVpcAssociationsPaginator +func NewDescribeLocalGatewayRouteTableVpcAssociationsPaginator(client DescribeLocalGatewayRouteTableVpcAssociationsAPIClient, params *DescribeLocalGatewayRouteTableVpcAssociationsInput, optFns ...func(*DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions)) *DescribeLocalGatewayRouteTableVpcAssociationsPaginator { + options := DescribeLocalGatewayRouteTableVpcAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTableVpcAssociationsInput{} + } + + return &DescribeLocalGatewayRouteTableVpcAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLocalGatewayRouteTableVpcAssociations page. +func (p *DescribeLocalGatewayRouteTableVpcAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGatewayRouteTableVpcAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTableVpcAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayRouteTables.go b/service/ec2/api_op_DescribeLocalGatewayRouteTables.go index 2a5f57e4fa0..8d44bacfb6a 100644 --- a/service/ec2/api_op_DescribeLocalGatewayRouteTables.go +++ b/service/ec2/api_op_DescribeLocalGatewayRouteTables.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -131,6 +132,90 @@ func addOperationDescribeLocalGatewayRouteTablesMiddlewares(stack *middleware.St return nil } +// DescribeLocalGatewayRouteTablesAPIClient is a client that implements the +// DescribeLocalGatewayRouteTables operation. +type DescribeLocalGatewayRouteTablesAPIClient interface { + DescribeLocalGatewayRouteTables(context.Context, *DescribeLocalGatewayRouteTablesInput, ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) +} + +var _ DescribeLocalGatewayRouteTablesAPIClient = (*Client)(nil) + +// DescribeLocalGatewayRouteTablesPaginatorOptions is the paginator options for +// DescribeLocalGatewayRouteTables +type DescribeLocalGatewayRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewayRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayRouteTables +type DescribeLocalGatewayRouteTablesPaginator struct { + options DescribeLocalGatewayRouteTablesPaginatorOptions + client DescribeLocalGatewayRouteTablesAPIClient + params *DescribeLocalGatewayRouteTablesInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewayRouteTablesPaginator returns a new +// DescribeLocalGatewayRouteTablesPaginator +func NewDescribeLocalGatewayRouteTablesPaginator(client DescribeLocalGatewayRouteTablesAPIClient, params *DescribeLocalGatewayRouteTablesInput, optFns ...func(*DescribeLocalGatewayRouteTablesPaginatorOptions)) *DescribeLocalGatewayRouteTablesPaginator { + options := DescribeLocalGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayRouteTablesInput{} + } + + return &DescribeLocalGatewayRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayRouteTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLocalGatewayRouteTables page. +func (p *DescribeLocalGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGatewayRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go index 6204485b3a3..dcade8876fa 100644 --- a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go +++ b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaceGroups.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -128,6 +129,90 @@ func addOperationDescribeLocalGatewayVirtualInterfaceGroupsMiddlewares(stack *mi return nil } +// DescribeLocalGatewayVirtualInterfaceGroupsAPIClient is a client that implements +// the DescribeLocalGatewayVirtualInterfaceGroups operation. +type DescribeLocalGatewayVirtualInterfaceGroupsAPIClient interface { + DescribeLocalGatewayVirtualInterfaceGroups(context.Context, *DescribeLocalGatewayVirtualInterfaceGroupsInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) +} + +var _ DescribeLocalGatewayVirtualInterfaceGroupsAPIClient = (*Client)(nil) + +// DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions is the paginator +// options for DescribeLocalGatewayVirtualInterfaceGroups +type DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewayVirtualInterfaceGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayVirtualInterfaceGroups +type DescribeLocalGatewayVirtualInterfaceGroupsPaginator struct { + options DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions + client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient + params *DescribeLocalGatewayVirtualInterfaceGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator returns a new +// DescribeLocalGatewayVirtualInterfaceGroupsPaginator +func NewDescribeLocalGatewayVirtualInterfaceGroupsPaginator(client DescribeLocalGatewayVirtualInterfaceGroupsAPIClient, params *DescribeLocalGatewayVirtualInterfaceGroupsInput, optFns ...func(*DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions)) *DescribeLocalGatewayVirtualInterfaceGroupsPaginator { + options := DescribeLocalGatewayVirtualInterfaceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayVirtualInterfaceGroupsInput{} + } + + return &DescribeLocalGatewayVirtualInterfaceGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaceGroups page. +func (p *DescribeLocalGatewayVirtualInterfaceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGatewayVirtualInterfaceGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaceGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go index a93d6851a96..fc94577b6d1 100644 --- a/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go +++ b/service/ec2/api_op_DescribeLocalGatewayVirtualInterfaces.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -119,6 +120,90 @@ func addOperationDescribeLocalGatewayVirtualInterfacesMiddlewares(stack *middlew return nil } +// DescribeLocalGatewayVirtualInterfacesAPIClient is a client that implements the +// DescribeLocalGatewayVirtualInterfaces operation. +type DescribeLocalGatewayVirtualInterfacesAPIClient interface { + DescribeLocalGatewayVirtualInterfaces(context.Context, *DescribeLocalGatewayVirtualInterfacesInput, ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) +} + +var _ DescribeLocalGatewayVirtualInterfacesAPIClient = (*Client)(nil) + +// DescribeLocalGatewayVirtualInterfacesPaginatorOptions is the paginator options +// for DescribeLocalGatewayVirtualInterfaces +type DescribeLocalGatewayVirtualInterfacesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewayVirtualInterfacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGatewayVirtualInterfaces +type DescribeLocalGatewayVirtualInterfacesPaginator struct { + options DescribeLocalGatewayVirtualInterfacesPaginatorOptions + client DescribeLocalGatewayVirtualInterfacesAPIClient + params *DescribeLocalGatewayVirtualInterfacesInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewayVirtualInterfacesPaginator returns a new +// DescribeLocalGatewayVirtualInterfacesPaginator +func NewDescribeLocalGatewayVirtualInterfacesPaginator(client DescribeLocalGatewayVirtualInterfacesAPIClient, params *DescribeLocalGatewayVirtualInterfacesInput, optFns ...func(*DescribeLocalGatewayVirtualInterfacesPaginatorOptions)) *DescribeLocalGatewayVirtualInterfacesPaginator { + options := DescribeLocalGatewayVirtualInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewayVirtualInterfacesInput{} + } + + return &DescribeLocalGatewayVirtualInterfacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewayVirtualInterfacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLocalGatewayVirtualInterfaces page. +func (p *DescribeLocalGatewayVirtualInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGatewayVirtualInterfaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGatewayVirtualInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeLocalGateways.go b/service/ec2/api_op_DescribeLocalGateways.go index 6460dbf3f6c..9ec443dfae8 100644 --- a/service/ec2/api_op_DescribeLocalGateways.go +++ b/service/ec2/api_op_DescribeLocalGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -137,6 +138,89 @@ func addOperationDescribeLocalGatewaysMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeLocalGatewaysAPIClient is a client that implements the +// DescribeLocalGateways operation. +type DescribeLocalGatewaysAPIClient interface { + DescribeLocalGateways(context.Context, *DescribeLocalGatewaysInput, ...func(*Options)) (*DescribeLocalGatewaysOutput, error) +} + +var _ DescribeLocalGatewaysAPIClient = (*Client)(nil) + +// DescribeLocalGatewaysPaginatorOptions is the paginator options for +// DescribeLocalGateways +type DescribeLocalGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeLocalGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeLocalGateways +type DescribeLocalGatewaysPaginator struct { + options DescribeLocalGatewaysPaginatorOptions + client DescribeLocalGatewaysAPIClient + params *DescribeLocalGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeLocalGatewaysPaginator returns a new DescribeLocalGatewaysPaginator +func NewDescribeLocalGatewaysPaginator(client DescribeLocalGatewaysAPIClient, params *DescribeLocalGatewaysInput, optFns ...func(*DescribeLocalGatewaysPaginatorOptions)) *DescribeLocalGatewaysPaginator { + options := DescribeLocalGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLocalGatewaysInput{} + } + + return &DescribeLocalGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLocalGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLocalGateways page. +func (p *DescribeLocalGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLocalGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeLocalGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLocalGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeManagedPrefixLists.go b/service/ec2/api_op_DescribeManagedPrefixLists.go index ff7e60c78b0..d8fac220870 100644 --- a/service/ec2/api_op_DescribeManagedPrefixLists.go +++ b/service/ec2/api_op_DescribeManagedPrefixLists.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -128,6 +129,90 @@ func addOperationDescribeManagedPrefixListsMiddlewares(stack *middleware.Stack, return nil } +// DescribeManagedPrefixListsAPIClient is a client that implements the +// DescribeManagedPrefixLists operation. +type DescribeManagedPrefixListsAPIClient interface { + DescribeManagedPrefixLists(context.Context, *DescribeManagedPrefixListsInput, ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) +} + +var _ DescribeManagedPrefixListsAPIClient = (*Client)(nil) + +// DescribeManagedPrefixListsPaginatorOptions is the paginator options for +// DescribeManagedPrefixLists +type DescribeManagedPrefixListsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeManagedPrefixListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeManagedPrefixLists +type DescribeManagedPrefixListsPaginator struct { + options DescribeManagedPrefixListsPaginatorOptions + client DescribeManagedPrefixListsAPIClient + params *DescribeManagedPrefixListsInput + nextToken *string + firstPage bool +} + +// NewDescribeManagedPrefixListsPaginator returns a new +// DescribeManagedPrefixListsPaginator +func NewDescribeManagedPrefixListsPaginator(client DescribeManagedPrefixListsAPIClient, params *DescribeManagedPrefixListsInput, optFns ...func(*DescribeManagedPrefixListsPaginatorOptions)) *DescribeManagedPrefixListsPaginator { + options := DescribeManagedPrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeManagedPrefixListsInput{} + } + + return &DescribeManagedPrefixListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeManagedPrefixListsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeManagedPrefixLists page. +func (p *DescribeManagedPrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeManagedPrefixListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeManagedPrefixLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeManagedPrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeMovingAddresses.go b/service/ec2/api_op_DescribeMovingAddresses.go index bd606d50ffa..2b9438746b9 100644 --- a/service/ec2/api_op_DescribeMovingAddresses.go +++ b/service/ec2/api_op_DescribeMovingAddresses.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -128,6 +129,93 @@ func addOperationDescribeMovingAddressesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeMovingAddressesAPIClient is a client that implements the +// DescribeMovingAddresses operation. +type DescribeMovingAddressesAPIClient interface { + DescribeMovingAddresses(context.Context, *DescribeMovingAddressesInput, ...func(*Options)) (*DescribeMovingAddressesOutput, error) +} + +var _ DescribeMovingAddressesAPIClient = (*Client)(nil) + +// DescribeMovingAddressesPaginatorOptions is the paginator options for +// DescribeMovingAddresses +type DescribeMovingAddressesPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1000; if + // MaxResults is given a value outside of this range, an error is returned. + // Default: If no value is provided, the default is 1000. + 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 +} + +// DescribeMovingAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeMovingAddresses +type DescribeMovingAddressesPaginator struct { + options DescribeMovingAddressesPaginatorOptions + client DescribeMovingAddressesAPIClient + params *DescribeMovingAddressesInput + nextToken *string + firstPage bool +} + +// NewDescribeMovingAddressesPaginator returns a new +// DescribeMovingAddressesPaginator +func NewDescribeMovingAddressesPaginator(client DescribeMovingAddressesAPIClient, params *DescribeMovingAddressesInput, optFns ...func(*DescribeMovingAddressesPaginatorOptions)) *DescribeMovingAddressesPaginator { + options := DescribeMovingAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMovingAddressesInput{} + } + + return &DescribeMovingAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMovingAddressesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMovingAddresses page. +func (p *DescribeMovingAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMovingAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMovingAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMovingAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNatGateways.go b/service/ec2/api_op_DescribeNatGateways.go index b2e75f2faa0..175cc6b5ae1 100644 --- a/service/ec2/api_op_DescribeNatGateways.go +++ b/service/ec2/api_op_DescribeNatGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -140,6 +141,89 @@ func addOperationDescribeNatGatewaysMiddlewares(stack *middleware.Stack, options return nil } +// DescribeNatGatewaysAPIClient is a client that implements the DescribeNatGateways +// operation. +type DescribeNatGatewaysAPIClient interface { + DescribeNatGateways(context.Context, *DescribeNatGatewaysInput, ...func(*Options)) (*DescribeNatGatewaysOutput, error) +} + +var _ DescribeNatGatewaysAPIClient = (*Client)(nil) + +// DescribeNatGatewaysPaginatorOptions is the paginator options for +// DescribeNatGateways +type DescribeNatGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeNatGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNatGateways +type DescribeNatGatewaysPaginator struct { + options DescribeNatGatewaysPaginatorOptions + client DescribeNatGatewaysAPIClient + params *DescribeNatGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeNatGatewaysPaginator returns a new DescribeNatGatewaysPaginator +func NewDescribeNatGatewaysPaginator(client DescribeNatGatewaysAPIClient, params *DescribeNatGatewaysInput, optFns ...func(*DescribeNatGatewaysPaginatorOptions)) *DescribeNatGatewaysPaginator { + options := DescribeNatGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNatGatewaysInput{} + } + + return &DescribeNatGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNatGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNatGateways page. +func (p *DescribeNatGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNatGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeNatGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNatGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkAcls.go b/service/ec2/api_op_DescribeNetworkAcls.go index 78351079110..c1fd811daec 100644 --- a/service/ec2/api_op_DescribeNetworkAcls.go +++ b/service/ec2/api_op_DescribeNetworkAcls.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -178,6 +179,89 @@ func addOperationDescribeNetworkAclsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeNetworkAclsAPIClient is a client that implements the DescribeNetworkAcls +// operation. +type DescribeNetworkAclsAPIClient interface { + DescribeNetworkAcls(context.Context, *DescribeNetworkAclsInput, ...func(*Options)) (*DescribeNetworkAclsOutput, error) +} + +var _ DescribeNetworkAclsAPIClient = (*Client)(nil) + +// DescribeNetworkAclsPaginatorOptions is the paginator options for +// DescribeNetworkAcls +type DescribeNetworkAclsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeNetworkAclsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkAcls +type DescribeNetworkAclsPaginator struct { + options DescribeNetworkAclsPaginatorOptions + client DescribeNetworkAclsAPIClient + params *DescribeNetworkAclsInput + nextToken *string + firstPage bool +} + +// NewDescribeNetworkAclsPaginator returns a new DescribeNetworkAclsPaginator +func NewDescribeNetworkAclsPaginator(client DescribeNetworkAclsAPIClient, params *DescribeNetworkAclsInput, optFns ...func(*DescribeNetworkAclsPaginatorOptions)) *DescribeNetworkAclsPaginator { + options := DescribeNetworkAclsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkAclsInput{} + } + + return &DescribeNetworkAclsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkAclsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNetworkAcls page. +func (p *DescribeNetworkAclsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkAclsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeNetworkAcls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkAcls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkInterfacePermissions.go b/service/ec2/api_op_DescribeNetworkInterfacePermissions.go index a1e468685e5..0fa4dbf2d4b 100644 --- a/service/ec2/api_op_DescribeNetworkInterfacePermissions.go +++ b/service/ec2/api_op_DescribeNetworkInterfacePermissions.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -131,6 +132,91 @@ func addOperationDescribeNetworkInterfacePermissionsMiddlewares(stack *middlewar return nil } +// DescribeNetworkInterfacePermissionsAPIClient is a client that implements the +// DescribeNetworkInterfacePermissions operation. +type DescribeNetworkInterfacePermissionsAPIClient interface { + DescribeNetworkInterfacePermissions(context.Context, *DescribeNetworkInterfacePermissionsInput, ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) +} + +var _ DescribeNetworkInterfacePermissionsAPIClient = (*Client)(nil) + +// DescribeNetworkInterfacePermissionsPaginatorOptions is the paginator options for +// DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. If this + // parameter is not specified, up to 50 results are returned by default. + 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 +} + +// DescribeNetworkInterfacePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkInterfacePermissions +type DescribeNetworkInterfacePermissionsPaginator struct { + options DescribeNetworkInterfacePermissionsPaginatorOptions + client DescribeNetworkInterfacePermissionsAPIClient + params *DescribeNetworkInterfacePermissionsInput + nextToken *string + firstPage bool +} + +// NewDescribeNetworkInterfacePermissionsPaginator returns a new +// DescribeNetworkInterfacePermissionsPaginator +func NewDescribeNetworkInterfacePermissionsPaginator(client DescribeNetworkInterfacePermissionsAPIClient, params *DescribeNetworkInterfacePermissionsInput, optFns ...func(*DescribeNetworkInterfacePermissionsPaginatorOptions)) *DescribeNetworkInterfacePermissionsPaginator { + options := DescribeNetworkInterfacePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkInterfacePermissionsInput{} + } + + return &DescribeNetworkInterfacePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkInterfacePermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNetworkInterfacePermissions page. +func (p *DescribeNetworkInterfacePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeNetworkInterfacePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkInterfacePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeNetworkInterfaces.go b/service/ec2/api_op_DescribeNetworkInterfaces.go index f0ca3c374d4..1d43a61565d 100644 --- a/service/ec2/api_op_DescribeNetworkInterfaces.go +++ b/service/ec2/api_op_DescribeNetworkInterfaces.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -241,6 +242,92 @@ func addOperationDescribeNetworkInterfacesMiddlewares(stack *middleware.Stack, o return nil } +// DescribeNetworkInterfacesAPIClient is a client that implements the +// DescribeNetworkInterfaces operation. +type DescribeNetworkInterfacesAPIClient interface { + DescribeNetworkInterfaces(context.Context, *DescribeNetworkInterfacesInput, ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) +} + +var _ DescribeNetworkInterfacesAPIClient = (*Client)(nil) + +// DescribeNetworkInterfacesPaginatorOptions is the paginator options for +// DescribeNetworkInterfaces +type DescribeNetworkInterfacesPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + // You cannot specify this parameter and the network interface IDs parameter in the + // same request. + 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 +} + +// DescribeNetworkInterfacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeNetworkInterfaces +type DescribeNetworkInterfacesPaginator struct { + options DescribeNetworkInterfacesPaginatorOptions + client DescribeNetworkInterfacesAPIClient + params *DescribeNetworkInterfacesInput + nextToken *string + firstPage bool +} + +// NewDescribeNetworkInterfacesPaginator returns a new +// DescribeNetworkInterfacesPaginator +func NewDescribeNetworkInterfacesPaginator(client DescribeNetworkInterfacesAPIClient, params *DescribeNetworkInterfacesInput, optFns ...func(*DescribeNetworkInterfacesPaginatorOptions)) *DescribeNetworkInterfacesPaginator { + options := DescribeNetworkInterfacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNetworkInterfacesInput{} + } + + return &DescribeNetworkInterfacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNetworkInterfacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNetworkInterfaces page. +func (p *DescribeNetworkInterfacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNetworkInterfacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeNetworkInterfaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNetworkInterfaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePrefixLists.go b/service/ec2/api_op_DescribePrefixLists.go index 25e52199f3c..e3d4b5a466d 100644 --- a/service/ec2/api_op_DescribePrefixLists.go +++ b/service/ec2/api_op_DescribePrefixLists.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -126,6 +127,89 @@ func addOperationDescribePrefixListsMiddlewares(stack *middleware.Stack, options return nil } +// DescribePrefixListsAPIClient is a client that implements the DescribePrefixLists +// operation. +type DescribePrefixListsAPIClient interface { + DescribePrefixLists(context.Context, *DescribePrefixListsInput, ...func(*Options)) (*DescribePrefixListsOutput, error) +} + +var _ DescribePrefixListsAPIClient = (*Client)(nil) + +// DescribePrefixListsPaginatorOptions is the paginator options for +// DescribePrefixLists +type DescribePrefixListsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribePrefixListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePrefixLists +type DescribePrefixListsPaginator struct { + options DescribePrefixListsPaginatorOptions + client DescribePrefixListsAPIClient + params *DescribePrefixListsInput + nextToken *string + firstPage bool +} + +// NewDescribePrefixListsPaginator returns a new DescribePrefixListsPaginator +func NewDescribePrefixListsPaginator(client DescribePrefixListsAPIClient, params *DescribePrefixListsInput, optFns ...func(*DescribePrefixListsPaginatorOptions)) *DescribePrefixListsPaginator { + options := DescribePrefixListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePrefixListsInput{} + } + + return &DescribePrefixListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePrefixListsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePrefixLists page. +func (p *DescribePrefixListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrefixListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePrefixLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePrefixLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePrincipalIdFormat.go b/service/ec2/api_op_DescribePrincipalIdFormat.go index 30437d1a44b..27c90b22b4d 100644 --- a/service/ec2/api_op_DescribePrincipalIdFormat.go +++ b/service/ec2/api_op_DescribePrincipalIdFormat.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -135,6 +136,90 @@ func addOperationDescribePrincipalIdFormatMiddlewares(stack *middleware.Stack, o return nil } +// DescribePrincipalIdFormatAPIClient is a client that implements the +// DescribePrincipalIdFormat operation. +type DescribePrincipalIdFormatAPIClient interface { + DescribePrincipalIdFormat(context.Context, *DescribePrincipalIdFormatInput, ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) +} + +var _ DescribePrincipalIdFormatAPIClient = (*Client)(nil) + +// DescribePrincipalIdFormatPaginatorOptions is the paginator options for +// DescribePrincipalIdFormat +type DescribePrincipalIdFormatPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another call with the returned NextToken value. + 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 +} + +// DescribePrincipalIdFormatPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePrincipalIdFormat +type DescribePrincipalIdFormatPaginator struct { + options DescribePrincipalIdFormatPaginatorOptions + client DescribePrincipalIdFormatAPIClient + params *DescribePrincipalIdFormatInput + nextToken *string + firstPage bool +} + +// NewDescribePrincipalIdFormatPaginator returns a new +// DescribePrincipalIdFormatPaginator +func NewDescribePrincipalIdFormatPaginator(client DescribePrincipalIdFormatAPIClient, params *DescribePrincipalIdFormatInput, optFns ...func(*DescribePrincipalIdFormatPaginatorOptions)) *DescribePrincipalIdFormatPaginator { + options := DescribePrincipalIdFormatPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePrincipalIdFormatInput{} + } + + return &DescribePrincipalIdFormatPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePrincipalIdFormatPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePrincipalIdFormat page. +func (p *DescribePrincipalIdFormatPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePrincipalIdFormatOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePrincipalIdFormat(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePrincipalIdFormat(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribePublicIpv4Pools.go b/service/ec2/api_op_DescribePublicIpv4Pools.go index b7c2ba179d4..c4edefe7218 100644 --- a/service/ec2/api_op_DescribePublicIpv4Pools.go +++ b/service/ec2/api_op_DescribePublicIpv4Pools.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -123,6 +124,90 @@ func addOperationDescribePublicIpv4PoolsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribePublicIpv4PoolsAPIClient is a client that implements the +// DescribePublicIpv4Pools operation. +type DescribePublicIpv4PoolsAPIClient interface { + DescribePublicIpv4Pools(context.Context, *DescribePublicIpv4PoolsInput, ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) +} + +var _ DescribePublicIpv4PoolsAPIClient = (*Client)(nil) + +// DescribePublicIpv4PoolsPaginatorOptions is the paginator options for +// DescribePublicIpv4Pools +type DescribePublicIpv4PoolsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribePublicIpv4PoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribePublicIpv4Pools +type DescribePublicIpv4PoolsPaginator struct { + options DescribePublicIpv4PoolsPaginatorOptions + client DescribePublicIpv4PoolsAPIClient + params *DescribePublicIpv4PoolsInput + nextToken *string + firstPage bool +} + +// NewDescribePublicIpv4PoolsPaginator returns a new +// DescribePublicIpv4PoolsPaginator +func NewDescribePublicIpv4PoolsPaginator(client DescribePublicIpv4PoolsAPIClient, params *DescribePublicIpv4PoolsInput, optFns ...func(*DescribePublicIpv4PoolsPaginatorOptions)) *DescribePublicIpv4PoolsPaginator { + options := DescribePublicIpv4PoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePublicIpv4PoolsInput{} + } + + return &DescribePublicIpv4PoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePublicIpv4PoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePublicIpv4Pools page. +func (p *DescribePublicIpv4PoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePublicIpv4PoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePublicIpv4Pools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePublicIpv4Pools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeReservedInstancesModifications.go b/service/ec2/api_op_DescribeReservedInstancesModifications.go index 8d68290dd70..fc806154f90 100644 --- a/service/ec2/api_op_DescribeReservedInstancesModifications.go +++ b/service/ec2/api_op_DescribeReservedInstancesModifications.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -160,6 +161,82 @@ func addOperationDescribeReservedInstancesModificationsMiddlewares(stack *middle return nil } +// DescribeReservedInstancesModificationsAPIClient is a client that implements the +// DescribeReservedInstancesModifications operation. +type DescribeReservedInstancesModificationsAPIClient interface { + DescribeReservedInstancesModifications(context.Context, *DescribeReservedInstancesModificationsInput, ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) +} + +var _ DescribeReservedInstancesModificationsAPIClient = (*Client)(nil) + +// DescribeReservedInstancesModificationsPaginatorOptions is the paginator options +// for DescribeReservedInstancesModifications +type DescribeReservedInstancesModificationsPaginatorOptions struct { + // 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 +} + +// DescribeReservedInstancesModificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeReservedInstancesModifications +type DescribeReservedInstancesModificationsPaginator struct { + options DescribeReservedInstancesModificationsPaginatorOptions + client DescribeReservedInstancesModificationsAPIClient + params *DescribeReservedInstancesModificationsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedInstancesModificationsPaginator returns a new +// DescribeReservedInstancesModificationsPaginator +func NewDescribeReservedInstancesModificationsPaginator(client DescribeReservedInstancesModificationsAPIClient, params *DescribeReservedInstancesModificationsInput, optFns ...func(*DescribeReservedInstancesModificationsPaginatorOptions)) *DescribeReservedInstancesModificationsPaginator { + options := DescribeReservedInstancesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedInstancesModificationsInput{} + } + + return &DescribeReservedInstancesModificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedInstancesModificationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedInstancesModifications page. +func (p *DescribeReservedInstancesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesModificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeReservedInstancesModifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedInstancesModifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeReservedInstancesOfferings.go b/service/ec2/api_op_DescribeReservedInstancesOfferings.go index cee05ded2db..c1f99f9fb34 100644 --- a/service/ec2/api_op_DescribeReservedInstancesOfferings.go +++ b/service/ec2/api_op_DescribeReservedInstancesOfferings.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -211,6 +212,91 @@ func addOperationDescribeReservedInstancesOfferingsMiddlewares(stack *middleware return nil } +// DescribeReservedInstancesOfferingsAPIClient is a client that implements the +// DescribeReservedInstancesOfferings operation. +type DescribeReservedInstancesOfferingsAPIClient interface { + DescribeReservedInstancesOfferings(context.Context, *DescribeReservedInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) +} + +var _ DescribeReservedInstancesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedInstancesOfferingsPaginatorOptions is the paginator options for +// DescribeReservedInstancesOfferings +type DescribeReservedInstancesOfferingsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. The maximum is 100. Default: 100 + 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 +} + +// DescribeReservedInstancesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeReservedInstancesOfferings +type DescribeReservedInstancesOfferingsPaginator struct { + options DescribeReservedInstancesOfferingsPaginatorOptions + client DescribeReservedInstancesOfferingsAPIClient + params *DescribeReservedInstancesOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedInstancesOfferingsPaginator returns a new +// DescribeReservedInstancesOfferingsPaginator +func NewDescribeReservedInstancesOfferingsPaginator(client DescribeReservedInstancesOfferingsAPIClient, params *DescribeReservedInstancesOfferingsInput, optFns ...func(*DescribeReservedInstancesOfferingsPaginatorOptions)) *DescribeReservedInstancesOfferingsPaginator { + options := DescribeReservedInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedInstancesOfferingsInput{} + } + + return &DescribeReservedInstancesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedInstancesOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedInstancesOfferings page. +func (p *DescribeReservedInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedInstancesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeReservedInstancesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeRouteTables.go b/service/ec2/api_op_DescribeRouteTables.go index 63c600df51b..fa310c1a92d 100644 --- a/service/ec2/api_op_DescribeRouteTables.go +++ b/service/ec2/api_op_DescribeRouteTables.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -198,6 +199,89 @@ func addOperationDescribeRouteTablesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeRouteTablesAPIClient is a client that implements the DescribeRouteTables +// operation. +type DescribeRouteTablesAPIClient interface { + DescribeRouteTables(context.Context, *DescribeRouteTablesInput, ...func(*Options)) (*DescribeRouteTablesOutput, error) +} + +var _ DescribeRouteTablesAPIClient = (*Client)(nil) + +// DescribeRouteTablesPaginatorOptions is the paginator options for +// DescribeRouteTables +type DescribeRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeRouteTables +type DescribeRouteTablesPaginator struct { + options DescribeRouteTablesPaginatorOptions + client DescribeRouteTablesAPIClient + params *DescribeRouteTablesInput + nextToken *string + firstPage bool +} + +// NewDescribeRouteTablesPaginator returns a new DescribeRouteTablesPaginator +func NewDescribeRouteTablesPaginator(client DescribeRouteTablesAPIClient, params *DescribeRouteTablesInput, optFns ...func(*DescribeRouteTablesPaginatorOptions)) *DescribeRouteTablesPaginator { + options := DescribeRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRouteTablesInput{} + } + + return &DescribeRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRouteTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeRouteTables page. +func (p *DescribeRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeScheduledInstanceAvailability.go b/service/ec2/api_op_DescribeScheduledInstanceAvailability.go index 0b3925a7fe9..180a55c2dd4 100644 --- a/service/ec2/api_op_DescribeScheduledInstanceAvailability.go +++ b/service/ec2/api_op_DescribeScheduledInstanceAvailability.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -158,6 +159,91 @@ func addOperationDescribeScheduledInstanceAvailabilityMiddlewares(stack *middlew return nil } +// DescribeScheduledInstanceAvailabilityAPIClient is a client that implements the +// DescribeScheduledInstanceAvailability operation. +type DescribeScheduledInstanceAvailabilityAPIClient interface { + DescribeScheduledInstanceAvailability(context.Context, *DescribeScheduledInstanceAvailabilityInput, ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) +} + +var _ DescribeScheduledInstanceAvailabilityAPIClient = (*Client)(nil) + +// DescribeScheduledInstanceAvailabilityPaginatorOptions is the paginator options +// for DescribeScheduledInstanceAvailability +type DescribeScheduledInstanceAvailabilityPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 300. The default value is 300. To retrieve the remaining results, + // make another call with the returned NextToken value. + 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 +} + +// DescribeScheduledInstanceAvailabilityPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeScheduledInstanceAvailability +type DescribeScheduledInstanceAvailabilityPaginator struct { + options DescribeScheduledInstanceAvailabilityPaginatorOptions + client DescribeScheduledInstanceAvailabilityAPIClient + params *DescribeScheduledInstanceAvailabilityInput + nextToken *string + firstPage bool +} + +// NewDescribeScheduledInstanceAvailabilityPaginator returns a new +// DescribeScheduledInstanceAvailabilityPaginator +func NewDescribeScheduledInstanceAvailabilityPaginator(client DescribeScheduledInstanceAvailabilityAPIClient, params *DescribeScheduledInstanceAvailabilityInput, optFns ...func(*DescribeScheduledInstanceAvailabilityPaginatorOptions)) *DescribeScheduledInstanceAvailabilityPaginator { + options := DescribeScheduledInstanceAvailabilityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledInstanceAvailabilityInput{} + } + + return &DescribeScheduledInstanceAvailabilityPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledInstanceAvailabilityPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScheduledInstanceAvailability page. +func (p *DescribeScheduledInstanceAvailabilityPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstanceAvailabilityOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeScheduledInstanceAvailability(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledInstanceAvailability(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeScheduledInstances.go b/service/ec2/api_op_DescribeScheduledInstances.go index a65cfb513d8..c6c93aa4048 100644 --- a/service/ec2/api_op_DescribeScheduledInstances.go +++ b/service/ec2/api_op_DescribeScheduledInstances.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -136,6 +137,91 @@ func addOperationDescribeScheduledInstancesMiddlewares(stack *middleware.Stack, return nil } +// DescribeScheduledInstancesAPIClient is a client that implements the +// DescribeScheduledInstances operation. +type DescribeScheduledInstancesAPIClient interface { + DescribeScheduledInstances(context.Context, *DescribeScheduledInstancesInput, ...func(*Options)) (*DescribeScheduledInstancesOutput, error) +} + +var _ DescribeScheduledInstancesAPIClient = (*Client)(nil) + +// DescribeScheduledInstancesPaginatorOptions is the paginator options for +// DescribeScheduledInstances +type DescribeScheduledInstancesPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 300. The default value is 100. To retrieve the remaining results, + // make another call with the returned NextToken value. + 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 +} + +// DescribeScheduledInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeScheduledInstances +type DescribeScheduledInstancesPaginator struct { + options DescribeScheduledInstancesPaginatorOptions + client DescribeScheduledInstancesAPIClient + params *DescribeScheduledInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeScheduledInstancesPaginator returns a new +// DescribeScheduledInstancesPaginator +func NewDescribeScheduledInstancesPaginator(client DescribeScheduledInstancesAPIClient, params *DescribeScheduledInstancesInput, optFns ...func(*DescribeScheduledInstancesPaginatorOptions)) *DescribeScheduledInstancesPaginator { + options := DescribeScheduledInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledInstancesInput{} + } + + return &DescribeScheduledInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScheduledInstances page. +func (p *DescribeScheduledInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeScheduledInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSecurityGroups.go b/service/ec2/api_op_DescribeSecurityGroups.go index b2e7ee2f814..bbcfa6fcd6e 100644 --- a/service/ec2/api_op_DescribeSecurityGroups.go +++ b/service/ec2/api_op_DescribeSecurityGroups.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -223,6 +224,91 @@ func addOperationDescribeSecurityGroupsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeSecurityGroupsAPIClient is a client that implements the +// DescribeSecurityGroups operation. +type DescribeSecurityGroupsAPIClient interface { + DescribeSecurityGroups(context.Context, *DescribeSecurityGroupsInput, ...func(*Options)) (*DescribeSecurityGroupsOutput, error) +} + +var _ DescribeSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeSecurityGroupsPaginatorOptions is the paginator options for +// DescribeSecurityGroups +type DescribeSecurityGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another request with the returned NextToken value. This + // value can be between 5 and 1000. If this parameter is not specified, then all + // results are returned. + 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 +} + +// DescribeSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSecurityGroups +type DescribeSecurityGroupsPaginator struct { + options DescribeSecurityGroupsPaginatorOptions + client DescribeSecurityGroupsAPIClient + params *DescribeSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeSecurityGroupsPaginator returns a new DescribeSecurityGroupsPaginator +func NewDescribeSecurityGroupsPaginator(client DescribeSecurityGroupsAPIClient, params *DescribeSecurityGroupsInput, optFns ...func(*DescribeSecurityGroupsPaginatorOptions)) *DescribeSecurityGroupsPaginator { + options := DescribeSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSecurityGroupsInput{} + } + + return &DescribeSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSecurityGroups page. +func (p *DescribeSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSnapshots.go b/service/ec2/api_op_DescribeSnapshots.go index 11f4b4e2695..52a77d6132f 100644 --- a/service/ec2/api_op_DescribeSnapshots.go +++ b/service/ec2/api_op_DescribeSnapshots.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -220,6 +221,95 @@ func addOperationDescribeSnapshotsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeSnapshotsAPIClient is a client that implements the DescribeSnapshots +// operation. +type DescribeSnapshotsAPIClient interface { + DescribeSnapshots(context.Context, *DescribeSnapshotsInput, ...func(*Options)) (*DescribeSnapshotsOutput, error) +} + +var _ DescribeSnapshotsAPIClient = (*Client)(nil) + +// DescribeSnapshotsPaginatorOptions is the paginator options for DescribeSnapshots +type DescribeSnapshotsPaginatorOptions struct { + // The maximum number of snapshot results returned by DescribeSnapshots in + // paginated output. When this parameter is used, DescribeSnapshots only returns + // MaxResults results in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeSnapshots request with the returned NextToken value. This value can be + // between 5 and 1000; if MaxResults is given a value larger than 1000, only 1000 + // results are returned. If this parameter is not used, then DescribeSnapshots + // returns all results. You cannot specify this parameter and the snapshot IDs + // parameter in the same request. + 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 +} + +// DescribeSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSnapshots +type DescribeSnapshotsPaginator struct { + options DescribeSnapshotsPaginatorOptions + client DescribeSnapshotsAPIClient + params *DescribeSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSnapshotsInput{} + } + + return &DescribeSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSnapshots page. +func (p *DescribeSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotFleetRequests.go b/service/ec2/api_op_DescribeSpotFleetRequests.go index 49a0f38c69f..736599e590a 100644 --- a/service/ec2/api_op_DescribeSpotFleetRequests.go +++ b/service/ec2/api_op_DescribeSpotFleetRequests.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -120,6 +121,91 @@ func addOperationDescribeSpotFleetRequestsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeSpotFleetRequestsAPIClient is a client that implements the +// DescribeSpotFleetRequests operation. +type DescribeSpotFleetRequestsAPIClient interface { + DescribeSpotFleetRequests(context.Context, *DescribeSpotFleetRequestsInput, ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) +} + +var _ DescribeSpotFleetRequestsAPIClient = (*Client)(nil) + +// DescribeSpotFleetRequestsPaginatorOptions is the paginator options for +// DescribeSpotFleetRequests +type DescribeSpotFleetRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + 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 +} + +// DescribeSpotFleetRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotFleetRequests +type DescribeSpotFleetRequestsPaginator struct { + options DescribeSpotFleetRequestsPaginatorOptions + client DescribeSpotFleetRequestsAPIClient + params *DescribeSpotFleetRequestsInput + nextToken *string + firstPage bool +} + +// NewDescribeSpotFleetRequestsPaginator returns a new +// DescribeSpotFleetRequestsPaginator +func NewDescribeSpotFleetRequestsPaginator(client DescribeSpotFleetRequestsAPIClient, params *DescribeSpotFleetRequestsInput, optFns ...func(*DescribeSpotFleetRequestsPaginatorOptions)) *DescribeSpotFleetRequestsPaginator { + options := DescribeSpotFleetRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotFleetRequestsInput{} + } + + return &DescribeSpotFleetRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotFleetRequestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSpotFleetRequests page. +func (p *DescribeSpotFleetRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotFleetRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSpotFleetRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotFleetRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotInstanceRequests.go b/service/ec2/api_op_DescribeSpotInstanceRequests.go index 97c8aab5302..cadf1eb6ff3 100644 --- a/service/ec2/api_op_DescribeSpotInstanceRequests.go +++ b/service/ec2/api_op_DescribeSpotInstanceRequests.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -264,6 +265,91 @@ func addOperationDescribeSpotInstanceRequestsMiddlewares(stack *middleware.Stack return nil } +// DescribeSpotInstanceRequestsAPIClient is a client that implements the +// DescribeSpotInstanceRequests operation. +type DescribeSpotInstanceRequestsAPIClient interface { + DescribeSpotInstanceRequests(context.Context, *DescribeSpotInstanceRequestsInput, ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) +} + +var _ DescribeSpotInstanceRequestsAPIClient = (*Client)(nil) + +// DescribeSpotInstanceRequestsPaginatorOptions is the paginator options for +// DescribeSpotInstanceRequests +type DescribeSpotInstanceRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 5 and 1000. To retrieve the remaining results, make another call with + // the returned NextToken value. + 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 +} + +// DescribeSpotInstanceRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotInstanceRequests +type DescribeSpotInstanceRequestsPaginator struct { + options DescribeSpotInstanceRequestsPaginatorOptions + client DescribeSpotInstanceRequestsAPIClient + params *DescribeSpotInstanceRequestsInput + nextToken *string + firstPage bool +} + +// NewDescribeSpotInstanceRequestsPaginator returns a new +// DescribeSpotInstanceRequestsPaginator +func NewDescribeSpotInstanceRequestsPaginator(client DescribeSpotInstanceRequestsAPIClient, params *DescribeSpotInstanceRequestsInput, optFns ...func(*DescribeSpotInstanceRequestsPaginatorOptions)) *DescribeSpotInstanceRequestsPaginator { + options := DescribeSpotInstanceRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotInstanceRequestsInput{} + } + + return &DescribeSpotInstanceRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotInstanceRequestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSpotInstanceRequests page. +func (p *DescribeSpotInstanceRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotInstanceRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSpotInstanceRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotInstanceRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSpotPriceHistory.go b/service/ec2/api_op_DescribeSpotPriceHistory.go index 2e8d3c696ce..02fa82931af 100644 --- a/service/ec2/api_op_DescribeSpotPriceHistory.go +++ b/service/ec2/api_op_DescribeSpotPriceHistory.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -163,6 +164,91 @@ func addOperationDescribeSpotPriceHistoryMiddlewares(stack *middleware.Stack, op return nil } +// DescribeSpotPriceHistoryAPIClient is a client that implements the +// DescribeSpotPriceHistory operation. +type DescribeSpotPriceHistoryAPIClient interface { + DescribeSpotPriceHistory(context.Context, *DescribeSpotPriceHistoryInput, ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) +} + +var _ DescribeSpotPriceHistoryAPIClient = (*Client)(nil) + +// DescribeSpotPriceHistoryPaginatorOptions is the paginator options for +// DescribeSpotPriceHistory +type DescribeSpotPriceHistoryPaginatorOptions struct { + // The maximum number of results to return in a single call. Specify a value + // between 1 and 1000. The default value is 1000. To retrieve the remaining + // results, make another call with the returned NextToken value. + 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 +} + +// DescribeSpotPriceHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSpotPriceHistory +type DescribeSpotPriceHistoryPaginator struct { + options DescribeSpotPriceHistoryPaginatorOptions + client DescribeSpotPriceHistoryAPIClient + params *DescribeSpotPriceHistoryInput + nextToken *string + firstPage bool +} + +// NewDescribeSpotPriceHistoryPaginator returns a new +// DescribeSpotPriceHistoryPaginator +func NewDescribeSpotPriceHistoryPaginator(client DescribeSpotPriceHistoryAPIClient, params *DescribeSpotPriceHistoryInput, optFns ...func(*DescribeSpotPriceHistoryPaginatorOptions)) *DescribeSpotPriceHistoryPaginator { + options := DescribeSpotPriceHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSpotPriceHistoryInput{} + } + + return &DescribeSpotPriceHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSpotPriceHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSpotPriceHistory page. +func (p *DescribeSpotPriceHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSpotPriceHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSpotPriceHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSpotPriceHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeStaleSecurityGroups.go b/service/ec2/api_op_DescribeStaleSecurityGroups.go index fc8b36c51e0..ec37e5d1d07 100644 --- a/service/ec2/api_op_DescribeStaleSecurityGroups.go +++ b/service/ec2/api_op_DescribeStaleSecurityGroups.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -125,6 +126,90 @@ func addOperationDescribeStaleSecurityGroupsMiddlewares(stack *middleware.Stack, return nil } +// DescribeStaleSecurityGroupsAPIClient is a client that implements the +// DescribeStaleSecurityGroups operation. +type DescribeStaleSecurityGroupsAPIClient interface { + DescribeStaleSecurityGroups(context.Context, *DescribeStaleSecurityGroupsInput, ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) +} + +var _ DescribeStaleSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeStaleSecurityGroupsPaginatorOptions is the paginator options for +// DescribeStaleSecurityGroups +type DescribeStaleSecurityGroupsPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeStaleSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeStaleSecurityGroups +type DescribeStaleSecurityGroupsPaginator struct { + options DescribeStaleSecurityGroupsPaginatorOptions + client DescribeStaleSecurityGroupsAPIClient + params *DescribeStaleSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeStaleSecurityGroupsPaginator returns a new +// DescribeStaleSecurityGroupsPaginator +func NewDescribeStaleSecurityGroupsPaginator(client DescribeStaleSecurityGroupsAPIClient, params *DescribeStaleSecurityGroupsInput, optFns ...func(*DescribeStaleSecurityGroupsPaginatorOptions)) *DescribeStaleSecurityGroupsPaginator { + options := DescribeStaleSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStaleSecurityGroupsInput{} + } + + return &DescribeStaleSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStaleSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStaleSecurityGroups page. +func (p *DescribeStaleSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStaleSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeStaleSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStaleSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeSubnets.go b/service/ec2/api_op_DescribeSubnets.go index aa92436fed2..14f641a4fbc 100644 --- a/service/ec2/api_op_DescribeSubnets.go +++ b/service/ec2/api_op_DescribeSubnets.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -174,6 +175,88 @@ func addOperationDescribeSubnetsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeSubnetsAPIClient is a client that implements the DescribeSubnets +// operation. +type DescribeSubnetsAPIClient interface { + DescribeSubnets(context.Context, *DescribeSubnetsInput, ...func(*Options)) (*DescribeSubnetsOutput, error) +} + +var _ DescribeSubnetsAPIClient = (*Client)(nil) + +// DescribeSubnetsPaginatorOptions is the paginator options for DescribeSubnets +type DescribeSubnetsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeSubnetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeSubnets +type DescribeSubnetsPaginator struct { + options DescribeSubnetsPaginatorOptions + client DescribeSubnetsAPIClient + params *DescribeSubnetsInput + nextToken *string + firstPage bool +} + +// NewDescribeSubnetsPaginator returns a new DescribeSubnetsPaginator +func NewDescribeSubnetsPaginator(client DescribeSubnetsAPIClient, params *DescribeSubnetsInput, optFns ...func(*DescribeSubnetsPaginatorOptions)) *DescribeSubnetsPaginator { + options := DescribeSubnetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSubnetsInput{} + } + + return &DescribeSubnetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSubnetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSubnets page. +func (p *DescribeSubnetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSubnetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSubnets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSubnets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTags.go b/service/ec2/api_op_DescribeTags.go index 8f3a68c9155..7aec36dc465 100644 --- a/service/ec2/api_op_DescribeTags.go +++ b/service/ec2/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -139,6 +140,88 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return nil } +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // The maximum number of results to return in a single call. This value can be + // between 5 and 1000. To retrieve the remaining results, make another call with + // the returned NextToken value. + 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 +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorFilters.go b/service/ec2/api_op_DescribeTrafficMirrorFilters.go index bd3150c58f9..749dda778b3 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorFilters.go +++ b/service/ec2/api_op_DescribeTrafficMirrorFilters.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -125,6 +126,90 @@ func addOperationDescribeTrafficMirrorFiltersMiddlewares(stack *middleware.Stack return nil } +// DescribeTrafficMirrorFiltersAPIClient is a client that implements the +// DescribeTrafficMirrorFilters operation. +type DescribeTrafficMirrorFiltersAPIClient interface { + DescribeTrafficMirrorFilters(context.Context, *DescribeTrafficMirrorFiltersInput, ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) +} + +var _ DescribeTrafficMirrorFiltersAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorFiltersPaginatorOptions is the paginator options for +// DescribeTrafficMirrorFilters +type DescribeTrafficMirrorFiltersPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTrafficMirrorFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorFilters +type DescribeTrafficMirrorFiltersPaginator struct { + options DescribeTrafficMirrorFiltersPaginatorOptions + client DescribeTrafficMirrorFiltersAPIClient + params *DescribeTrafficMirrorFiltersInput + nextToken *string + firstPage bool +} + +// NewDescribeTrafficMirrorFiltersPaginator returns a new +// DescribeTrafficMirrorFiltersPaginator +func NewDescribeTrafficMirrorFiltersPaginator(client DescribeTrafficMirrorFiltersAPIClient, params *DescribeTrafficMirrorFiltersInput, optFns ...func(*DescribeTrafficMirrorFiltersPaginatorOptions)) *DescribeTrafficMirrorFiltersPaginator { + options := DescribeTrafficMirrorFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorFiltersInput{} + } + + return &DescribeTrafficMirrorFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTrafficMirrorFilters page. +func (p *DescribeTrafficMirrorFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTrafficMirrorFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorSessions.go b/service/ec2/api_op_DescribeTrafficMirrorSessions.go index d06b515157f..c77b3b73c23 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorSessions.go +++ b/service/ec2/api_op_DescribeTrafficMirrorSessions.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -147,6 +148,90 @@ func addOperationDescribeTrafficMirrorSessionsMiddlewares(stack *middleware.Stac return nil } +// DescribeTrafficMirrorSessionsAPIClient is a client that implements the +// DescribeTrafficMirrorSessions operation. +type DescribeTrafficMirrorSessionsAPIClient interface { + DescribeTrafficMirrorSessions(context.Context, *DescribeTrafficMirrorSessionsInput, ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) +} + +var _ DescribeTrafficMirrorSessionsAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorSessionsPaginatorOptions is the paginator options for +// DescribeTrafficMirrorSessions +type DescribeTrafficMirrorSessionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTrafficMirrorSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorSessions +type DescribeTrafficMirrorSessionsPaginator struct { + options DescribeTrafficMirrorSessionsPaginatorOptions + client DescribeTrafficMirrorSessionsAPIClient + params *DescribeTrafficMirrorSessionsInput + nextToken *string + firstPage bool +} + +// NewDescribeTrafficMirrorSessionsPaginator returns a new +// DescribeTrafficMirrorSessionsPaginator +func NewDescribeTrafficMirrorSessionsPaginator(client DescribeTrafficMirrorSessionsAPIClient, params *DescribeTrafficMirrorSessionsInput, optFns ...func(*DescribeTrafficMirrorSessionsPaginatorOptions)) *DescribeTrafficMirrorSessionsPaginator { + options := DescribeTrafficMirrorSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorSessionsInput{} + } + + return &DescribeTrafficMirrorSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTrafficMirrorSessions page. +func (p *DescribeTrafficMirrorSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTrafficMirrorSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTrafficMirrorTargets.go b/service/ec2/api_op_DescribeTrafficMirrorTargets.go index 60c11b9c086..b44cd0785e6 100644 --- a/service/ec2/api_op_DescribeTrafficMirrorTargets.go +++ b/service/ec2/api_op_DescribeTrafficMirrorTargets.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,90 @@ func addOperationDescribeTrafficMirrorTargetsMiddlewares(stack *middleware.Stack return nil } +// DescribeTrafficMirrorTargetsAPIClient is a client that implements the +// DescribeTrafficMirrorTargets operation. +type DescribeTrafficMirrorTargetsAPIClient interface { + DescribeTrafficMirrorTargets(context.Context, *DescribeTrafficMirrorTargetsInput, ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) +} + +var _ DescribeTrafficMirrorTargetsAPIClient = (*Client)(nil) + +// DescribeTrafficMirrorTargetsPaginatorOptions is the paginator options for +// DescribeTrafficMirrorTargets +type DescribeTrafficMirrorTargetsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTrafficMirrorTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTrafficMirrorTargets +type DescribeTrafficMirrorTargetsPaginator struct { + options DescribeTrafficMirrorTargetsPaginatorOptions + client DescribeTrafficMirrorTargetsAPIClient + params *DescribeTrafficMirrorTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeTrafficMirrorTargetsPaginator returns a new +// DescribeTrafficMirrorTargetsPaginator +func NewDescribeTrafficMirrorTargetsPaginator(client DescribeTrafficMirrorTargetsAPIClient, params *DescribeTrafficMirrorTargetsInput, optFns ...func(*DescribeTrafficMirrorTargetsPaginatorOptions)) *DescribeTrafficMirrorTargetsPaginator { + options := DescribeTrafficMirrorTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTrafficMirrorTargetsInput{} + } + + return &DescribeTrafficMirrorTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTrafficMirrorTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTrafficMirrorTargets page. +func (p *DescribeTrafficMirrorTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTrafficMirrorTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTrafficMirrorTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTrafficMirrorTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayAttachments.go b/service/ec2/api_op_DescribeTransitGatewayAttachments.go index b15fdd0b56e..d9e75b63b97 100644 --- a/service/ec2/api_op_DescribeTransitGatewayAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayAttachments.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -150,6 +151,90 @@ func addOperationDescribeTransitGatewayAttachmentsMiddlewares(stack *middleware. return nil } +// DescribeTransitGatewayAttachmentsAPIClient is a client that implements the +// DescribeTransitGatewayAttachments operation. +type DescribeTransitGatewayAttachmentsAPIClient interface { + DescribeTransitGatewayAttachments(context.Context, *DescribeTransitGatewayAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayAttachmentsPaginatorOptions is the paginator options for +// DescribeTransitGatewayAttachments +type DescribeTransitGatewayAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewayAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayAttachments +type DescribeTransitGatewayAttachmentsPaginator struct { + options DescribeTransitGatewayAttachmentsPaginatorOptions + client DescribeTransitGatewayAttachmentsAPIClient + params *DescribeTransitGatewayAttachmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewayAttachmentsPaginator returns a new +// DescribeTransitGatewayAttachmentsPaginator +func NewDescribeTransitGatewayAttachmentsPaginator(client DescribeTransitGatewayAttachmentsAPIClient, params *DescribeTransitGatewayAttachmentsInput, optFns ...func(*DescribeTransitGatewayAttachmentsPaginatorOptions)) *DescribeTransitGatewayAttachmentsPaginator { + options := DescribeTransitGatewayAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayAttachmentsInput{} + } + + return &DescribeTransitGatewayAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayAttachmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGatewayAttachments page. +func (p *DescribeTransitGatewayAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGatewayAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go b/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go index b8f85171366..b8427c13f2a 100644 --- a/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go +++ b/service/ec2/api_op_DescribeTransitGatewayMulticastDomains.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -129,6 +130,90 @@ func addOperationDescribeTransitGatewayMulticastDomainsMiddlewares(stack *middle return nil } +// DescribeTransitGatewayMulticastDomainsAPIClient is a client that implements the +// DescribeTransitGatewayMulticastDomains operation. +type DescribeTransitGatewayMulticastDomainsAPIClient interface { + DescribeTransitGatewayMulticastDomains(context.Context, *DescribeTransitGatewayMulticastDomainsInput, ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) +} + +var _ DescribeTransitGatewayMulticastDomainsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayMulticastDomainsPaginatorOptions is the paginator options +// for DescribeTransitGatewayMulticastDomains +type DescribeTransitGatewayMulticastDomainsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewayMulticastDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayMulticastDomains +type DescribeTransitGatewayMulticastDomainsPaginator struct { + options DescribeTransitGatewayMulticastDomainsPaginatorOptions + client DescribeTransitGatewayMulticastDomainsAPIClient + params *DescribeTransitGatewayMulticastDomainsInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewayMulticastDomainsPaginator returns a new +// DescribeTransitGatewayMulticastDomainsPaginator +func NewDescribeTransitGatewayMulticastDomainsPaginator(client DescribeTransitGatewayMulticastDomainsAPIClient, params *DescribeTransitGatewayMulticastDomainsInput, optFns ...func(*DescribeTransitGatewayMulticastDomainsPaginatorOptions)) *DescribeTransitGatewayMulticastDomainsPaginator { + options := DescribeTransitGatewayMulticastDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayMulticastDomainsInput{} + } + + return &DescribeTransitGatewayMulticastDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayMulticastDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGatewayMulticastDomains page. +func (p *DescribeTransitGatewayMulticastDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayMulticastDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGatewayMulticastDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayMulticastDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go b/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go index cf4cdee42f0..562cffb7ff9 100644 --- a/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayPeeringAttachments.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -135,6 +136,90 @@ func addOperationDescribeTransitGatewayPeeringAttachmentsMiddlewares(stack *midd return nil } +// DescribeTransitGatewayPeeringAttachmentsAPIClient is a client that implements +// the DescribeTransitGatewayPeeringAttachments operation. +type DescribeTransitGatewayPeeringAttachmentsAPIClient interface { + DescribeTransitGatewayPeeringAttachments(context.Context, *DescribeTransitGatewayPeeringAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayPeeringAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayPeeringAttachmentsPaginatorOptions is the paginator +// options for DescribeTransitGatewayPeeringAttachments +type DescribeTransitGatewayPeeringAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewayPeeringAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayPeeringAttachments +type DescribeTransitGatewayPeeringAttachmentsPaginator struct { + options DescribeTransitGatewayPeeringAttachmentsPaginatorOptions + client DescribeTransitGatewayPeeringAttachmentsAPIClient + params *DescribeTransitGatewayPeeringAttachmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewayPeeringAttachmentsPaginator returns a new +// DescribeTransitGatewayPeeringAttachmentsPaginator +func NewDescribeTransitGatewayPeeringAttachmentsPaginator(client DescribeTransitGatewayPeeringAttachmentsAPIClient, params *DescribeTransitGatewayPeeringAttachmentsInput, optFns ...func(*DescribeTransitGatewayPeeringAttachmentsPaginatorOptions)) *DescribeTransitGatewayPeeringAttachmentsPaginator { + options := DescribeTransitGatewayPeeringAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayPeeringAttachmentsInput{} + } + + return &DescribeTransitGatewayPeeringAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGatewayPeeringAttachments page. +func (p *DescribeTransitGatewayPeeringAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGatewayPeeringAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayPeeringAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayRouteTables.go b/service/ec2/api_op_DescribeTransitGatewayRouteTables.go index 3be1abce6dd..146b946298b 100644 --- a/service/ec2/api_op_DescribeTransitGatewayRouteTables.go +++ b/service/ec2/api_op_DescribeTransitGatewayRouteTables.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -136,6 +137,90 @@ func addOperationDescribeTransitGatewayRouteTablesMiddlewares(stack *middleware. return nil } +// DescribeTransitGatewayRouteTablesAPIClient is a client that implements the +// DescribeTransitGatewayRouteTables operation. +type DescribeTransitGatewayRouteTablesAPIClient interface { + DescribeTransitGatewayRouteTables(context.Context, *DescribeTransitGatewayRouteTablesInput, ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) +} + +var _ DescribeTransitGatewayRouteTablesAPIClient = (*Client)(nil) + +// DescribeTransitGatewayRouteTablesPaginatorOptions is the paginator options for +// DescribeTransitGatewayRouteTables +type DescribeTransitGatewayRouteTablesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewayRouteTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayRouteTables +type DescribeTransitGatewayRouteTablesPaginator struct { + options DescribeTransitGatewayRouteTablesPaginatorOptions + client DescribeTransitGatewayRouteTablesAPIClient + params *DescribeTransitGatewayRouteTablesInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewayRouteTablesPaginator returns a new +// DescribeTransitGatewayRouteTablesPaginator +func NewDescribeTransitGatewayRouteTablesPaginator(client DescribeTransitGatewayRouteTablesAPIClient, params *DescribeTransitGatewayRouteTablesInput, optFns ...func(*DescribeTransitGatewayRouteTablesPaginatorOptions)) *DescribeTransitGatewayRouteTablesPaginator { + options := DescribeTransitGatewayRouteTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayRouteTablesInput{} + } + + return &DescribeTransitGatewayRouteTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayRouteTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGatewayRouteTables page. +func (p *DescribeTransitGatewayRouteTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayRouteTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGatewayRouteTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayRouteTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go b/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go index f8ec173a5fb..918579120ba 100644 --- a/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go +++ b/service/ec2/api_op_DescribeTransitGatewayVpcAttachments.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -133,6 +134,90 @@ func addOperationDescribeTransitGatewayVpcAttachmentsMiddlewares(stack *middlewa return nil } +// DescribeTransitGatewayVpcAttachmentsAPIClient is a client that implements the +// DescribeTransitGatewayVpcAttachments operation. +type DescribeTransitGatewayVpcAttachmentsAPIClient interface { + DescribeTransitGatewayVpcAttachments(context.Context, *DescribeTransitGatewayVpcAttachmentsInput, ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) +} + +var _ DescribeTransitGatewayVpcAttachmentsAPIClient = (*Client)(nil) + +// DescribeTransitGatewayVpcAttachmentsPaginatorOptions is the paginator options +// for DescribeTransitGatewayVpcAttachments +type DescribeTransitGatewayVpcAttachmentsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewayVpcAttachmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGatewayVpcAttachments +type DescribeTransitGatewayVpcAttachmentsPaginator struct { + options DescribeTransitGatewayVpcAttachmentsPaginatorOptions + client DescribeTransitGatewayVpcAttachmentsAPIClient + params *DescribeTransitGatewayVpcAttachmentsInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewayVpcAttachmentsPaginator returns a new +// DescribeTransitGatewayVpcAttachmentsPaginator +func NewDescribeTransitGatewayVpcAttachmentsPaginator(client DescribeTransitGatewayVpcAttachmentsAPIClient, params *DescribeTransitGatewayVpcAttachmentsInput, optFns ...func(*DescribeTransitGatewayVpcAttachmentsPaginatorOptions)) *DescribeTransitGatewayVpcAttachmentsPaginator { + options := DescribeTransitGatewayVpcAttachmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewayVpcAttachmentsInput{} + } + + return &DescribeTransitGatewayVpcAttachmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewayVpcAttachmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGatewayVpcAttachments page. +func (p *DescribeTransitGatewayVpcAttachmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGatewayVpcAttachments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGatewayVpcAttachments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeTransitGateways.go b/service/ec2/api_op_DescribeTransitGateways.go index 4fdfaf564e6..a82fe291d4c 100644 --- a/service/ec2/api_op_DescribeTransitGateways.go +++ b/service/ec2/api_op_DescribeTransitGateways.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -158,6 +159,90 @@ func addOperationDescribeTransitGatewaysMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeTransitGatewaysAPIClient is a client that implements the +// DescribeTransitGateways operation. +type DescribeTransitGatewaysAPIClient interface { + DescribeTransitGateways(context.Context, *DescribeTransitGatewaysInput, ...func(*Options)) (*DescribeTransitGatewaysOutput, error) +} + +var _ DescribeTransitGatewaysAPIClient = (*Client)(nil) + +// DescribeTransitGatewaysPaginatorOptions is the paginator options for +// DescribeTransitGateways +type DescribeTransitGatewaysPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeTransitGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeTransitGateways +type DescribeTransitGatewaysPaginator struct { + options DescribeTransitGatewaysPaginatorOptions + client DescribeTransitGatewaysAPIClient + params *DescribeTransitGatewaysInput + nextToken *string + firstPage bool +} + +// NewDescribeTransitGatewaysPaginator returns a new +// DescribeTransitGatewaysPaginator +func NewDescribeTransitGatewaysPaginator(client DescribeTransitGatewaysAPIClient, params *DescribeTransitGatewaysInput, optFns ...func(*DescribeTransitGatewaysPaginatorOptions)) *DescribeTransitGatewaysPaginator { + options := DescribeTransitGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTransitGatewaysInput{} + } + + return &DescribeTransitGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTransitGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTransitGateways page. +func (p *DescribeTransitGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTransitGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTransitGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTransitGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumeStatus.go b/service/ec2/api_op_DescribeVolumeStatus.go index 61f1817413e..935f47512ce 100644 --- a/service/ec2/api_op_DescribeVolumeStatus.go +++ b/service/ec2/api_op_DescribeVolumeStatus.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -193,6 +194,95 @@ func addOperationDescribeVolumeStatusMiddlewares(stack *middleware.Stack, option return nil } +// DescribeVolumeStatusAPIClient is a client that implements the +// DescribeVolumeStatus operation. +type DescribeVolumeStatusAPIClient interface { + DescribeVolumeStatus(context.Context, *DescribeVolumeStatusInput, ...func(*Options)) (*DescribeVolumeStatusOutput, error) +} + +var _ DescribeVolumeStatusAPIClient = (*Client)(nil) + +// DescribeVolumeStatusPaginatorOptions is the paginator options for +// DescribeVolumeStatus +type DescribeVolumeStatusPaginatorOptions struct { + // The maximum number of volume results returned by DescribeVolumeStatus in + // paginated output. When this parameter is used, the request only returns + // MaxResults results in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1000; if + // MaxResults is given a value larger than 1000, only 1000 results are returned. If + // this parameter is not used, then DescribeVolumeStatus returns all results. You + // cannot specify this parameter and the volume IDs parameter in the same request. + 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 +} + +// DescribeVolumeStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumeStatus +type DescribeVolumeStatusPaginator struct { + options DescribeVolumeStatusPaginatorOptions + client DescribeVolumeStatusAPIClient + params *DescribeVolumeStatusInput + nextToken *string + firstPage bool +} + +// NewDescribeVolumeStatusPaginator returns a new DescribeVolumeStatusPaginator +func NewDescribeVolumeStatusPaginator(client DescribeVolumeStatusAPIClient, params *DescribeVolumeStatusInput, optFns ...func(*DescribeVolumeStatusPaginatorOptions)) *DescribeVolumeStatusPaginator { + options := DescribeVolumeStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumeStatusInput{} + } + + return &DescribeVolumeStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumeStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVolumeStatus page. +func (p *DescribeVolumeStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumeStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVolumeStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumeStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumes.go b/service/ec2/api_op_DescribeVolumes.go index bc3aa5f2b2c..ad5ed0df548 100644 --- a/service/ec2/api_op_DescribeVolumes.go +++ b/service/ec2/api_op_DescribeVolumes.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -194,6 +195,94 @@ func addOperationDescribeVolumesMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeVolumesAPIClient is a client that implements the DescribeVolumes +// operation. +type DescribeVolumesAPIClient interface { + DescribeVolumes(context.Context, *DescribeVolumesInput, ...func(*Options)) (*DescribeVolumesOutput, error) +} + +var _ DescribeVolumesAPIClient = (*Client)(nil) + +// DescribeVolumesPaginatorOptions is the paginator options for DescribeVolumes +type DescribeVolumesPaginatorOptions struct { + // The maximum number of volume results returned by DescribeVolumes in paginated + // output. When this parameter is used, DescribeVolumes only returns MaxResults + // results in a single page along with a NextToken response element. The remaining + // results of the initial request can be seen by sending another DescribeVolumes + // request with the returned NextToken value. This value can be between 5 and 500; + // if MaxResults is given a value larger than 500, only 500 results are returned. + // If this parameter is not used, then DescribeVolumes returns all results. You + // cannot specify this parameter and the volume IDs parameter in the same request. + 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 +} + +// DescribeVolumesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumes +type DescribeVolumesPaginator struct { + options DescribeVolumesPaginatorOptions + client DescribeVolumesAPIClient + params *DescribeVolumesInput + nextToken *string + firstPage bool +} + +// NewDescribeVolumesPaginator returns a new DescribeVolumesPaginator +func NewDescribeVolumesPaginator(client DescribeVolumesAPIClient, params *DescribeVolumesInput, optFns ...func(*DescribeVolumesPaginatorOptions)) *DescribeVolumesPaginator { + options := DescribeVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumesInput{} + } + + return &DescribeVolumesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVolumes page. +func (p *DescribeVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVolumes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVolumesModifications.go b/service/ec2/api_op_DescribeVolumesModifications.go index 611c1a61c6c..270c0123059 100644 --- a/service/ec2/api_op_DescribeVolumesModifications.go +++ b/service/ec2/api_op_DescribeVolumesModifications.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -159,6 +160,90 @@ func addOperationDescribeVolumesModificationsMiddlewares(stack *middleware.Stack return nil } +// DescribeVolumesModificationsAPIClient is a client that implements the +// DescribeVolumesModifications operation. +type DescribeVolumesModificationsAPIClient interface { + DescribeVolumesModifications(context.Context, *DescribeVolumesModificationsInput, ...func(*Options)) (*DescribeVolumesModificationsOutput, error) +} + +var _ DescribeVolumesModificationsAPIClient = (*Client)(nil) + +// DescribeVolumesModificationsPaginatorOptions is the paginator options for +// DescribeVolumesModifications +type DescribeVolumesModificationsPaginatorOptions struct { + // The maximum number of results (up to a limit of 500) to be returned in a + // paginated request. + 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 +} + +// DescribeVolumesModificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVolumesModifications +type DescribeVolumesModificationsPaginator struct { + options DescribeVolumesModificationsPaginatorOptions + client DescribeVolumesModificationsAPIClient + params *DescribeVolumesModificationsInput + nextToken *string + firstPage bool +} + +// NewDescribeVolumesModificationsPaginator returns a new +// DescribeVolumesModificationsPaginator +func NewDescribeVolumesModificationsPaginator(client DescribeVolumesModificationsAPIClient, params *DescribeVolumesModificationsInput, optFns ...func(*DescribeVolumesModificationsPaginatorOptions)) *DescribeVolumesModificationsPaginator { + options := DescribeVolumesModificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVolumesModificationsInput{} + } + + return &DescribeVolumesModificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVolumesModificationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVolumesModifications page. +func (p *DescribeVolumesModificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVolumesModificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVolumesModifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVolumesModifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go b/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go index e8657eefba3..8176010d43f 100644 --- a/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go +++ b/service/ec2/api_op_DescribeVpcClassicLinkDnsSupport.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -117,6 +118,90 @@ func addOperationDescribeVpcClassicLinkDnsSupportMiddlewares(stack *middleware.S return nil } +// DescribeVpcClassicLinkDnsSupportAPIClient is a client that implements the +// DescribeVpcClassicLinkDnsSupport operation. +type DescribeVpcClassicLinkDnsSupportAPIClient interface { + DescribeVpcClassicLinkDnsSupport(context.Context, *DescribeVpcClassicLinkDnsSupportInput, ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) +} + +var _ DescribeVpcClassicLinkDnsSupportAPIClient = (*Client)(nil) + +// DescribeVpcClassicLinkDnsSupportPaginatorOptions is the paginator options for +// DescribeVpcClassicLinkDnsSupport +type DescribeVpcClassicLinkDnsSupportPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeVpcClassicLinkDnsSupportPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcClassicLinkDnsSupport +type DescribeVpcClassicLinkDnsSupportPaginator struct { + options DescribeVpcClassicLinkDnsSupportPaginatorOptions + client DescribeVpcClassicLinkDnsSupportAPIClient + params *DescribeVpcClassicLinkDnsSupportInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcClassicLinkDnsSupportPaginator returns a new +// DescribeVpcClassicLinkDnsSupportPaginator +func NewDescribeVpcClassicLinkDnsSupportPaginator(client DescribeVpcClassicLinkDnsSupportAPIClient, params *DescribeVpcClassicLinkDnsSupportInput, optFns ...func(*DescribeVpcClassicLinkDnsSupportPaginatorOptions)) *DescribeVpcClassicLinkDnsSupportPaginator { + options := DescribeVpcClassicLinkDnsSupportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcClassicLinkDnsSupportInput{} + } + + return &DescribeVpcClassicLinkDnsSupportPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcClassicLinkDnsSupportPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcClassicLinkDnsSupport page. +func (p *DescribeVpcClassicLinkDnsSupportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcClassicLinkDnsSupportOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcClassicLinkDnsSupport(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcClassicLinkDnsSupport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go b/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go index ceeb41aebe8..395d7715585 100644 --- a/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go +++ b/service/ec2/api_op_DescribeVpcEndpointConnectionNotifications.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -137,6 +138,90 @@ func addOperationDescribeVpcEndpointConnectionNotificationsMiddlewares(stack *mi return nil } +// DescribeVpcEndpointConnectionNotificationsAPIClient is a client that implements +// the DescribeVpcEndpointConnectionNotifications operation. +type DescribeVpcEndpointConnectionNotificationsAPIClient interface { + DescribeVpcEndpointConnectionNotifications(context.Context, *DescribeVpcEndpointConnectionNotificationsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) +} + +var _ DescribeVpcEndpointConnectionNotificationsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointConnectionNotificationsPaginatorOptions is the paginator +// options for DescribeVpcEndpointConnectionNotifications +type DescribeVpcEndpointConnectionNotificationsPaginatorOptions struct { + // The maximum number of results to return in a single call. To retrieve the + // remaining results, make another request with the returned NextToken value. + 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 +} + +// DescribeVpcEndpointConnectionNotificationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointConnectionNotifications +type DescribeVpcEndpointConnectionNotificationsPaginator struct { + options DescribeVpcEndpointConnectionNotificationsPaginatorOptions + client DescribeVpcEndpointConnectionNotificationsAPIClient + params *DescribeVpcEndpointConnectionNotificationsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcEndpointConnectionNotificationsPaginator returns a new +// DescribeVpcEndpointConnectionNotificationsPaginator +func NewDescribeVpcEndpointConnectionNotificationsPaginator(client DescribeVpcEndpointConnectionNotificationsAPIClient, params *DescribeVpcEndpointConnectionNotificationsInput, optFns ...func(*DescribeVpcEndpointConnectionNotificationsPaginatorOptions)) *DescribeVpcEndpointConnectionNotificationsPaginator { + options := DescribeVpcEndpointConnectionNotificationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointConnectionNotificationsInput{} + } + + return &DescribeVpcEndpointConnectionNotificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointConnectionNotificationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcEndpointConnectionNotifications page. +func (p *DescribeVpcEndpointConnectionNotificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcEndpointConnectionNotifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointConnectionNotifications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointConnections.go b/service/ec2/api_op_DescribeVpcEndpointConnections.go index 5c053635d9b..af8a3394eab 100644 --- a/service/ec2/api_op_DescribeVpcEndpointConnections.go +++ b/service/ec2/api_op_DescribeVpcEndpointConnections.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -131,6 +132,92 @@ func addOperationDescribeVpcEndpointConnectionsMiddlewares(stack *middleware.Sta return nil } +// DescribeVpcEndpointConnectionsAPIClient is a client that implements the +// DescribeVpcEndpointConnections operation. +type DescribeVpcEndpointConnectionsAPIClient interface { + DescribeVpcEndpointConnections(context.Context, *DescribeVpcEndpointConnectionsInput, ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) +} + +var _ DescribeVpcEndpointConnectionsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointConnectionsPaginatorOptions is the paginator options for +// DescribeVpcEndpointConnections +type DescribeVpcEndpointConnectionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + 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 +} + +// DescribeVpcEndpointConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointConnections +type DescribeVpcEndpointConnectionsPaginator struct { + options DescribeVpcEndpointConnectionsPaginatorOptions + client DescribeVpcEndpointConnectionsAPIClient + params *DescribeVpcEndpointConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcEndpointConnectionsPaginator returns a new +// DescribeVpcEndpointConnectionsPaginator +func NewDescribeVpcEndpointConnectionsPaginator(client DescribeVpcEndpointConnectionsAPIClient, params *DescribeVpcEndpointConnectionsInput, optFns ...func(*DescribeVpcEndpointConnectionsPaginatorOptions)) *DescribeVpcEndpointConnectionsPaginator { + options := DescribeVpcEndpointConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointConnectionsInput{} + } + + return &DescribeVpcEndpointConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcEndpointConnections page. +func (p *DescribeVpcEndpointConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcEndpointConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go b/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go index 372cad26581..40226498afe 100644 --- a/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go +++ b/service/ec2/api_op_DescribeVpcEndpointServiceConfigurations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -140,6 +141,92 @@ func addOperationDescribeVpcEndpointServiceConfigurationsMiddlewares(stack *midd return nil } +// DescribeVpcEndpointServiceConfigurationsAPIClient is a client that implements +// the DescribeVpcEndpointServiceConfigurations operation. +type DescribeVpcEndpointServiceConfigurationsAPIClient interface { + DescribeVpcEndpointServiceConfigurations(context.Context, *DescribeVpcEndpointServiceConfigurationsInput, ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) +} + +var _ DescribeVpcEndpointServiceConfigurationsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointServiceConfigurationsPaginatorOptions is the paginator +// options for DescribeVpcEndpointServiceConfigurations +type DescribeVpcEndpointServiceConfigurationsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + 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 +} + +// DescribeVpcEndpointServiceConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointServiceConfigurations +type DescribeVpcEndpointServiceConfigurationsPaginator struct { + options DescribeVpcEndpointServiceConfigurationsPaginatorOptions + client DescribeVpcEndpointServiceConfigurationsAPIClient + params *DescribeVpcEndpointServiceConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcEndpointServiceConfigurationsPaginator returns a new +// DescribeVpcEndpointServiceConfigurationsPaginator +func NewDescribeVpcEndpointServiceConfigurationsPaginator(client DescribeVpcEndpointServiceConfigurationsAPIClient, params *DescribeVpcEndpointServiceConfigurationsInput, optFns ...func(*DescribeVpcEndpointServiceConfigurationsPaginatorOptions)) *DescribeVpcEndpointServiceConfigurationsPaginator { + options := DescribeVpcEndpointServiceConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointServiceConfigurationsInput{} + } + + return &DescribeVpcEndpointServiceConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointServiceConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcEndpointServiceConfigurations page. +func (p *DescribeVpcEndpointServiceConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcEndpointServiceConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointServiceConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go b/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go index 5ac140b40f8..3ef4e340d10 100644 --- a/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go +++ b/service/ec2/api_op_DescribeVpcEndpointServicePermissions.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -132,6 +133,92 @@ func addOperationDescribeVpcEndpointServicePermissionsMiddlewares(stack *middlew return nil } +// DescribeVpcEndpointServicePermissionsAPIClient is a client that implements the +// DescribeVpcEndpointServicePermissions operation. +type DescribeVpcEndpointServicePermissionsAPIClient interface { + DescribeVpcEndpointServicePermissions(context.Context, *DescribeVpcEndpointServicePermissionsInput, ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) +} + +var _ DescribeVpcEndpointServicePermissionsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointServicePermissionsPaginatorOptions is the paginator options +// for DescribeVpcEndpointServicePermissions +type DescribeVpcEndpointServicePermissionsPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results of the initial request can be seen by sending another request + // with the returned NextToken value. This value can be between 5 and 1,000; if + // MaxResults is given a value larger than 1,000, only 1,000 results are returned. + 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 +} + +// DescribeVpcEndpointServicePermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpointServicePermissions +type DescribeVpcEndpointServicePermissionsPaginator struct { + options DescribeVpcEndpointServicePermissionsPaginatorOptions + client DescribeVpcEndpointServicePermissionsAPIClient + params *DescribeVpcEndpointServicePermissionsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcEndpointServicePermissionsPaginator returns a new +// DescribeVpcEndpointServicePermissionsPaginator +func NewDescribeVpcEndpointServicePermissionsPaginator(client DescribeVpcEndpointServicePermissionsAPIClient, params *DescribeVpcEndpointServicePermissionsInput, optFns ...func(*DescribeVpcEndpointServicePermissionsPaginatorOptions)) *DescribeVpcEndpointServicePermissionsPaginator { + options := DescribeVpcEndpointServicePermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointServicePermissionsInput{} + } + + return &DescribeVpcEndpointServicePermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointServicePermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcEndpointServicePermissions page. +func (p *DescribeVpcEndpointServicePermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointServicePermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcEndpointServicePermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpointServicePermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcEndpoints.go b/service/ec2/api_op_DescribeVpcEndpoints.go index e2748646e28..25ebd8e5416 100644 --- a/service/ec2/api_op_DescribeVpcEndpoints.go +++ b/service/ec2/api_op_DescribeVpcEndpoints.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -144,6 +145,90 @@ func addOperationDescribeVpcEndpointsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeVpcEndpointsAPIClient is a client that implements the +// DescribeVpcEndpoints operation. +type DescribeVpcEndpointsAPIClient interface { + DescribeVpcEndpoints(context.Context, *DescribeVpcEndpointsInput, ...func(*Options)) (*DescribeVpcEndpointsOutput, error) +} + +var _ DescribeVpcEndpointsAPIClient = (*Client)(nil) + +// DescribeVpcEndpointsPaginatorOptions is the paginator options for +// DescribeVpcEndpoints +type DescribeVpcEndpointsPaginatorOptions struct { + // The maximum number of items to return for this request. The request returns a + // token that you can specify in a subsequent call to get the next set of results. + // Constraint: If the value is greater than 1,000, we return only 1,000 items. + 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 +} + +// DescribeVpcEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcEndpoints +type DescribeVpcEndpointsPaginator struct { + options DescribeVpcEndpointsPaginatorOptions + client DescribeVpcEndpointsAPIClient + params *DescribeVpcEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcEndpointsPaginator returns a new DescribeVpcEndpointsPaginator +func NewDescribeVpcEndpointsPaginator(client DescribeVpcEndpointsAPIClient, params *DescribeVpcEndpointsInput, optFns ...func(*DescribeVpcEndpointsPaginatorOptions)) *DescribeVpcEndpointsPaginator { + options := DescribeVpcEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcEndpointsInput{} + } + + return &DescribeVpcEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcEndpoints page. +func (p *DescribeVpcEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcPeeringConnections.go b/service/ec2/api_op_DescribeVpcPeeringConnections.go index 329813e56b8..04dc61c6d6b 100644 --- a/service/ec2/api_op_DescribeVpcPeeringConnections.go +++ b/service/ec2/api_op_DescribeVpcPeeringConnections.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -161,6 +162,90 @@ func addOperationDescribeVpcPeeringConnectionsMiddlewares(stack *middleware.Stac return nil } +// DescribeVpcPeeringConnectionsAPIClient is a client that implements the +// DescribeVpcPeeringConnections operation. +type DescribeVpcPeeringConnectionsAPIClient interface { + DescribeVpcPeeringConnections(context.Context, *DescribeVpcPeeringConnectionsInput, ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) +} + +var _ DescribeVpcPeeringConnectionsAPIClient = (*Client)(nil) + +// DescribeVpcPeeringConnectionsPaginatorOptions is the paginator options for +// DescribeVpcPeeringConnections +type DescribeVpcPeeringConnectionsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeVpcPeeringConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcPeeringConnections +type DescribeVpcPeeringConnectionsPaginator struct { + options DescribeVpcPeeringConnectionsPaginatorOptions + client DescribeVpcPeeringConnectionsAPIClient + params *DescribeVpcPeeringConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcPeeringConnectionsPaginator returns a new +// DescribeVpcPeeringConnectionsPaginator +func NewDescribeVpcPeeringConnectionsPaginator(client DescribeVpcPeeringConnectionsAPIClient, params *DescribeVpcPeeringConnectionsInput, optFns ...func(*DescribeVpcPeeringConnectionsPaginatorOptions)) *DescribeVpcPeeringConnectionsPaginator { + options := DescribeVpcPeeringConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcPeeringConnectionsInput{} + } + + return &DescribeVpcPeeringConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcPeeringConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcPeeringConnections page. +func (p *DescribeVpcPeeringConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcPeeringConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcPeeringConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcPeeringConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_DescribeVpcs.go b/service/ec2/api_op_DescribeVpcs.go index b63e980cb6e..62cc823c4ba 100644 --- a/service/ec2/api_op_DescribeVpcs.go +++ b/service/ec2/api_op_DescribeVpcs.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -171,6 +172,87 @@ func addOperationDescribeVpcsMiddlewares(stack *middleware.Stack, options Option return nil } +// DescribeVpcsAPIClient is a client that implements the DescribeVpcs operation. +type DescribeVpcsAPIClient interface { + DescribeVpcs(context.Context, *DescribeVpcsInput, ...func(*Options)) (*DescribeVpcsOutput, error) +} + +var _ DescribeVpcsAPIClient = (*Client)(nil) + +// DescribeVpcsPaginatorOptions is the paginator options for DescribeVpcs +type DescribeVpcsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// DescribeVpcsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.DescribeVpcs +type DescribeVpcsPaginator struct { + options DescribeVpcsPaginatorOptions + client DescribeVpcsAPIClient + params *DescribeVpcsInput + nextToken *string + firstPage bool +} + +// NewDescribeVpcsPaginator returns a new DescribeVpcsPaginator +func NewDescribeVpcsPaginator(client DescribeVpcsAPIClient, params *DescribeVpcsInput, optFns ...func(*DescribeVpcsPaginatorOptions)) *DescribeVpcsPaginator { + options := DescribeVpcsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVpcsInput{} + } + + return &DescribeVpcsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVpcsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVpcs page. +func (p *DescribeVpcsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVpcsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeVpcs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVpcs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go b/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go index 97a1a300e62..62abfffd8ea 100644 --- a/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go +++ b/service/ec2/api_op_GetAssociatedIpv6PoolCidrs.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -122,6 +123,90 @@ func addOperationGetAssociatedIpv6PoolCidrsMiddlewares(stack *middleware.Stack, return nil } +// GetAssociatedIpv6PoolCidrsAPIClient is a client that implements the +// GetAssociatedIpv6PoolCidrs operation. +type GetAssociatedIpv6PoolCidrsAPIClient interface { + GetAssociatedIpv6PoolCidrs(context.Context, *GetAssociatedIpv6PoolCidrsInput, ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) +} + +var _ GetAssociatedIpv6PoolCidrsAPIClient = (*Client)(nil) + +// GetAssociatedIpv6PoolCidrsPaginatorOptions is the paginator options for +// GetAssociatedIpv6PoolCidrs +type GetAssociatedIpv6PoolCidrsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetAssociatedIpv6PoolCidrsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetAssociatedIpv6PoolCidrs +type GetAssociatedIpv6PoolCidrsPaginator struct { + options GetAssociatedIpv6PoolCidrsPaginatorOptions + client GetAssociatedIpv6PoolCidrsAPIClient + params *GetAssociatedIpv6PoolCidrsInput + nextToken *string + firstPage bool +} + +// NewGetAssociatedIpv6PoolCidrsPaginator returns a new +// GetAssociatedIpv6PoolCidrsPaginator +func NewGetAssociatedIpv6PoolCidrsPaginator(client GetAssociatedIpv6PoolCidrsAPIClient, params *GetAssociatedIpv6PoolCidrsInput, optFns ...func(*GetAssociatedIpv6PoolCidrsPaginatorOptions)) *GetAssociatedIpv6PoolCidrsPaginator { + options := GetAssociatedIpv6PoolCidrsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssociatedIpv6PoolCidrsInput{} + } + + return &GetAssociatedIpv6PoolCidrsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssociatedIpv6PoolCidrsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetAssociatedIpv6PoolCidrs page. +func (p *GetAssociatedIpv6PoolCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssociatedIpv6PoolCidrsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetAssociatedIpv6PoolCidrs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAssociatedIpv6PoolCidrs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetGroupsForCapacityReservation.go b/service/ec2/api_op_GetGroupsForCapacityReservation.go index 360706f6b48..c7134a9a2f6 100644 --- a/service/ec2/api_op_GetGroupsForCapacityReservation.go +++ b/service/ec2/api_op_GetGroupsForCapacityReservation.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -124,6 +125,92 @@ func addOperationGetGroupsForCapacityReservationMiddlewares(stack *middleware.St return nil } +// GetGroupsForCapacityReservationAPIClient is a client that implements the +// GetGroupsForCapacityReservation operation. +type GetGroupsForCapacityReservationAPIClient interface { + GetGroupsForCapacityReservation(context.Context, *GetGroupsForCapacityReservationInput, ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) +} + +var _ GetGroupsForCapacityReservationAPIClient = (*Client)(nil) + +// GetGroupsForCapacityReservationPaginatorOptions is the paginator options for +// GetGroupsForCapacityReservation +type GetGroupsForCapacityReservationPaginatorOptions struct { + // The maximum number of results to return for the request in a single page. The + // remaining results can be seen by sending another request with the returned + // nextToken value. This value can be between 5 and 500. If maxResults is given a + // larger value than 500, you receive an error. + 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 +} + +// GetGroupsForCapacityReservationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetGroupsForCapacityReservation +type GetGroupsForCapacityReservationPaginator struct { + options GetGroupsForCapacityReservationPaginatorOptions + client GetGroupsForCapacityReservationAPIClient + params *GetGroupsForCapacityReservationInput + nextToken *string + firstPage bool +} + +// NewGetGroupsForCapacityReservationPaginator returns a new +// GetGroupsForCapacityReservationPaginator +func NewGetGroupsForCapacityReservationPaginator(client GetGroupsForCapacityReservationAPIClient, params *GetGroupsForCapacityReservationInput, optFns ...func(*GetGroupsForCapacityReservationPaginatorOptions)) *GetGroupsForCapacityReservationPaginator { + options := GetGroupsForCapacityReservationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupsForCapacityReservationInput{} + } + + return &GetGroupsForCapacityReservationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupsForCapacityReservationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetGroupsForCapacityReservation page. +func (p *GetGroupsForCapacityReservationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupsForCapacityReservationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetGroupsForCapacityReservation(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroupsForCapacityReservation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetManagedPrefixListAssociations.go b/service/ec2/api_op_GetManagedPrefixListAssociations.go index 8b136e23daa..9425101baa5 100644 --- a/service/ec2/api_op_GetManagedPrefixListAssociations.go +++ b/service/ec2/api_op_GetManagedPrefixListAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -122,6 +123,90 @@ func addOperationGetManagedPrefixListAssociationsMiddlewares(stack *middleware.S return nil } +// GetManagedPrefixListAssociationsAPIClient is a client that implements the +// GetManagedPrefixListAssociations operation. +type GetManagedPrefixListAssociationsAPIClient interface { + GetManagedPrefixListAssociations(context.Context, *GetManagedPrefixListAssociationsInput, ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) +} + +var _ GetManagedPrefixListAssociationsAPIClient = (*Client)(nil) + +// GetManagedPrefixListAssociationsPaginatorOptions is the paginator options for +// GetManagedPrefixListAssociations +type GetManagedPrefixListAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetManagedPrefixListAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetManagedPrefixListAssociations +type GetManagedPrefixListAssociationsPaginator struct { + options GetManagedPrefixListAssociationsPaginatorOptions + client GetManagedPrefixListAssociationsAPIClient + params *GetManagedPrefixListAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetManagedPrefixListAssociationsPaginator returns a new +// GetManagedPrefixListAssociationsPaginator +func NewGetManagedPrefixListAssociationsPaginator(client GetManagedPrefixListAssociationsAPIClient, params *GetManagedPrefixListAssociationsInput, optFns ...func(*GetManagedPrefixListAssociationsPaginatorOptions)) *GetManagedPrefixListAssociationsPaginator { + options := GetManagedPrefixListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetManagedPrefixListAssociationsInput{} + } + + return &GetManagedPrefixListAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetManagedPrefixListAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetManagedPrefixListAssociations page. +func (p *GetManagedPrefixListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetManagedPrefixListAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetManagedPrefixListAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetManagedPrefixListEntries.go b/service/ec2/api_op_GetManagedPrefixListEntries.go index 6a0d2f76ff6..5e0a70701d8 100644 --- a/service/ec2/api_op_GetManagedPrefixListEntries.go +++ b/service/ec2/api_op_GetManagedPrefixListEntries.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -125,6 +126,90 @@ func addOperationGetManagedPrefixListEntriesMiddlewares(stack *middleware.Stack, return nil } +// GetManagedPrefixListEntriesAPIClient is a client that implements the +// GetManagedPrefixListEntries operation. +type GetManagedPrefixListEntriesAPIClient interface { + GetManagedPrefixListEntries(context.Context, *GetManagedPrefixListEntriesInput, ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) +} + +var _ GetManagedPrefixListEntriesAPIClient = (*Client)(nil) + +// GetManagedPrefixListEntriesPaginatorOptions is the paginator options for +// GetManagedPrefixListEntries +type GetManagedPrefixListEntriesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetManagedPrefixListEntriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetManagedPrefixListEntries +type GetManagedPrefixListEntriesPaginator struct { + options GetManagedPrefixListEntriesPaginatorOptions + client GetManagedPrefixListEntriesAPIClient + params *GetManagedPrefixListEntriesInput + nextToken *string + firstPage bool +} + +// NewGetManagedPrefixListEntriesPaginator returns a new +// GetManagedPrefixListEntriesPaginator +func NewGetManagedPrefixListEntriesPaginator(client GetManagedPrefixListEntriesAPIClient, params *GetManagedPrefixListEntriesInput, optFns ...func(*GetManagedPrefixListEntriesPaginatorOptions)) *GetManagedPrefixListEntriesPaginator { + options := GetManagedPrefixListEntriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetManagedPrefixListEntriesInput{} + } + + return &GetManagedPrefixListEntriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetManagedPrefixListEntriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetManagedPrefixListEntries page. +func (p *GetManagedPrefixListEntriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetManagedPrefixListEntriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetManagedPrefixListEntries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetManagedPrefixListEntries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go b/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go index b5f3d8b54e0..6b48db7b6dc 100644 --- a/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go +++ b/service/ec2/api_op_GetTransitGatewayAttachmentPropagations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -128,6 +129,90 @@ func addOperationGetTransitGatewayAttachmentPropagationsMiddlewares(stack *middl return nil } +// GetTransitGatewayAttachmentPropagationsAPIClient is a client that implements the +// GetTransitGatewayAttachmentPropagations operation. +type GetTransitGatewayAttachmentPropagationsAPIClient interface { + GetTransitGatewayAttachmentPropagations(context.Context, *GetTransitGatewayAttachmentPropagationsInput, ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) +} + +var _ GetTransitGatewayAttachmentPropagationsAPIClient = (*Client)(nil) + +// GetTransitGatewayAttachmentPropagationsPaginatorOptions is the paginator options +// for GetTransitGatewayAttachmentPropagations +type GetTransitGatewayAttachmentPropagationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetTransitGatewayAttachmentPropagationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayAttachmentPropagations +type GetTransitGatewayAttachmentPropagationsPaginator struct { + options GetTransitGatewayAttachmentPropagationsPaginatorOptions + client GetTransitGatewayAttachmentPropagationsAPIClient + params *GetTransitGatewayAttachmentPropagationsInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayAttachmentPropagationsPaginator returns a new +// GetTransitGatewayAttachmentPropagationsPaginator +func NewGetTransitGatewayAttachmentPropagationsPaginator(client GetTransitGatewayAttachmentPropagationsAPIClient, params *GetTransitGatewayAttachmentPropagationsInput, optFns ...func(*GetTransitGatewayAttachmentPropagationsPaginatorOptions)) *GetTransitGatewayAttachmentPropagationsPaginator { + options := GetTransitGatewayAttachmentPropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayAttachmentPropagationsInput{} + } + + return &GetTransitGatewayAttachmentPropagationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayAttachmentPropagationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayAttachmentPropagations page. +func (p *GetTransitGatewayAttachmentPropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayAttachmentPropagationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTransitGatewayAttachmentPropagations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayAttachmentPropagations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go b/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go index d98dd8f9d8b..71961606b75 100644 --- a/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go +++ b/service/ec2/api_op_GetTransitGatewayMulticastDomainAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -135,6 +136,90 @@ func addOperationGetTransitGatewayMulticastDomainAssociationsMiddlewares(stack * return nil } +// GetTransitGatewayMulticastDomainAssociationsAPIClient is a client that +// implements the GetTransitGatewayMulticastDomainAssociations operation. +type GetTransitGatewayMulticastDomainAssociationsAPIClient interface { + GetTransitGatewayMulticastDomainAssociations(context.Context, *GetTransitGatewayMulticastDomainAssociationsInput, ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) +} + +var _ GetTransitGatewayMulticastDomainAssociationsAPIClient = (*Client)(nil) + +// GetTransitGatewayMulticastDomainAssociationsPaginatorOptions is the paginator +// options for GetTransitGatewayMulticastDomainAssociations +type GetTransitGatewayMulticastDomainAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetTransitGatewayMulticastDomainAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayMulticastDomainAssociations +type GetTransitGatewayMulticastDomainAssociationsPaginator struct { + options GetTransitGatewayMulticastDomainAssociationsPaginatorOptions + client GetTransitGatewayMulticastDomainAssociationsAPIClient + params *GetTransitGatewayMulticastDomainAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayMulticastDomainAssociationsPaginator returns a new +// GetTransitGatewayMulticastDomainAssociationsPaginator +func NewGetTransitGatewayMulticastDomainAssociationsPaginator(client GetTransitGatewayMulticastDomainAssociationsAPIClient, params *GetTransitGatewayMulticastDomainAssociationsInput, optFns ...func(*GetTransitGatewayMulticastDomainAssociationsPaginatorOptions)) *GetTransitGatewayMulticastDomainAssociationsPaginator { + options := GetTransitGatewayMulticastDomainAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayMulticastDomainAssociationsInput{} + } + + return &GetTransitGatewayMulticastDomainAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayMulticastDomainAssociations page. +func (p *GetTransitGatewayMulticastDomainAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTransitGatewayMulticastDomainAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayMulticastDomainAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go b/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go index bcd84821ab0..668165ea522 100644 --- a/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go +++ b/service/ec2/api_op_GetTransitGatewayPrefixListReferences.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -146,6 +147,90 @@ func addOperationGetTransitGatewayPrefixListReferencesMiddlewares(stack *middlew return nil } +// GetTransitGatewayPrefixListReferencesAPIClient is a client that implements the +// GetTransitGatewayPrefixListReferences operation. +type GetTransitGatewayPrefixListReferencesAPIClient interface { + GetTransitGatewayPrefixListReferences(context.Context, *GetTransitGatewayPrefixListReferencesInput, ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) +} + +var _ GetTransitGatewayPrefixListReferencesAPIClient = (*Client)(nil) + +// GetTransitGatewayPrefixListReferencesPaginatorOptions is the paginator options +// for GetTransitGatewayPrefixListReferences +type GetTransitGatewayPrefixListReferencesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetTransitGatewayPrefixListReferencesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayPrefixListReferences +type GetTransitGatewayPrefixListReferencesPaginator struct { + options GetTransitGatewayPrefixListReferencesPaginatorOptions + client GetTransitGatewayPrefixListReferencesAPIClient + params *GetTransitGatewayPrefixListReferencesInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayPrefixListReferencesPaginator returns a new +// GetTransitGatewayPrefixListReferencesPaginator +func NewGetTransitGatewayPrefixListReferencesPaginator(client GetTransitGatewayPrefixListReferencesAPIClient, params *GetTransitGatewayPrefixListReferencesInput, optFns ...func(*GetTransitGatewayPrefixListReferencesPaginatorOptions)) *GetTransitGatewayPrefixListReferencesPaginator { + options := GetTransitGatewayPrefixListReferencesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayPrefixListReferencesInput{} + } + + return &GetTransitGatewayPrefixListReferencesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayPrefixListReferencesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayPrefixListReferences page. +func (p *GetTransitGatewayPrefixListReferencesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayPrefixListReferencesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTransitGatewayPrefixListReferences(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayPrefixListReferences(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go b/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go index 0d8dd42d6e5..5db8a5faf4e 100644 --- a/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go +++ b/service/ec2/api_op_GetTransitGatewayRouteTableAssociations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,90 @@ func addOperationGetTransitGatewayRouteTableAssociationsMiddlewares(stack *middl return nil } +// GetTransitGatewayRouteTableAssociationsAPIClient is a client that implements the +// GetTransitGatewayRouteTableAssociations operation. +type GetTransitGatewayRouteTableAssociationsAPIClient interface { + GetTransitGatewayRouteTableAssociations(context.Context, *GetTransitGatewayRouteTableAssociationsInput, ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) +} + +var _ GetTransitGatewayRouteTableAssociationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRouteTableAssociationsPaginatorOptions is the paginator options +// for GetTransitGatewayRouteTableAssociations +type GetTransitGatewayRouteTableAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetTransitGatewayRouteTableAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayRouteTableAssociations +type GetTransitGatewayRouteTableAssociationsPaginator struct { + options GetTransitGatewayRouteTableAssociationsPaginatorOptions + client GetTransitGatewayRouteTableAssociationsAPIClient + params *GetTransitGatewayRouteTableAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayRouteTableAssociationsPaginator returns a new +// GetTransitGatewayRouteTableAssociationsPaginator +func NewGetTransitGatewayRouteTableAssociationsPaginator(client GetTransitGatewayRouteTableAssociationsAPIClient, params *GetTransitGatewayRouteTableAssociationsInput, optFns ...func(*GetTransitGatewayRouteTableAssociationsPaginatorOptions)) *GetTransitGatewayRouteTableAssociationsPaginator { + options := GetTransitGatewayRouteTableAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRouteTableAssociationsInput{} + } + + return &GetTransitGatewayRouteTableAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRouteTableAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayRouteTableAssociations page. +func (p *GetTransitGatewayRouteTableAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTableAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTransitGatewayRouteTableAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRouteTableAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go b/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go index 712404c4080..b6221f08baf 100644 --- a/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go +++ b/service/ec2/api_op_GetTransitGatewayRouteTablePropagations.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -134,6 +135,90 @@ func addOperationGetTransitGatewayRouteTablePropagationsMiddlewares(stack *middl return nil } +// GetTransitGatewayRouteTablePropagationsAPIClient is a client that implements the +// GetTransitGatewayRouteTablePropagations operation. +type GetTransitGatewayRouteTablePropagationsAPIClient interface { + GetTransitGatewayRouteTablePropagations(context.Context, *GetTransitGatewayRouteTablePropagationsInput, ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) +} + +var _ GetTransitGatewayRouteTablePropagationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRouteTablePropagationsPaginatorOptions is the paginator options +// for GetTransitGatewayRouteTablePropagations +type GetTransitGatewayRouteTablePropagationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetTransitGatewayRouteTablePropagationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.GetTransitGatewayRouteTablePropagations +type GetTransitGatewayRouteTablePropagationsPaginator struct { + options GetTransitGatewayRouteTablePropagationsPaginatorOptions + client GetTransitGatewayRouteTablePropagationsAPIClient + params *GetTransitGatewayRouteTablePropagationsInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayRouteTablePropagationsPaginator returns a new +// GetTransitGatewayRouteTablePropagationsPaginator +func NewGetTransitGatewayRouteTablePropagationsPaginator(client GetTransitGatewayRouteTablePropagationsAPIClient, params *GetTransitGatewayRouteTablePropagationsInput, optFns ...func(*GetTransitGatewayRouteTablePropagationsPaginatorOptions)) *GetTransitGatewayRouteTablePropagationsPaginator { + options := GetTransitGatewayRouteTablePropagationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRouteTablePropagationsInput{} + } + + return &GetTransitGatewayRouteTablePropagationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRouteTablePropagationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayRouteTablePropagations page. +func (p *GetTransitGatewayRouteTablePropagationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRouteTablePropagationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetTransitGatewayRouteTablePropagations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRouteTablePropagations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_SearchLocalGatewayRoutes.go b/service/ec2/api_op_SearchLocalGatewayRoutes.go index 47f9de2b4b5..74fe2ed2b26 100644 --- a/service/ec2/api_op_SearchLocalGatewayRoutes.go +++ b/service/ec2/api_op_SearchLocalGatewayRoutes.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -126,6 +127,90 @@ func addOperationSearchLocalGatewayRoutesMiddlewares(stack *middleware.Stack, op return nil } +// SearchLocalGatewayRoutesAPIClient is a client that implements the +// SearchLocalGatewayRoutes operation. +type SearchLocalGatewayRoutesAPIClient interface { + SearchLocalGatewayRoutes(context.Context, *SearchLocalGatewayRoutesInput, ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) +} + +var _ SearchLocalGatewayRoutesAPIClient = (*Client)(nil) + +// SearchLocalGatewayRoutesPaginatorOptions is the paginator options for +// SearchLocalGatewayRoutes +type SearchLocalGatewayRoutesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// SearchLocalGatewayRoutesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.SearchLocalGatewayRoutes +type SearchLocalGatewayRoutesPaginator struct { + options SearchLocalGatewayRoutesPaginatorOptions + client SearchLocalGatewayRoutesAPIClient + params *SearchLocalGatewayRoutesInput + nextToken *string + firstPage bool +} + +// NewSearchLocalGatewayRoutesPaginator returns a new +// SearchLocalGatewayRoutesPaginator +func NewSearchLocalGatewayRoutesPaginator(client SearchLocalGatewayRoutesAPIClient, params *SearchLocalGatewayRoutesInput, optFns ...func(*SearchLocalGatewayRoutesPaginatorOptions)) *SearchLocalGatewayRoutesPaginator { + options := SearchLocalGatewayRoutesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchLocalGatewayRoutesInput{} + } + + return &SearchLocalGatewayRoutesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchLocalGatewayRoutesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchLocalGatewayRoutes page. +func (p *SearchLocalGatewayRoutesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchLocalGatewayRoutesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchLocalGatewayRoutes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchLocalGatewayRoutes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go b/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go index e9feac282e1..7e312905ba4 100644 --- a/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go +++ b/service/ec2/api_op_SearchTransitGatewayMulticastGroups.go @@ -4,6 +4,7 @@ package ec2 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/ec2/types" @@ -150,6 +151,90 @@ func addOperationSearchTransitGatewayMulticastGroupsMiddlewares(stack *middlewar return nil } +// SearchTransitGatewayMulticastGroupsAPIClient is a client that implements the +// SearchTransitGatewayMulticastGroups operation. +type SearchTransitGatewayMulticastGroupsAPIClient interface { + SearchTransitGatewayMulticastGroups(context.Context, *SearchTransitGatewayMulticastGroupsInput, ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) +} + +var _ SearchTransitGatewayMulticastGroupsAPIClient = (*Client)(nil) + +// SearchTransitGatewayMulticastGroupsPaginatorOptions is the paginator options for +// SearchTransitGatewayMulticastGroups +type SearchTransitGatewayMulticastGroupsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// SearchTransitGatewayMulticastGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ec2.SearchTransitGatewayMulticastGroups +type SearchTransitGatewayMulticastGroupsPaginator struct { + options SearchTransitGatewayMulticastGroupsPaginatorOptions + client SearchTransitGatewayMulticastGroupsAPIClient + params *SearchTransitGatewayMulticastGroupsInput + nextToken *string + firstPage bool +} + +// NewSearchTransitGatewayMulticastGroupsPaginator returns a new +// SearchTransitGatewayMulticastGroupsPaginator +func NewSearchTransitGatewayMulticastGroupsPaginator(client SearchTransitGatewayMulticastGroupsAPIClient, params *SearchTransitGatewayMulticastGroupsInput, optFns ...func(*SearchTransitGatewayMulticastGroupsPaginatorOptions)) *SearchTransitGatewayMulticastGroupsPaginator { + options := SearchTransitGatewayMulticastGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchTransitGatewayMulticastGroupsInput{} + } + + return &SearchTransitGatewayMulticastGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchTransitGatewayMulticastGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchTransitGatewayMulticastGroups page. +func (p *SearchTransitGatewayMulticastGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchTransitGatewayMulticastGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.SearchTransitGatewayMulticastGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchTransitGatewayMulticastGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ec2/endpoints.go b/service/ec2/endpoints.go index 0c677537d0b..811d72a2b78 100644 --- a/service/ec2/endpoints.go +++ b/service/ec2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ec2instanceconnect/endpoints.go b/service/ec2instanceconnect/endpoints.go index 7b589a0680d..986f16cf643 100644 --- a/service/ec2instanceconnect/endpoints.go +++ b/service/ec2instanceconnect/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ecr/api_op_DescribeImageScanFindings.go b/service/ecr/api_op_DescribeImageScanFindings.go index 0806e163f0e..557b092a44e 100644 --- a/service/ecr/api_op_DescribeImageScanFindings.go +++ b/service/ecr/api_op_DescribeImageScanFindings.go @@ -4,6 +4,7 @@ package ecr 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/ecr/types" @@ -149,6 +150,96 @@ func addOperationDescribeImageScanFindingsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeImageScanFindingsAPIClient is a client that implements the +// DescribeImageScanFindings operation. +type DescribeImageScanFindingsAPIClient interface { + DescribeImageScanFindings(context.Context, *DescribeImageScanFindingsInput, ...func(*Options)) (*DescribeImageScanFindingsOutput, error) +} + +var _ DescribeImageScanFindingsAPIClient = (*Client)(nil) + +// DescribeImageScanFindingsPaginatorOptions is the paginator options for +// DescribeImageScanFindings +type DescribeImageScanFindingsPaginatorOptions struct { + // The maximum number of image scan results returned by DescribeImageScanFindings + // in paginated output. When this parameter is used, DescribeImageScanFindings only + // returns maxResults results in a single page along with a nextToken response + // element. The remaining results of the initial request can be seen by sending + // another DescribeImageScanFindings request with the returned nextToken value. + // This value can be between 1 and 1000. If this parameter is not used, then + // DescribeImageScanFindings returns up to 100 results and a nextToken value, if + // applicable. + 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 +} + +// DescribeImageScanFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeImageScanFindings +type DescribeImageScanFindingsPaginator struct { + options DescribeImageScanFindingsPaginatorOptions + client DescribeImageScanFindingsAPIClient + params *DescribeImageScanFindingsInput + nextToken *string + firstPage bool +} + +// NewDescribeImageScanFindingsPaginator returns a new +// DescribeImageScanFindingsPaginator +func NewDescribeImageScanFindingsPaginator(client DescribeImageScanFindingsAPIClient, params *DescribeImageScanFindingsInput, optFns ...func(*DescribeImageScanFindingsPaginatorOptions)) *DescribeImageScanFindingsPaginator { + options := DescribeImageScanFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImageScanFindingsInput{} + } + + return &DescribeImageScanFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImageScanFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImageScanFindings page. +func (p *DescribeImageScanFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImageScanFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeImageScanFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImageScanFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_DescribeImages.go b/service/ecr/api_op_DescribeImages.go index 91410124a04..bbe677f229f 100644 --- a/service/ecr/api_op_DescribeImages.go +++ b/service/ecr/api_op_DescribeImages.go @@ -4,6 +4,7 @@ package ecr 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/ecr/types" @@ -142,6 +143,94 @@ func addOperationDescribeImagesMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeImagesAPIClient is a client that implements the DescribeImages +// operation. +type DescribeImagesAPIClient interface { + DescribeImages(context.Context, *DescribeImagesInput, ...func(*Options)) (*DescribeImagesOutput, error) +} + +var _ DescribeImagesAPIClient = (*Client)(nil) + +// DescribeImagesPaginatorOptions is the paginator options for DescribeImages +type DescribeImagesPaginatorOptions struct { + // The maximum number of repository results returned by DescribeImages in paginated + // output. When this parameter is used, DescribeImages only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another DescribeImages + // request with the returned nextToken value. This value can be between 1 and 1000. + // If this parameter is not used, then DescribeImages returns up to 100 results and + // a nextToken value, if applicable. This option cannot be used when you specify + // images with imageIds. + 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 +} + +// DescribeImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeImages +type DescribeImagesPaginator struct { + options DescribeImagesPaginatorOptions + client DescribeImagesAPIClient + params *DescribeImagesInput + nextToken *string + firstPage bool +} + +// NewDescribeImagesPaginator returns a new DescribeImagesPaginator +func NewDescribeImagesPaginator(client DescribeImagesAPIClient, params *DescribeImagesInput, optFns ...func(*DescribeImagesPaginatorOptions)) *DescribeImagesPaginator { + options := DescribeImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeImagesInput{} + } + + return &DescribeImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeImages page. +func (p *DescribeImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_DescribeRepositories.go b/service/ecr/api_op_DescribeRepositories.go index e24731ca04a..379eeb64468 100644 --- a/service/ecr/api_op_DescribeRepositories.go +++ b/service/ecr/api_op_DescribeRepositories.go @@ -4,6 +4,7 @@ package ecr 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/ecr/types" @@ -131,6 +132,95 @@ func addOperationDescribeRepositoriesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeRepositoriesAPIClient is a client that implements the +// DescribeRepositories operation. +type DescribeRepositoriesAPIClient interface { + DescribeRepositories(context.Context, *DescribeRepositoriesInput, ...func(*Options)) (*DescribeRepositoriesOutput, error) +} + +var _ DescribeRepositoriesAPIClient = (*Client)(nil) + +// DescribeRepositoriesPaginatorOptions is the paginator options for +// DescribeRepositories +type DescribeRepositoriesPaginatorOptions struct { + // The maximum number of repository results returned by DescribeRepositories in + // paginated output. When this parameter is used, DescribeRepositories only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // DescribeRepositories request with the returned nextToken value. This value can + // be between 1 and 1000. If this parameter is not used, then DescribeRepositories + // returns up to 100 results and a nextToken value, if applicable. This option + // cannot be used when you specify repositories with repositoryNames. + 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 +} + +// DescribeRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.DescribeRepositories +type DescribeRepositoriesPaginator struct { + options DescribeRepositoriesPaginatorOptions + client DescribeRepositoriesAPIClient + params *DescribeRepositoriesInput + nextToken *string + firstPage bool +} + +// NewDescribeRepositoriesPaginator returns a new DescribeRepositoriesPaginator +func NewDescribeRepositoriesPaginator(client DescribeRepositoriesAPIClient, params *DescribeRepositoriesInput, optFns ...func(*DescribeRepositoriesPaginatorOptions)) *DescribeRepositoriesPaginator { + options := DescribeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRepositoriesInput{} + } + + return &DescribeRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRepositoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeRepositories page. +func (p *DescribeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_GetLifecyclePolicyPreview.go b/service/ecr/api_op_GetLifecyclePolicyPreview.go index f36f1e98e04..4359ce37926 100644 --- a/service/ecr/api_op_GetLifecyclePolicyPreview.go +++ b/service/ecr/api_op_GetLifecyclePolicyPreview.go @@ -4,6 +4,7 @@ package ecr 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/ecr/types" @@ -157,6 +158,98 @@ func addOperationGetLifecyclePolicyPreviewMiddlewares(stack *middleware.Stack, o return nil } +// GetLifecyclePolicyPreviewAPIClient is a client that implements the +// GetLifecyclePolicyPreview operation. +type GetLifecyclePolicyPreviewAPIClient interface { + GetLifecyclePolicyPreview(context.Context, *GetLifecyclePolicyPreviewInput, ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) +} + +var _ GetLifecyclePolicyPreviewAPIClient = (*Client)(nil) + +// GetLifecyclePolicyPreviewPaginatorOptions is the paginator options for +// GetLifecyclePolicyPreview +type GetLifecyclePolicyPreviewPaginatorOptions struct { + // The maximum number of repository results returned by + // GetLifecyclePolicyPreviewRequest in
 paginated output. When this parameter is + // used, GetLifecyclePolicyPreviewRequest only returns
 maxResults results in a + // single page along with a nextToken
 response element. The remaining results of + // the initial request can be seen by sending
 another + // GetLifecyclePolicyPreviewRequest request with the returned nextToken
 value. + // This value can be between 1 and 1000. If this
 parameter is not used, then + // GetLifecyclePolicyPreviewRequest returns up to
 100 results and a nextToken + // value, if
 applicable. This option cannot be used when you specify images with + // imageIds. + 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 +} + +// GetLifecyclePolicyPreviewPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.GetLifecyclePolicyPreview +type GetLifecyclePolicyPreviewPaginator struct { + options GetLifecyclePolicyPreviewPaginatorOptions + client GetLifecyclePolicyPreviewAPIClient + params *GetLifecyclePolicyPreviewInput + nextToken *string + firstPage bool +} + +// NewGetLifecyclePolicyPreviewPaginator returns a new +// GetLifecyclePolicyPreviewPaginator +func NewGetLifecyclePolicyPreviewPaginator(client GetLifecyclePolicyPreviewAPIClient, params *GetLifecyclePolicyPreviewInput, optFns ...func(*GetLifecyclePolicyPreviewPaginatorOptions)) *GetLifecyclePolicyPreviewPaginator { + options := GetLifecyclePolicyPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLifecyclePolicyPreviewInput{} + } + + return &GetLifecyclePolicyPreviewPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLifecyclePolicyPreviewPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLifecyclePolicyPreview page. +func (p *GetLifecyclePolicyPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLifecyclePolicyPreviewOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetLifecyclePolicyPreview(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLifecyclePolicyPreview(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/api_op_ListImages.go b/service/ecr/api_op_ListImages.go index 73c5b0eb3fd..21065a31711 100644 --- a/service/ecr/api_op_ListImages.go +++ b/service/ecr/api_op_ListImages.go @@ -4,6 +4,7 @@ package ecr 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/ecr/types" @@ -140,6 +141,92 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum number of image results returned by ListImages in paginated output. + // When this parameter is used, ListImages only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListImages request with the + // returned nextToken value. This value can be between 1 and 1000. If this + // parameter is not used, then ListImages returns up to 100 results and a nextToken + // value, if applicable. + 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 +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecr.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecr/endpoints.go b/service/ecr/endpoints.go index 1b7caeeff63..14e50b1e406 100644 --- a/service/ecr/endpoints.go +++ b/service/ecr/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ecs/api_op_ListAccountSettings.go b/service/ecs/api_op_ListAccountSettings.go index a95b4637889..0a3486d6890 100644 --- a/service/ecs/api_op_ListAccountSettings.go +++ b/service/ecs/api_op_ListAccountSettings.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -137,6 +138,94 @@ func addOperationListAccountSettingsMiddlewares(stack *middleware.Stack, options return nil } +// ListAccountSettingsAPIClient is a client that implements the ListAccountSettings +// operation. +type ListAccountSettingsAPIClient interface { + ListAccountSettings(context.Context, *ListAccountSettingsInput, ...func(*Options)) (*ListAccountSettingsOutput, error) +} + +var _ ListAccountSettingsAPIClient = (*Client)(nil) + +// ListAccountSettingsPaginatorOptions is the paginator options for +// ListAccountSettings +type ListAccountSettingsPaginatorOptions struct { + // The maximum number of account setting results returned by ListAccountSettings in + // paginated output. When this parameter is used, ListAccountSettings only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListAccountSettings request with the returned nextToken value. This value can be + // between 1 and 10. If this parameter is not used, then ListAccountSettings + // returns up to 10 results and a nextToken value if applicable. + 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 +} + +// ListAccountSettingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListAccountSettings +type ListAccountSettingsPaginator struct { + options ListAccountSettingsPaginatorOptions + client ListAccountSettingsAPIClient + params *ListAccountSettingsInput + nextToken *string + firstPage bool +} + +// NewListAccountSettingsPaginator returns a new ListAccountSettingsPaginator +func NewListAccountSettingsPaginator(client ListAccountSettingsAPIClient, params *ListAccountSettingsInput, optFns ...func(*ListAccountSettingsPaginatorOptions)) *ListAccountSettingsPaginator { + options := ListAccountSettingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountSettingsInput{} + } + + return &ListAccountSettingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountSettingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountSettings page. +func (p *ListAccountSettingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountSettingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAccountSettings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountSettings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListAttributes.go b/service/ecs/api_op_ListAttributes.go index aa41bffd27b..b0fbfa2c7cb 100644 --- a/service/ecs/api_op_ListAttributes.go +++ b/service/ecs/api_op_ListAttributes.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -144,6 +145,93 @@ func addOperationListAttributesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListAttributesAPIClient is a client that implements the ListAttributes +// operation. +type ListAttributesAPIClient interface { + ListAttributes(context.Context, *ListAttributesInput, ...func(*Options)) (*ListAttributesOutput, error) +} + +var _ ListAttributesAPIClient = (*Client)(nil) + +// ListAttributesPaginatorOptions is the paginator options for ListAttributes +type ListAttributesPaginatorOptions struct { + // The maximum number of cluster results returned by ListAttributes in paginated + // output. When this parameter is used, ListAttributes only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListAttributes + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListAttributes returns up to 100 results and + // a nextToken value if applicable. + 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 +} + +// ListAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListAttributes +type ListAttributesPaginator struct { + options ListAttributesPaginatorOptions + client ListAttributesAPIClient + params *ListAttributesInput + nextToken *string + firstPage bool +} + +// NewListAttributesPaginator returns a new ListAttributesPaginator +func NewListAttributesPaginator(client ListAttributesAPIClient, params *ListAttributesInput, optFns ...func(*ListAttributesPaginatorOptions)) *ListAttributesPaginator { + options := ListAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttributesInput{} + } + + return &ListAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttributesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttributes page. +func (p *ListAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListClusters.go b/service/ecs/api_op_ListClusters.go index f8205f0fc2b..dd84cb21e0b 100644 --- a/service/ecs/api_op_ListClusters.go +++ b/service/ecs/api_op_ListClusters.go @@ -4,6 +4,7 @@ package ecs 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/awslabs/smithy-go/middleware" @@ -119,6 +120,92 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option 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 maximum number of cluster results returned by ListClusters in paginated + // output. When this parameter is used, ListClusters only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListClusters returns up to 100 results and a + // nextToken value if applicable. + 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 +// github.com/aws/aws-sdk-go-v2/service/ecs.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 { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// 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 + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + 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/ecs/api_op_ListContainerInstances.go b/service/ecs/api_op_ListContainerInstances.go index 57755283e58..d63bfc7dc7d 100644 --- a/service/ecs/api_op_ListContainerInstances.go +++ b/service/ecs/api_op_ListContainerInstances.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -144,6 +145,95 @@ func addOperationListContainerInstancesMiddlewares(stack *middleware.Stack, opti return nil } +// ListContainerInstancesAPIClient is a client that implements the +// ListContainerInstances operation. +type ListContainerInstancesAPIClient interface { + ListContainerInstances(context.Context, *ListContainerInstancesInput, ...func(*Options)) (*ListContainerInstancesOutput, error) +} + +var _ ListContainerInstancesAPIClient = (*Client)(nil) + +// ListContainerInstancesPaginatorOptions is the paginator options for +// ListContainerInstances +type ListContainerInstancesPaginatorOptions struct { + // The maximum number of container instance results returned by + // ListContainerInstances in paginated output. When this parameter is used, + // ListContainerInstances only returns maxResults results in a single page along + // with a nextToken response element. The remaining results of the initial request + // can be seen by sending another ListContainerInstances request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, then ListContainerInstances returns up to 100 results and a nextToken + // value if applicable. + 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 +} + +// ListContainerInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListContainerInstances +type ListContainerInstancesPaginator struct { + options ListContainerInstancesPaginatorOptions + client ListContainerInstancesAPIClient + params *ListContainerInstancesInput + nextToken *string + firstPage bool +} + +// NewListContainerInstancesPaginator returns a new ListContainerInstancesPaginator +func NewListContainerInstancesPaginator(client ListContainerInstancesAPIClient, params *ListContainerInstancesInput, optFns ...func(*ListContainerInstancesPaginatorOptions)) *ListContainerInstancesPaginator { + options := ListContainerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContainerInstancesInput{} + } + + return &ListContainerInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContainerInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContainerInstances page. +func (p *ListContainerInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContainerInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListContainerInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContainerInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListServices.go b/service/ecs/api_op_ListServices.go index 1b50aa8e4b3..92929cab502 100644 --- a/service/ecs/api_op_ListServices.go +++ b/service/ecs/api_op_ListServices.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -131,6 +132,92 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // The maximum number of service results returned by ListServices in paginated + // output. When this parameter is used, ListServices only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another ListServices + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListServices returns up to 10 results and a + // nextToken value if applicable. + 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 +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTaskDefinitionFamilies.go b/service/ecs/api_op_ListTaskDefinitionFamilies.go index 6d3b2e04d74..be44eacddda 100644 --- a/service/ecs/api_op_ListTaskDefinitionFamilies.go +++ b/service/ecs/api_op_ListTaskDefinitionFamilies.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -140,6 +141,96 @@ func addOperationListTaskDefinitionFamiliesMiddlewares(stack *middleware.Stack, return nil } +// ListTaskDefinitionFamiliesAPIClient is a client that implements the +// ListTaskDefinitionFamilies operation. +type ListTaskDefinitionFamiliesAPIClient interface { + ListTaskDefinitionFamilies(context.Context, *ListTaskDefinitionFamiliesInput, ...func(*Options)) (*ListTaskDefinitionFamiliesOutput, error) +} + +var _ ListTaskDefinitionFamiliesAPIClient = (*Client)(nil) + +// ListTaskDefinitionFamiliesPaginatorOptions is the paginator options for +// ListTaskDefinitionFamilies +type ListTaskDefinitionFamiliesPaginatorOptions struct { + // The maximum number of task definition family results returned by + // ListTaskDefinitionFamilies in paginated output. When this parameter is used, + // ListTaskDefinitions only returns maxResults results in a single page along with + // a nextToken response element. The remaining results of the initial request can + // be seen by sending another ListTaskDefinitionFamilies request with the returned + // nextToken value. This value can be between 1 and 100. If this parameter is not + // used, then ListTaskDefinitionFamilies returns up to 100 results and a nextToken + // value if applicable. + 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 +} + +// ListTaskDefinitionFamiliesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTaskDefinitionFamilies +type ListTaskDefinitionFamiliesPaginator struct { + options ListTaskDefinitionFamiliesPaginatorOptions + client ListTaskDefinitionFamiliesAPIClient + params *ListTaskDefinitionFamiliesInput + nextToken *string + firstPage bool +} + +// NewListTaskDefinitionFamiliesPaginator returns a new +// ListTaskDefinitionFamiliesPaginator +func NewListTaskDefinitionFamiliesPaginator(client ListTaskDefinitionFamiliesAPIClient, params *ListTaskDefinitionFamiliesInput, optFns ...func(*ListTaskDefinitionFamiliesPaginatorOptions)) *ListTaskDefinitionFamiliesPaginator { + options := ListTaskDefinitionFamiliesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskDefinitionFamiliesInput{} + } + + return &ListTaskDefinitionFamiliesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskDefinitionFamiliesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTaskDefinitionFamilies page. +func (p *ListTaskDefinitionFamiliesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskDefinitionFamiliesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTaskDefinitionFamilies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskDefinitionFamilies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTaskDefinitions.go b/service/ecs/api_op_ListTaskDefinitions.go index b99b9813522..3ba84d11482 100644 --- a/service/ecs/api_op_ListTaskDefinitions.go +++ b/service/ecs/api_op_ListTaskDefinitions.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -142,6 +143,94 @@ func addOperationListTaskDefinitionsMiddlewares(stack *middleware.Stack, options return nil } +// ListTaskDefinitionsAPIClient is a client that implements the ListTaskDefinitions +// operation. +type ListTaskDefinitionsAPIClient interface { + ListTaskDefinitions(context.Context, *ListTaskDefinitionsInput, ...func(*Options)) (*ListTaskDefinitionsOutput, error) +} + +var _ ListTaskDefinitionsAPIClient = (*Client)(nil) + +// ListTaskDefinitionsPaginatorOptions is the paginator options for +// ListTaskDefinitions +type ListTaskDefinitionsPaginatorOptions struct { + // The maximum number of task definition results returned by ListTaskDefinitions in + // paginated output. When this parameter is used, ListTaskDefinitions only returns + // maxResults results in a single page along with a nextToken response element. The + // remaining results of the initial request can be seen by sending another + // ListTaskDefinitions request with the returned nextToken value. This value can be + // between 1 and 100. If this parameter is not used, then ListTaskDefinitions + // returns up to 100 results and a nextToken value if applicable. + 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 +} + +// ListTaskDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTaskDefinitions +type ListTaskDefinitionsPaginator struct { + options ListTaskDefinitionsPaginatorOptions + client ListTaskDefinitionsAPIClient + params *ListTaskDefinitionsInput + nextToken *string + firstPage bool +} + +// NewListTaskDefinitionsPaginator returns a new ListTaskDefinitionsPaginator +func NewListTaskDefinitionsPaginator(client ListTaskDefinitionsAPIClient, params *ListTaskDefinitionsInput, optFns ...func(*ListTaskDefinitionsPaginatorOptions)) *ListTaskDefinitionsPaginator { + options := ListTaskDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTaskDefinitionsInput{} + } + + return &ListTaskDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTaskDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTaskDefinitions page. +func (p *ListTaskDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTaskDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTaskDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTaskDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/api_op_ListTasks.go b/service/ecs/api_op_ListTasks.go index e29c7447285..a405d0d4a2f 100644 --- a/service/ecs/api_op_ListTasks.go +++ b/service/ecs/api_op_ListTasks.go @@ -4,6 +4,7 @@ package ecs 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/ecs/types" @@ -157,6 +158,92 @@ func addOperationListTasksMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTasksAPIClient is a client that implements the ListTasks operation. +type ListTasksAPIClient interface { + ListTasks(context.Context, *ListTasksInput, ...func(*Options)) (*ListTasksOutput, error) +} + +var _ ListTasksAPIClient = (*Client)(nil) + +// ListTasksPaginatorOptions is the paginator options for ListTasks +type ListTasksPaginatorOptions struct { + // The maximum number of task results returned by ListTasks in paginated output. + // When this parameter is used, ListTasks only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListTasks request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListTasks returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ecs.ListTasks +type ListTasksPaginator struct { + options ListTasksPaginatorOptions + client ListTasksAPIClient + params *ListTasksInput + nextToken *string + firstPage bool +} + +// NewListTasksPaginator returns a new ListTasksPaginator +func NewListTasksPaginator(client ListTasksAPIClient, params *ListTasksInput, optFns ...func(*ListTasksPaginatorOptions)) *ListTasksPaginator { + options := ListTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTasksInput{} + } + + return &ListTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTasks page. +func (p *ListTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ecs/endpoints.go b/service/ecs/endpoints.go index beb321cdfe0..a162fd4e3ae 100644 --- a/service/ecs/endpoints.go +++ b/service/ecs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/efs/api_op_DescribeAccessPoints.go b/service/efs/api_op_DescribeAccessPoints.go index 15402d03d09..a98524d0116 100644 --- a/service/efs/api_op_DescribeAccessPoints.go +++ b/service/efs/api_op_DescribeAccessPoints.go @@ -4,6 +4,7 @@ package efs 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/efs/types" @@ -122,6 +123,90 @@ func addOperationDescribeAccessPointsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeAccessPointsAPIClient is a client that implements the +// DescribeAccessPoints operation. +type DescribeAccessPointsAPIClient interface { + DescribeAccessPoints(context.Context, *DescribeAccessPointsInput, ...func(*Options)) (*DescribeAccessPointsOutput, error) +} + +var _ DescribeAccessPointsAPIClient = (*Client)(nil) + +// DescribeAccessPointsPaginatorOptions is the paginator options for +// DescribeAccessPoints +type DescribeAccessPointsPaginatorOptions struct { + // (Optional) When retrieving all access points for a file system, you can + // optionally specify the MaxItems parameter to limit the number of objects + // returned in a response. The default value is 100. + 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 +} + +// DescribeAccessPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeAccessPoints +type DescribeAccessPointsPaginator struct { + options DescribeAccessPointsPaginatorOptions + client DescribeAccessPointsAPIClient + params *DescribeAccessPointsInput + nextToken *string + firstPage bool +} + +// NewDescribeAccessPointsPaginator returns a new DescribeAccessPointsPaginator +func NewDescribeAccessPointsPaginator(client DescribeAccessPointsAPIClient, params *DescribeAccessPointsInput, optFns ...func(*DescribeAccessPointsPaginatorOptions)) *DescribeAccessPointsPaginator { + options := DescribeAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAccessPointsInput{} + } + + return &DescribeAccessPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAccessPointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAccessPoints page. +func (p *DescribeAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAccessPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeAccessPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_DescribeFileSystems.go b/service/efs/api_op_DescribeFileSystems.go index c814b7b7d15..84addf24dba 100644 --- a/service/efs/api_op_DescribeFileSystems.go +++ b/service/efs/api_op_DescribeFileSystems.go @@ -4,6 +4,7 @@ package efs 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/efs/types" @@ -139,6 +140,90 @@ func addOperationDescribeFileSystemsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeFileSystemsAPIClient is a client that implements the DescribeFileSystems +// operation. +type DescribeFileSystemsAPIClient interface { + DescribeFileSystems(context.Context, *DescribeFileSystemsInput, ...func(*Options)) (*DescribeFileSystemsOutput, error) +} + +var _ DescribeFileSystemsAPIClient = (*Client)(nil) + +// DescribeFileSystemsPaginatorOptions is the paginator options for +// DescribeFileSystems +type DescribeFileSystemsPaginatorOptions struct { + // (Optional) Specifies the maximum number of file systems to return in the + // response (integer). This number is automatically set to 100. The response is + // paginated at 100 per page if you have more than 100 file systems. + 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 +} + +// DescribeFileSystemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeFileSystems +type DescribeFileSystemsPaginator struct { + options DescribeFileSystemsPaginatorOptions + client DescribeFileSystemsAPIClient + params *DescribeFileSystemsInput + nextToken *string + firstPage bool +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFileSystemsInput{} + } + + return &DescribeFileSystemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFileSystemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFileSystems page. +func (p *DescribeFileSystemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFileSystemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.DescribeFileSystems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFileSystems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_DescribeTags.go b/service/efs/api_op_DescribeTags.go index 3f4daf26843..2971e276bae 100644 --- a/service/efs/api_op_DescribeTags.go +++ b/service/efs/api_op_DescribeTags.go @@ -4,6 +4,7 @@ package efs 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/efs/types" @@ -131,6 +132,89 @@ func addOperationDescribeTagsMiddlewares(stack *middleware.Stack, options Option return nil } +// DescribeTagsAPIClient is a client that implements the DescribeTags operation. +type DescribeTagsAPIClient interface { + DescribeTags(context.Context, *DescribeTagsInput, ...func(*Options)) (*DescribeTagsOutput, error) +} + +var _ DescribeTagsAPIClient = (*Client)(nil) + +// DescribeTagsPaginatorOptions is the paginator options for DescribeTags +type DescribeTagsPaginatorOptions struct { + // (Optional) The maximum number of file system tags to return in the response. + // Currently, this number is automatically set to 100, and other values are + // ignored. The response is paginated at 100 per page if you have more than 100 + // tags. + 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 +} + +// DescribeTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.DescribeTags +type DescribeTagsPaginator struct { + options DescribeTagsPaginatorOptions + client DescribeTagsAPIClient + params *DescribeTagsInput + nextToken *string + firstPage bool +} + +// NewDescribeTagsPaginator returns a new DescribeTagsPaginator +func NewDescribeTagsPaginator(client DescribeTagsAPIClient, params *DescribeTagsInput, optFns ...func(*DescribeTagsPaginatorOptions)) *DescribeTagsPaginator { + options := DescribeTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTagsInput{} + } + + return &DescribeTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTags page. +func (p *DescribeTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.DescribeTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/api_op_ListTagsForResource.go b/service/efs/api_op_ListTagsForResource.go index ff2d51e764e..08849a5c710 100644 --- a/service/efs/api_op_ListTagsForResource.go +++ b/service/efs/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package efs 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/efs/types" @@ -119,6 +120,89 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // (Optional) Specifies the maximum number of tag objects to return in the + // response. The default value is 100. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/efs.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/efs/endpoints.go b/service/efs/endpoints.go index c0145dfa1e1..803c7c3826c 100644 --- a/service/efs/endpoints.go +++ b/service/efs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/eks/api_op_ListClusters.go b/service/eks/api_op_ListClusters.go index 0a0e60b900a..4ce5fa38579 100644 --- a/service/eks/api_op_ListClusters.go +++ b/service/eks/api_op_ListClusters.go @@ -4,6 +4,7 @@ package eks 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/awslabs/smithy-go/middleware" @@ -118,6 +119,92 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option 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 maximum number of cluster results returned by ListClusters in paginated + // output. When you use this parameter, ListClusters returns only maxResults + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and 100. + // If you don't use this parameter, ListClusters returns up to 100 results and a + // nextToken value if applicable. + 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 +// github.com/aws/aws-sdk-go-v2/service/eks.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 { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// 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 + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + 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/eks/api_op_ListFargateProfiles.go b/service/eks/api_op_ListFargateProfiles.go index 867d7cd7a38..f933ed018d9 100644 --- a/service/eks/api_op_ListFargateProfiles.go +++ b/service/eks/api_op_ListFargateProfiles.go @@ -4,6 +4,7 @@ package eks 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/awslabs/smithy-go/middleware" @@ -126,6 +127,94 @@ func addOperationListFargateProfilesMiddlewares(stack *middleware.Stack, options return nil } +// ListFargateProfilesAPIClient is a client that implements the ListFargateProfiles +// operation. +type ListFargateProfilesAPIClient interface { + ListFargateProfiles(context.Context, *ListFargateProfilesInput, ...func(*Options)) (*ListFargateProfilesOutput, error) +} + +var _ ListFargateProfilesAPIClient = (*Client)(nil) + +// ListFargateProfilesPaginatorOptions is the paginator options for +// ListFargateProfiles +type ListFargateProfilesPaginatorOptions struct { + // The maximum number of Fargate profile results returned by ListFargateProfiles in + // paginated output. When you use this parameter, ListFargateProfiles returns only + // maxResults results in a single page along with a nextToken response element. You + // can see the remaining results of the initial request by sending another + // ListFargateProfiles request with the returned nextToken value. This value can be + // between 1 and 100. If you don't use this parameter, ListFargateProfiles returns + // up to 100 results and a nextToken value if applicable. + 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 +} + +// ListFargateProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListFargateProfiles +type ListFargateProfilesPaginator struct { + options ListFargateProfilesPaginatorOptions + client ListFargateProfilesAPIClient + params *ListFargateProfilesInput + nextToken *string + firstPage bool +} + +// NewListFargateProfilesPaginator returns a new ListFargateProfilesPaginator +func NewListFargateProfilesPaginator(client ListFargateProfilesAPIClient, params *ListFargateProfilesInput, optFns ...func(*ListFargateProfilesPaginatorOptions)) *ListFargateProfilesPaginator { + options := ListFargateProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFargateProfilesInput{} + } + + return &ListFargateProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFargateProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFargateProfiles page. +func (p *ListFargateProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFargateProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFargateProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFargateProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListNodegroups.go b/service/eks/api_op_ListNodegroups.go index a3bab0793e7..6d6e5f87983 100644 --- a/service/eks/api_op_ListNodegroups.go +++ b/service/eks/api_op_ListNodegroups.go @@ -4,6 +4,7 @@ package eks 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/awslabs/smithy-go/middleware" @@ -126,6 +127,93 @@ func addOperationListNodegroupsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListNodegroupsAPIClient is a client that implements the ListNodegroups +// operation. +type ListNodegroupsAPIClient interface { + ListNodegroups(context.Context, *ListNodegroupsInput, ...func(*Options)) (*ListNodegroupsOutput, error) +} + +var _ ListNodegroupsAPIClient = (*Client)(nil) + +// ListNodegroupsPaginatorOptions is the paginator options for ListNodegroups +type ListNodegroupsPaginatorOptions struct { + // The maximum number of node group results returned by ListNodegroups in paginated + // output. When you use this parameter, ListNodegroups returns only maxResults + // results in a single page along with a nextToken response element. You can see + // the remaining results of the initial request by sending another ListNodegroups + // request with the returned nextToken value. This value can be between 1 and 100. + // If you don't use this parameter, ListNodegroups returns up to 100 results and a + // nextToken value if applicable. + 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 +} + +// ListNodegroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListNodegroups +type ListNodegroupsPaginator struct { + options ListNodegroupsPaginatorOptions + client ListNodegroupsAPIClient + params *ListNodegroupsInput + nextToken *string + firstPage bool +} + +// NewListNodegroupsPaginator returns a new ListNodegroupsPaginator +func NewListNodegroupsPaginator(client ListNodegroupsAPIClient, params *ListNodegroupsInput, optFns ...func(*ListNodegroupsPaginatorOptions)) *ListNodegroupsPaginator { + options := ListNodegroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodegroupsInput{} + } + + return &ListNodegroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodegroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNodegroups page. +func (p *ListNodegroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodegroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNodegroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodegroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/api_op_ListUpdates.go b/service/eks/api_op_ListUpdates.go index 58691b4a48a..ec2819b2daa 100644 --- a/service/eks/api_op_ListUpdates.go +++ b/service/eks/api_op_ListUpdates.go @@ -4,6 +4,7 @@ package eks 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/awslabs/smithy-go/middleware" @@ -128,6 +129,92 @@ func addOperationListUpdatesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListUpdatesAPIClient is a client that implements the ListUpdates operation. +type ListUpdatesAPIClient interface { + ListUpdates(context.Context, *ListUpdatesInput, ...func(*Options)) (*ListUpdatesOutput, error) +} + +var _ ListUpdatesAPIClient = (*Client)(nil) + +// ListUpdatesPaginatorOptions is the paginator options for ListUpdates +type ListUpdatesPaginatorOptions struct { + // The maximum number of update results returned by ListUpdates in paginated + // output. When you use this parameter, ListUpdates returns only maxResults results + // in a single page along with a nextToken response element. You can see the + // remaining results of the initial request by sending another ListUpdates request + // with the returned nextToken value. This value can be between 1 and 100. If you + // don't use this parameter, ListUpdates returns up to 100 results and a nextToken + // value if applicable. + 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 +} + +// ListUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/eks.ListUpdates +type ListUpdatesPaginator struct { + options ListUpdatesPaginatorOptions + client ListUpdatesAPIClient + params *ListUpdatesInput + nextToken *string + firstPage bool +} + +// NewListUpdatesPaginator returns a new ListUpdatesPaginator +func NewListUpdatesPaginator(client ListUpdatesAPIClient, params *ListUpdatesInput, optFns ...func(*ListUpdatesPaginatorOptions)) *ListUpdatesPaginator { + options := ListUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUpdatesInput{} + } + + return &ListUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUpdatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUpdates page. +func (p *ListUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/eks/endpoints.go b/service/eks/endpoints.go index fa5176a0630..8d28d3ca4b4 100644 --- a/service/eks/endpoints.go +++ b/service/eks/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticache/api_op_DescribeCacheClusters.go b/service/elasticache/api_op_DescribeCacheClusters.go index a0962671bbe..dbe4f0d77f6 100644 --- a/service/elasticache/api_op_DescribeCacheClusters.go +++ b/service/elasticache/api_op_DescribeCacheClusters.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -141,6 +142,91 @@ func addOperationDescribeCacheClustersMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeCacheClustersAPIClient is a client that implements the +// DescribeCacheClusters operation. +type DescribeCacheClustersAPIClient interface { + DescribeCacheClusters(context.Context, *DescribeCacheClustersInput, ...func(*Options)) (*DescribeCacheClustersOutput, error) +} + +var _ DescribeCacheClustersAPIClient = (*Client)(nil) + +// DescribeCacheClustersPaginatorOptions is the paginator options for +// DescribeCacheClusters +type DescribeCacheClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheClusters +type DescribeCacheClustersPaginator struct { + options DescribeCacheClustersPaginatorOptions + client DescribeCacheClustersAPIClient + params *DescribeCacheClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheClustersPaginator returns a new DescribeCacheClustersPaginator +func NewDescribeCacheClustersPaginator(client DescribeCacheClustersAPIClient, params *DescribeCacheClustersInput, optFns ...func(*DescribeCacheClustersPaginatorOptions)) *DescribeCacheClustersPaginator { + options := DescribeCacheClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheClustersInput{} + } + + return &DescribeCacheClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheClusters page. +func (p *DescribeCacheClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheEngineVersions.go b/service/elasticache/api_op_DescribeCacheEngineVersions.go index 3bceaf3fd6c..db8328c2b90 100644 --- a/service/elasticache/api_op_DescribeCacheEngineVersions.go +++ b/service/elasticache/api_op_DescribeCacheEngineVersions.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -137,6 +138,92 @@ func addOperationDescribeCacheEngineVersionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeCacheEngineVersionsAPIClient is a client that implements the +// DescribeCacheEngineVersions operation. +type DescribeCacheEngineVersionsAPIClient interface { + DescribeCacheEngineVersions(context.Context, *DescribeCacheEngineVersionsInput, ...func(*Options)) (*DescribeCacheEngineVersionsOutput, error) +} + +var _ DescribeCacheEngineVersionsAPIClient = (*Client)(nil) + +// DescribeCacheEngineVersionsPaginatorOptions is the paginator options for +// DescribeCacheEngineVersions +type DescribeCacheEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheEngineVersions +type DescribeCacheEngineVersionsPaginator struct { + options DescribeCacheEngineVersionsPaginatorOptions + client DescribeCacheEngineVersionsAPIClient + params *DescribeCacheEngineVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheEngineVersionsPaginator returns a new +// DescribeCacheEngineVersionsPaginator +func NewDescribeCacheEngineVersionsPaginator(client DescribeCacheEngineVersionsAPIClient, params *DescribeCacheEngineVersionsInput, optFns ...func(*DescribeCacheEngineVersionsPaginatorOptions)) *DescribeCacheEngineVersionsPaginator { + options := DescribeCacheEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheEngineVersionsInput{} + } + + return &DescribeCacheEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheEngineVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheEngineVersions page. +func (p *DescribeCacheEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheParameterGroups.go b/service/elasticache/api_op_DescribeCacheParameterGroups.go index 059346b665f..1f72b315cd5 100644 --- a/service/elasticache/api_op_DescribeCacheParameterGroups.go +++ b/service/elasticache/api_op_DescribeCacheParameterGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -118,6 +119,92 @@ func addOperationDescribeCacheParameterGroupsMiddlewares(stack *middleware.Stack return nil } +// DescribeCacheParameterGroupsAPIClient is a client that implements the +// DescribeCacheParameterGroups operation. +type DescribeCacheParameterGroupsAPIClient interface { + DescribeCacheParameterGroups(context.Context, *DescribeCacheParameterGroupsInput, ...func(*Options)) (*DescribeCacheParameterGroupsOutput, error) +} + +var _ DescribeCacheParameterGroupsAPIClient = (*Client)(nil) + +// DescribeCacheParameterGroupsPaginatorOptions is the paginator options for +// DescribeCacheParameterGroups +type DescribeCacheParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheParameterGroups +type DescribeCacheParameterGroupsPaginator struct { + options DescribeCacheParameterGroupsPaginatorOptions + client DescribeCacheParameterGroupsAPIClient + params *DescribeCacheParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheParameterGroupsPaginator returns a new +// DescribeCacheParameterGroupsPaginator +func NewDescribeCacheParameterGroupsPaginator(client DescribeCacheParameterGroupsAPIClient, params *DescribeCacheParameterGroupsInput, optFns ...func(*DescribeCacheParameterGroupsPaginatorOptions)) *DescribeCacheParameterGroupsPaginator { + options := DescribeCacheParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheParameterGroupsInput{} + } + + return &DescribeCacheParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheParameterGroups page. +func (p *DescribeCacheParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheParameters.go b/service/elasticache/api_op_DescribeCacheParameters.go index 611c82d499f..e0c56332b9d 100644 --- a/service/elasticache/api_op_DescribeCacheParameters.go +++ b/service/elasticache/api_op_DescribeCacheParameters.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -128,6 +129,92 @@ func addOperationDescribeCacheParametersMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeCacheParametersAPIClient is a client that implements the +// DescribeCacheParameters operation. +type DescribeCacheParametersAPIClient interface { + DescribeCacheParameters(context.Context, *DescribeCacheParametersInput, ...func(*Options)) (*DescribeCacheParametersOutput, error) +} + +var _ DescribeCacheParametersAPIClient = (*Client)(nil) + +// DescribeCacheParametersPaginatorOptions is the paginator options for +// DescribeCacheParameters +type DescribeCacheParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheParameters +type DescribeCacheParametersPaginator struct { + options DescribeCacheParametersPaginatorOptions + client DescribeCacheParametersAPIClient + params *DescribeCacheParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheParametersPaginator returns a new +// DescribeCacheParametersPaginator +func NewDescribeCacheParametersPaginator(client DescribeCacheParametersAPIClient, params *DescribeCacheParametersInput, optFns ...func(*DescribeCacheParametersPaginatorOptions)) *DescribeCacheParametersPaginator { + options := DescribeCacheParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheParametersInput{} + } + + return &DescribeCacheParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheParameters page. +func (p *DescribeCacheParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheSecurityGroups.go b/service/elasticache/api_op_DescribeCacheSecurityGroups.go index eadf77dea1a..69ffb8d4e7c 100644 --- a/service/elasticache/api_op_DescribeCacheSecurityGroups.go +++ b/service/elasticache/api_op_DescribeCacheSecurityGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -119,6 +120,92 @@ func addOperationDescribeCacheSecurityGroupsMiddlewares(stack *middleware.Stack, return nil } +// DescribeCacheSecurityGroupsAPIClient is a client that implements the +// DescribeCacheSecurityGroups operation. +type DescribeCacheSecurityGroupsAPIClient interface { + DescribeCacheSecurityGroups(context.Context, *DescribeCacheSecurityGroupsInput, ...func(*Options)) (*DescribeCacheSecurityGroupsOutput, error) +} + +var _ DescribeCacheSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeCacheSecurityGroupsPaginatorOptions is the paginator options for +// DescribeCacheSecurityGroups +type DescribeCacheSecurityGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheSecurityGroups +type DescribeCacheSecurityGroupsPaginator struct { + options DescribeCacheSecurityGroupsPaginatorOptions + client DescribeCacheSecurityGroupsAPIClient + params *DescribeCacheSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheSecurityGroupsPaginator returns a new +// DescribeCacheSecurityGroupsPaginator +func NewDescribeCacheSecurityGroupsPaginator(client DescribeCacheSecurityGroupsAPIClient, params *DescribeCacheSecurityGroupsInput, optFns ...func(*DescribeCacheSecurityGroupsPaginatorOptions)) *DescribeCacheSecurityGroupsPaginator { + options := DescribeCacheSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheSecurityGroupsInput{} + } + + return &DescribeCacheSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheSecurityGroups page. +func (p *DescribeCacheSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeCacheSubnetGroups.go b/service/elasticache/api_op_DescribeCacheSubnetGroups.go index 125ad74ef95..dd87e3de3e3 100644 --- a/service/elasticache/api_op_DescribeCacheSubnetGroups.go +++ b/service/elasticache/api_op_DescribeCacheSubnetGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -120,6 +121,92 @@ func addOperationDescribeCacheSubnetGroupsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeCacheSubnetGroupsAPIClient is a client that implements the +// DescribeCacheSubnetGroups operation. +type DescribeCacheSubnetGroupsAPIClient interface { + DescribeCacheSubnetGroups(context.Context, *DescribeCacheSubnetGroupsInput, ...func(*Options)) (*DescribeCacheSubnetGroupsOutput, error) +} + +var _ DescribeCacheSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeCacheSubnetGroupsPaginatorOptions is the paginator options for +// DescribeCacheSubnetGroups +type DescribeCacheSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeCacheSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeCacheSubnetGroups +type DescribeCacheSubnetGroupsPaginator struct { + options DescribeCacheSubnetGroupsPaginatorOptions + client DescribeCacheSubnetGroupsAPIClient + params *DescribeCacheSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeCacheSubnetGroupsPaginator returns a new +// DescribeCacheSubnetGroupsPaginator +func NewDescribeCacheSubnetGroupsPaginator(client DescribeCacheSubnetGroupsAPIClient, params *DescribeCacheSubnetGroupsInput, optFns ...func(*DescribeCacheSubnetGroupsPaginatorOptions)) *DescribeCacheSubnetGroupsPaginator { + options := DescribeCacheSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCacheSubnetGroupsInput{} + } + + return &DescribeCacheSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCacheSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCacheSubnetGroups page. +func (p *DescribeCacheSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCacheSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCacheSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCacheSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeEngineDefaultParameters.go b/service/elasticache/api_op_DescribeEngineDefaultParameters.go index 87f3cb6e8c1..07a5524f29e 100644 --- a/service/elasticache/api_op_DescribeEngineDefaultParameters.go +++ b/service/elasticache/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -119,6 +120,94 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return nil } +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeEvents.go b/service/elasticache/api_op_DescribeEvents.go index e0c96fa2d0f..a5cccc15252 100644 --- a/service/elasticache/api_op_DescribeEvents.go +++ b/service/elasticache/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -138,6 +139,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeGlobalReplicationGroups.go b/service/elasticache/api_op_DescribeGlobalReplicationGroups.go index 7d73688bb7d..287cc491cad 100644 --- a/service/elasticache/api_op_DescribeGlobalReplicationGroups.go +++ b/service/elasticache/api_op_DescribeGlobalReplicationGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -120,6 +121,91 @@ func addOperationDescribeGlobalReplicationGroupsMiddlewares(stack *middleware.St return nil } +// DescribeGlobalReplicationGroupsAPIClient is a client that implements the +// DescribeGlobalReplicationGroups operation. +type DescribeGlobalReplicationGroupsAPIClient interface { + DescribeGlobalReplicationGroups(context.Context, *DescribeGlobalReplicationGroupsInput, ...func(*Options)) (*DescribeGlobalReplicationGroupsOutput, error) +} + +var _ DescribeGlobalReplicationGroupsAPIClient = (*Client)(nil) + +// DescribeGlobalReplicationGroupsPaginatorOptions is the paginator options for +// DescribeGlobalReplicationGroups +type DescribeGlobalReplicationGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + 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 +} + +// DescribeGlobalReplicationGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeGlobalReplicationGroups +type DescribeGlobalReplicationGroupsPaginator struct { + options DescribeGlobalReplicationGroupsPaginatorOptions + client DescribeGlobalReplicationGroupsAPIClient + params *DescribeGlobalReplicationGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeGlobalReplicationGroupsPaginator returns a new +// DescribeGlobalReplicationGroupsPaginator +func NewDescribeGlobalReplicationGroupsPaginator(client DescribeGlobalReplicationGroupsAPIClient, params *DescribeGlobalReplicationGroupsInput, optFns ...func(*DescribeGlobalReplicationGroupsPaginatorOptions)) *DescribeGlobalReplicationGroupsPaginator { + options := DescribeGlobalReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalReplicationGroupsInput{} + } + + return &DescribeGlobalReplicationGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalReplicationGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGlobalReplicationGroups page. +func (p *DescribeGlobalReplicationGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalReplicationGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeGlobalReplicationGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalReplicationGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReplicationGroups.go b/service/elasticache/api_op_DescribeReplicationGroups.go index 082bce3621b..20243df64a5 100644 --- a/service/elasticache/api_op_DescribeReplicationGroups.go +++ b/service/elasticache/api_op_DescribeReplicationGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -121,6 +122,92 @@ func addOperationDescribeReplicationGroupsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeReplicationGroupsAPIClient is a client that implements the +// DescribeReplicationGroups operation. +type DescribeReplicationGroupsAPIClient interface { + DescribeReplicationGroups(context.Context, *DescribeReplicationGroupsInput, ...func(*Options)) (*DescribeReplicationGroupsOutput, error) +} + +var _ DescribeReplicationGroupsAPIClient = (*Client)(nil) + +// DescribeReplicationGroupsPaginatorOptions is the paginator options for +// DescribeReplicationGroups +type DescribeReplicationGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeReplicationGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReplicationGroups +type DescribeReplicationGroupsPaginator struct { + options DescribeReplicationGroupsPaginatorOptions + client DescribeReplicationGroupsAPIClient + params *DescribeReplicationGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeReplicationGroupsPaginator returns a new +// DescribeReplicationGroupsPaginator +func NewDescribeReplicationGroupsPaginator(client DescribeReplicationGroupsAPIClient, params *DescribeReplicationGroupsInput, optFns ...func(*DescribeReplicationGroupsPaginatorOptions)) *DescribeReplicationGroupsPaginator { + options := DescribeReplicationGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReplicationGroupsInput{} + } + + return &DescribeReplicationGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReplicationGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReplicationGroups page. +func (p *DescribeReplicationGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReplicationGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReplicationGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReplicationGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReservedCacheNodes.go b/service/elasticache/api_op_DescribeReservedCacheNodes.go index d9c5f53c083..fe656a41c9f 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodes.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodes.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -205,6 +206,92 @@ func addOperationDescribeReservedCacheNodesMiddlewares(stack *middleware.Stack, return nil } +// DescribeReservedCacheNodesAPIClient is a client that implements the +// DescribeReservedCacheNodes operation. +type DescribeReservedCacheNodesAPIClient interface { + DescribeReservedCacheNodes(context.Context, *DescribeReservedCacheNodesInput, ...func(*Options)) (*DescribeReservedCacheNodesOutput, error) +} + +var _ DescribeReservedCacheNodesAPIClient = (*Client)(nil) + +// DescribeReservedCacheNodesPaginatorOptions is the paginator options for +// DescribeReservedCacheNodes +type DescribeReservedCacheNodesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeReservedCacheNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReservedCacheNodes +type DescribeReservedCacheNodesPaginator struct { + options DescribeReservedCacheNodesPaginatorOptions + client DescribeReservedCacheNodesAPIClient + params *DescribeReservedCacheNodesInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedCacheNodesPaginator returns a new +// DescribeReservedCacheNodesPaginator +func NewDescribeReservedCacheNodesPaginator(client DescribeReservedCacheNodesAPIClient, params *DescribeReservedCacheNodesInput, optFns ...func(*DescribeReservedCacheNodesPaginatorOptions)) *DescribeReservedCacheNodesPaginator { + options := DescribeReservedCacheNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedCacheNodesInput{} + } + + return &DescribeReservedCacheNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedCacheNodesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedCacheNodes page. +func (p *DescribeReservedCacheNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedCacheNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedCacheNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedCacheNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go index 65c6f0575b0..27ffd629d3a 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -200,6 +201,92 @@ func addOperationDescribeReservedCacheNodesOfferingsMiddlewares(stack *middlewar return nil } +// DescribeReservedCacheNodesOfferingsAPIClient is a client that implements the +// DescribeReservedCacheNodesOfferings operation. +type DescribeReservedCacheNodesOfferingsAPIClient interface { + DescribeReservedCacheNodesOfferings(context.Context, *DescribeReservedCacheNodesOfferingsInput, ...func(*Options)) (*DescribeReservedCacheNodesOfferingsOutput, error) +} + +var _ DescribeReservedCacheNodesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedCacheNodesOfferingsPaginatorOptions is the paginator options for +// DescribeReservedCacheNodesOfferings +type DescribeReservedCacheNodesOfferingsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 100 Constraints: minimum + // 20; maximum 100. + 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 +} + +// DescribeReservedCacheNodesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeReservedCacheNodesOfferings +type DescribeReservedCacheNodesOfferingsPaginator struct { + options DescribeReservedCacheNodesOfferingsPaginatorOptions + client DescribeReservedCacheNodesOfferingsAPIClient + params *DescribeReservedCacheNodesOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedCacheNodesOfferingsPaginator returns a new +// DescribeReservedCacheNodesOfferingsPaginator +func NewDescribeReservedCacheNodesOfferingsPaginator(client DescribeReservedCacheNodesOfferingsAPIClient, params *DescribeReservedCacheNodesOfferingsInput, optFns ...func(*DescribeReservedCacheNodesOfferingsPaginatorOptions)) *DescribeReservedCacheNodesOfferingsPaginator { + options := DescribeReservedCacheNodesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedCacheNodesOfferingsInput{} + } + + return &DescribeReservedCacheNodesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedCacheNodesOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedCacheNodesOfferings page. +func (p *DescribeReservedCacheNodesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedCacheNodesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedCacheNodesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedCacheNodesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeServiceUpdates.go b/service/elasticache/api_op_DescribeServiceUpdates.go index cf3f090bff1..8ffbcfd576c 100644 --- a/service/elasticache/api_op_DescribeServiceUpdates.go +++ b/service/elasticache/api_op_DescribeServiceUpdates.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -117,6 +118,88 @@ func addOperationDescribeServiceUpdatesMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeServiceUpdatesAPIClient is a client that implements the +// DescribeServiceUpdates operation. +type DescribeServiceUpdatesAPIClient interface { + DescribeServiceUpdates(context.Context, *DescribeServiceUpdatesInput, ...func(*Options)) (*DescribeServiceUpdatesOutput, error) +} + +var _ DescribeServiceUpdatesAPIClient = (*Client)(nil) + +// DescribeServiceUpdatesPaginatorOptions is the paginator options for +// DescribeServiceUpdates +type DescribeServiceUpdatesPaginatorOptions struct { + // The maximum number of records to include in the response + 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 +} + +// DescribeServiceUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeServiceUpdates +type DescribeServiceUpdatesPaginator struct { + options DescribeServiceUpdatesPaginatorOptions + client DescribeServiceUpdatesAPIClient + params *DescribeServiceUpdatesInput + nextToken *string + firstPage bool +} + +// NewDescribeServiceUpdatesPaginator returns a new DescribeServiceUpdatesPaginator +func NewDescribeServiceUpdatesPaginator(client DescribeServiceUpdatesAPIClient, params *DescribeServiceUpdatesInput, optFns ...func(*DescribeServiceUpdatesPaginatorOptions)) *DescribeServiceUpdatesPaginator { + options := DescribeServiceUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServiceUpdatesInput{} + } + + return &DescribeServiceUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServiceUpdatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeServiceUpdates page. +func (p *DescribeServiceUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServiceUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeServiceUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServiceUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeSnapshots.go b/service/elasticache/api_op_DescribeSnapshots.go index 555f784ed83..a0197b2016f 100644 --- a/service/elasticache/api_op_DescribeSnapshots.go +++ b/service/elasticache/api_op_DescribeSnapshots.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -142,6 +143,90 @@ func addOperationDescribeSnapshotsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeSnapshotsAPIClient is a client that implements the DescribeSnapshots +// operation. +type DescribeSnapshotsAPIClient interface { + DescribeSnapshots(context.Context, *DescribeSnapshotsInput, ...func(*Options)) (*DescribeSnapshotsOutput, error) +} + +var _ DescribeSnapshotsAPIClient = (*Client)(nil) + +// DescribeSnapshotsPaginatorOptions is the paginator options for DescribeSnapshots +type DescribeSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. Default: 50 Constraints: minimum + // 20; maximum 50. + 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 +} + +// DescribeSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeSnapshots +type DescribeSnapshotsPaginator struct { + options DescribeSnapshotsPaginatorOptions + client DescribeSnapshotsAPIClient + params *DescribeSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeSnapshotsPaginator returns a new DescribeSnapshotsPaginator +func NewDescribeSnapshotsPaginator(client DescribeSnapshotsAPIClient, params *DescribeSnapshotsInput, optFns ...func(*DescribeSnapshotsPaginatorOptions)) *DescribeSnapshotsPaginator { + options := DescribeSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSnapshotsInput{} + } + + return &DescribeSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSnapshots page. +func (p *DescribeSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUpdateActions.go b/service/elasticache/api_op_DescribeUpdateActions.go index 2200a8cbbf9..8a5e990596d 100644 --- a/service/elasticache/api_op_DescribeUpdateActions.go +++ b/service/elasticache/api_op_DescribeUpdateActions.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -136,6 +137,88 @@ func addOperationDescribeUpdateActionsMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeUpdateActionsAPIClient is a client that implements the +// DescribeUpdateActions operation. +type DescribeUpdateActionsAPIClient interface { + DescribeUpdateActions(context.Context, *DescribeUpdateActionsInput, ...func(*Options)) (*DescribeUpdateActionsOutput, error) +} + +var _ DescribeUpdateActionsAPIClient = (*Client)(nil) + +// DescribeUpdateActionsPaginatorOptions is the paginator options for +// DescribeUpdateActions +type DescribeUpdateActionsPaginatorOptions struct { + // The maximum number of records to include in the response + 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 +} + +// DescribeUpdateActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUpdateActions +type DescribeUpdateActionsPaginator struct { + options DescribeUpdateActionsPaginatorOptions + client DescribeUpdateActionsAPIClient + params *DescribeUpdateActionsInput + nextToken *string + firstPage bool +} + +// NewDescribeUpdateActionsPaginator returns a new DescribeUpdateActionsPaginator +func NewDescribeUpdateActionsPaginator(client DescribeUpdateActionsAPIClient, params *DescribeUpdateActionsInput, optFns ...func(*DescribeUpdateActionsPaginatorOptions)) *DescribeUpdateActionsPaginator { + options := DescribeUpdateActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUpdateActionsInput{} + } + + return &DescribeUpdateActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUpdateActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeUpdateActions page. +func (p *DescribeUpdateActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUpdateActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeUpdateActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUpdateActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUserGroups.go b/service/elasticache/api_op_DescribeUserGroups.go index 80a8d859d96..c0fee5b672e 100644 --- a/service/elasticache/api_op_DescribeUserGroups.go +++ b/service/elasticache/api_op_DescribeUserGroups.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -116,6 +117,90 @@ func addOperationDescribeUserGroupsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeUserGroupsAPIClient is a client that implements the DescribeUserGroups +// operation. +type DescribeUserGroupsAPIClient interface { + DescribeUserGroups(context.Context, *DescribeUserGroupsInput, ...func(*Options)) (*DescribeUserGroupsOutput, error) +} + +var _ DescribeUserGroupsAPIClient = (*Client)(nil) + +// DescribeUserGroupsPaginatorOptions is the paginator options for +// DescribeUserGroups +type DescribeUserGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + 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 +} + +// DescribeUserGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUserGroups +type DescribeUserGroupsPaginator struct { + options DescribeUserGroupsPaginatorOptions + client DescribeUserGroupsAPIClient + params *DescribeUserGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeUserGroupsPaginator returns a new DescribeUserGroupsPaginator +func NewDescribeUserGroupsPaginator(client DescribeUserGroupsAPIClient, params *DescribeUserGroupsInput, optFns ...func(*DescribeUserGroupsPaginatorOptions)) *DescribeUserGroupsPaginator { + options := DescribeUserGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUserGroupsInput{} + } + + return &DescribeUserGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUserGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeUserGroups page. +func (p *DescribeUserGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUserGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeUserGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUserGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/api_op_DescribeUsers.go b/service/elasticache/api_op_DescribeUsers.go index 30830bbaa93..188034e0322 100644 --- a/service/elasticache/api_op_DescribeUsers.go +++ b/service/elasticache/api_op_DescribeUsers.go @@ -4,6 +4,7 @@ package elasticache 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/elasticache/types" @@ -125,6 +126,88 @@ func addOperationDescribeUsersMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeUsersAPIClient is a client that implements the DescribeUsers operation. +type DescribeUsersAPIClient interface { + DescribeUsers(context.Context, *DescribeUsersInput, ...func(*Options)) (*DescribeUsersOutput, error) +} + +var _ DescribeUsersAPIClient = (*Client)(nil) + +// DescribeUsersPaginatorOptions is the paginator options for DescribeUsers +type DescribeUsersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a marker is included in the response so + // that the remaining results can be retrieved. + 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 +} + +// DescribeUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticache.DescribeUsers +type DescribeUsersPaginator struct { + options DescribeUsersPaginatorOptions + client DescribeUsersAPIClient + params *DescribeUsersInput + nextToken *string + firstPage bool +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsersInput{} + } + + return &DescribeUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeUsers page. +func (p *DescribeUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticache/endpoints.go b/service/elasticache/endpoints.go index 5b6ff558a87..e928b97e2b0 100644 --- a/service/elasticache/endpoints.go +++ b/service/elasticache/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go b/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go index fd691c2a61e..a926c2af242 100644 --- a/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go +++ b/service/elasticbeanstalk/api_op_DescribeEnvironmentManagedActionHistory.go @@ -4,6 +4,7 @@ package elasticbeanstalk 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/elasticbeanstalk/types" @@ -114,6 +115,89 @@ func addOperationDescribeEnvironmentManagedActionHistoryMiddlewares(stack *middl return nil } +// DescribeEnvironmentManagedActionHistoryAPIClient is a client that implements the +// DescribeEnvironmentManagedActionHistory operation. +type DescribeEnvironmentManagedActionHistoryAPIClient interface { + DescribeEnvironmentManagedActionHistory(context.Context, *DescribeEnvironmentManagedActionHistoryInput, ...func(*Options)) (*DescribeEnvironmentManagedActionHistoryOutput, error) +} + +var _ DescribeEnvironmentManagedActionHistoryAPIClient = (*Client)(nil) + +// DescribeEnvironmentManagedActionHistoryPaginatorOptions is the paginator options +// for DescribeEnvironmentManagedActionHistory +type DescribeEnvironmentManagedActionHistoryPaginatorOptions struct { + // The maximum number of items to return for a single request. + 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 +} + +// DescribeEnvironmentManagedActionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.DescribeEnvironmentManagedActionHistory +type DescribeEnvironmentManagedActionHistoryPaginator struct { + options DescribeEnvironmentManagedActionHistoryPaginatorOptions + client DescribeEnvironmentManagedActionHistoryAPIClient + params *DescribeEnvironmentManagedActionHistoryInput + nextToken *string + firstPage bool +} + +// NewDescribeEnvironmentManagedActionHistoryPaginator returns a new +// DescribeEnvironmentManagedActionHistoryPaginator +func NewDescribeEnvironmentManagedActionHistoryPaginator(client DescribeEnvironmentManagedActionHistoryAPIClient, params *DescribeEnvironmentManagedActionHistoryInput, optFns ...func(*DescribeEnvironmentManagedActionHistoryPaginatorOptions)) *DescribeEnvironmentManagedActionHistoryPaginator { + options := DescribeEnvironmentManagedActionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEnvironmentManagedActionHistoryInput{} + } + + return &DescribeEnvironmentManagedActionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEnvironmentManagedActionHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEnvironmentManagedActionHistory page. +func (p *DescribeEnvironmentManagedActionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEnvironmentManagedActionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = p.options.Limit + } + + result, err := p.client.DescribeEnvironmentManagedActionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEnvironmentManagedActionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_DescribeEvents.go b/service/elasticbeanstalk/api_op_DescribeEvents.go index 481cc9be02e..72af134af66 100644 --- a/service/elasticbeanstalk/api_op_DescribeEvents.go +++ b/service/elasticbeanstalk/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package elasticbeanstalk 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/elasticbeanstalk/types" @@ -152,6 +153,88 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // Specifies the maximum number of events that can be returned, beginning with the + // most recent event. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_ListPlatformBranches.go b/service/elasticbeanstalk/api_op_ListPlatformBranches.go index 085480bf5ce..547f6a607e1 100644 --- a/service/elasticbeanstalk/api_op_ListPlatformBranches.go +++ b/service/elasticbeanstalk/api_op_ListPlatformBranches.go @@ -4,6 +4,7 @@ package elasticbeanstalk 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/elasticbeanstalk/types" @@ -148,6 +149,88 @@ func addOperationListPlatformBranchesMiddlewares(stack *middleware.Stack, option return nil } +// ListPlatformBranchesAPIClient is a client that implements the +// ListPlatformBranches operation. +type ListPlatformBranchesAPIClient interface { + ListPlatformBranches(context.Context, *ListPlatformBranchesInput, ...func(*Options)) (*ListPlatformBranchesOutput, error) +} + +var _ ListPlatformBranchesAPIClient = (*Client)(nil) + +// ListPlatformBranchesPaginatorOptions is the paginator options for +// ListPlatformBranches +type ListPlatformBranchesPaginatorOptions struct { + // The maximum number of platform branch values returned in one call. + 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 +} + +// ListPlatformBranchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.ListPlatformBranches +type ListPlatformBranchesPaginator struct { + options ListPlatformBranchesPaginatorOptions + client ListPlatformBranchesAPIClient + params *ListPlatformBranchesInput + nextToken *string + firstPage bool +} + +// NewListPlatformBranchesPaginator returns a new ListPlatformBranchesPaginator +func NewListPlatformBranchesPaginator(client ListPlatformBranchesAPIClient, params *ListPlatformBranchesInput, optFns ...func(*ListPlatformBranchesPaginatorOptions)) *ListPlatformBranchesPaginator { + options := ListPlatformBranchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformBranchesInput{} + } + + return &ListPlatformBranchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformBranchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPlatformBranches page. +func (p *ListPlatformBranchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformBranchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.ListPlatformBranches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformBranches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/api_op_ListPlatformVersions.go b/service/elasticbeanstalk/api_op_ListPlatformVersions.go index 0e2d789dd07..48cf197259b 100644 --- a/service/elasticbeanstalk/api_op_ListPlatformVersions.go +++ b/service/elasticbeanstalk/api_op_ListPlatformVersions.go @@ -4,6 +4,7 @@ package elasticbeanstalk 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/elasticbeanstalk/types" @@ -118,6 +119,88 @@ func addOperationListPlatformVersionsMiddlewares(stack *middleware.Stack, option return nil } +// ListPlatformVersionsAPIClient is a client that implements the +// ListPlatformVersions operation. +type ListPlatformVersionsAPIClient interface { + ListPlatformVersions(context.Context, *ListPlatformVersionsInput, ...func(*Options)) (*ListPlatformVersionsOutput, error) +} + +var _ ListPlatformVersionsAPIClient = (*Client)(nil) + +// ListPlatformVersionsPaginatorOptions is the paginator options for +// ListPlatformVersions +type ListPlatformVersionsPaginatorOptions struct { + // The maximum number of platform version values returned in one call. + 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 +} + +// ListPlatformVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticbeanstalk.ListPlatformVersions +type ListPlatformVersionsPaginator struct { + options ListPlatformVersionsPaginatorOptions + client ListPlatformVersionsAPIClient + params *ListPlatformVersionsInput + nextToken *string + firstPage bool +} + +// NewListPlatformVersionsPaginator returns a new ListPlatformVersionsPaginator +func NewListPlatformVersionsPaginator(client ListPlatformVersionsAPIClient, params *ListPlatformVersionsInput, optFns ...func(*ListPlatformVersionsPaginatorOptions)) *ListPlatformVersionsPaginator { + options := ListPlatformVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformVersionsInput{} + } + + return &ListPlatformVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPlatformVersions page. +func (p *ListPlatformVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.ListPlatformVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticbeanstalk/endpoints.go b/service/elasticbeanstalk/endpoints.go index ea7835795be..e22c8e7732f 100644 --- a/service/elasticbeanstalk/endpoints.go +++ b/service/elasticbeanstalk/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticinference/api_op_DescribeAccelerators.go b/service/elasticinference/api_op_DescribeAccelerators.go index c87a16eea0f..28870dd2138 100644 --- a/service/elasticinference/api_op_DescribeAccelerators.go +++ b/service/elasticinference/api_op_DescribeAccelerators.go @@ -4,6 +4,7 @@ package elasticinference 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/elasticinference/types" @@ -120,6 +121,92 @@ func addOperationDescribeAcceleratorsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeAcceleratorsAPIClient is a client that implements the +// DescribeAccelerators operation. +type DescribeAcceleratorsAPIClient interface { + DescribeAccelerators(context.Context, *DescribeAcceleratorsInput, ...func(*Options)) (*DescribeAcceleratorsOutput, error) +} + +var _ DescribeAcceleratorsAPIClient = (*Client)(nil) + +// DescribeAcceleratorsPaginatorOptions is the paginator options for +// DescribeAccelerators +type DescribeAcceleratorsPaginatorOptions struct { + // The total number of items to return in the command's output. If the total number + // of items available is more than the value specified, a NextToken is provided in + // the command's output. To resume pagination, provide the NextToken value in the + // starting-token argument of a subsequent command. Do not use the NextToken + // response element directly outside of the AWS CLI. + 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 +} + +// DescribeAcceleratorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticinference.DescribeAccelerators +type DescribeAcceleratorsPaginator struct { + options DescribeAcceleratorsPaginatorOptions + client DescribeAcceleratorsAPIClient + params *DescribeAcceleratorsInput + nextToken *string + firstPage bool +} + +// NewDescribeAcceleratorsPaginator returns a new DescribeAcceleratorsPaginator +func NewDescribeAcceleratorsPaginator(client DescribeAcceleratorsAPIClient, params *DescribeAcceleratorsInput, optFns ...func(*DescribeAcceleratorsPaginatorOptions)) *DescribeAcceleratorsPaginator { + options := DescribeAcceleratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAcceleratorsInput{} + } + + return &DescribeAcceleratorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAcceleratorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAccelerators page. +func (p *DescribeAcceleratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAcceleratorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAccelerators(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAccelerators(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticinference/endpoints.go b/service/elasticinference/endpoints.go index f262afe83b9..64ec855f907 100644 --- a/service/elasticinference/endpoints.go +++ b/service/elasticinference/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go b/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go index 7aa1934f171..dea3d7a9bc5 100644 --- a/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go +++ b/service/elasticloadbalancing/api_op_DescribeLoadBalancers.go @@ -4,6 +4,7 @@ package elasticloadbalancing 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/elasticloadbalancing/types" @@ -114,6 +115,81 @@ func addOperationDescribeLoadBalancersMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions struct { + // 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 +} + +// DescribeLoadBalancersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing.DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeLoadBalancers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancing/endpoints.go b/service/elasticloadbalancing/endpoints.go index bbf94d7f442..f1a4f6d686c 100644 --- a/service/elasticloadbalancing/endpoints.go +++ b/service/elasticloadbalancing/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticloadbalancingv2/api_op_DescribeListeners.go b/service/elasticloadbalancingv2/api_op_DescribeListeners.go index 378c561a0b6..90918a625dc 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeListeners.go +++ b/service/elasticloadbalancingv2/api_op_DescribeListeners.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 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/elasticloadbalancingv2/types" @@ -117,6 +118,80 @@ func addOperationDescribeListenersMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeListenersAPIClient is a client that implements the DescribeListeners +// operation. +type DescribeListenersAPIClient interface { + DescribeListeners(context.Context, *DescribeListenersInput, ...func(*Options)) (*DescribeListenersOutput, error) +} + +var _ DescribeListenersAPIClient = (*Client)(nil) + +// DescribeListenersPaginatorOptions is the paginator options for DescribeListeners +type DescribeListenersPaginatorOptions struct { + // 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 +} + +// DescribeListenersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeListeners +type DescribeListenersPaginator struct { + options DescribeListenersPaginatorOptions + client DescribeListenersAPIClient + params *DescribeListenersInput + nextToken *string + firstPage bool +} + +// NewDescribeListenersPaginator returns a new DescribeListenersPaginator +func NewDescribeListenersPaginator(client DescribeListenersAPIClient, params *DescribeListenersInput, optFns ...func(*DescribeListenersPaginatorOptions)) *DescribeListenersPaginator { + options := DescribeListenersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeListenersInput{} + } + + return &DescribeListenersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeListenersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeListeners page. +func (p *DescribeListenersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeListenersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeListeners(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeListeners(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go b/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go index 7081836745b..12224bdee31 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go +++ b/service/elasticloadbalancingv2/api_op_DescribeLoadBalancers.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 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/elasticloadbalancingv2/types" @@ -116,6 +117,81 @@ func addOperationDescribeLoadBalancersMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeLoadBalancersAPIClient is a client that implements the +// DescribeLoadBalancers operation. +type DescribeLoadBalancersAPIClient interface { + DescribeLoadBalancers(context.Context, *DescribeLoadBalancersInput, ...func(*Options)) (*DescribeLoadBalancersOutput, error) +} + +var _ DescribeLoadBalancersAPIClient = (*Client)(nil) + +// DescribeLoadBalancersPaginatorOptions is the paginator options for +// DescribeLoadBalancers +type DescribeLoadBalancersPaginatorOptions struct { + // 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 +} + +// DescribeLoadBalancersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeLoadBalancers +type DescribeLoadBalancersPaginator struct { + options DescribeLoadBalancersPaginatorOptions + client DescribeLoadBalancersAPIClient + params *DescribeLoadBalancersInput + nextToken *string + firstPage bool +} + +// NewDescribeLoadBalancersPaginator returns a new DescribeLoadBalancersPaginator +func NewDescribeLoadBalancersPaginator(client DescribeLoadBalancersAPIClient, params *DescribeLoadBalancersInput, optFns ...func(*DescribeLoadBalancersPaginatorOptions)) *DescribeLoadBalancersPaginator { + options := DescribeLoadBalancersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeLoadBalancersInput{} + } + + return &DescribeLoadBalancersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeLoadBalancersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeLoadBalancers page. +func (p *DescribeLoadBalancersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeLoadBalancersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeLoadBalancers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeLoadBalancers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go b/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go index e28aa08e6a7..38015065a89 100644 --- a/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go +++ b/service/elasticloadbalancingv2/api_op_DescribeTargetGroups.go @@ -4,6 +4,7 @@ package elasticloadbalancingv2 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/elasticloadbalancingv2/types" @@ -121,6 +122,81 @@ func addOperationDescribeTargetGroupsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeTargetGroupsAPIClient is a client that implements the +// DescribeTargetGroups operation. +type DescribeTargetGroupsAPIClient interface { + DescribeTargetGroups(context.Context, *DescribeTargetGroupsInput, ...func(*Options)) (*DescribeTargetGroupsOutput, error) +} + +var _ DescribeTargetGroupsAPIClient = (*Client)(nil) + +// DescribeTargetGroupsPaginatorOptions is the paginator options for +// DescribeTargetGroups +type DescribeTargetGroupsPaginatorOptions struct { + // 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 +} + +// DescribeTargetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2.DescribeTargetGroups +type DescribeTargetGroupsPaginator struct { + options DescribeTargetGroupsPaginatorOptions + client DescribeTargetGroupsAPIClient + params *DescribeTargetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeTargetGroupsPaginator returns a new DescribeTargetGroupsPaginator +func NewDescribeTargetGroupsPaginator(client DescribeTargetGroupsAPIClient, params *DescribeTargetGroupsInput, optFns ...func(*DescribeTargetGroupsPaginatorOptions)) *DescribeTargetGroupsPaginator { + options := DescribeTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTargetGroupsInput{} + } + + return &DescribeTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTargetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTargetGroups page. +func (p *DescribeTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTargetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.DescribeTargetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticloadbalancingv2/endpoints.go b/service/elasticloadbalancingv2/endpoints.go index 38d1803a051..c5c9e3e35d4 100644 --- a/service/elasticloadbalancingv2/endpoints.go +++ b/service/elasticloadbalancingv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go b/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go index 5a9af83faa5..9e7a3099ede 100644 --- a/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go +++ b/service/elasticsearchservice/api_op_DescribeInboundCrossClusterSearchConnections.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -130,6 +131,90 @@ func addOperationDescribeInboundCrossClusterSearchConnectionsMiddlewares(stack * return nil } +// DescribeInboundCrossClusterSearchConnectionsAPIClient is a client that +// implements the DescribeInboundCrossClusterSearchConnections operation. +type DescribeInboundCrossClusterSearchConnectionsAPIClient interface { + DescribeInboundCrossClusterSearchConnections(context.Context, *DescribeInboundCrossClusterSearchConnectionsInput, ...func(*Options)) (*DescribeInboundCrossClusterSearchConnectionsOutput, error) +} + +var _ DescribeInboundCrossClusterSearchConnectionsAPIClient = (*Client)(nil) + +// DescribeInboundCrossClusterSearchConnectionsPaginatorOptions is the paginator +// options for DescribeInboundCrossClusterSearchConnections +type DescribeInboundCrossClusterSearchConnectionsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + 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 +} + +// DescribeInboundCrossClusterSearchConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeInboundCrossClusterSearchConnections +type DescribeInboundCrossClusterSearchConnectionsPaginator struct { + options DescribeInboundCrossClusterSearchConnectionsPaginatorOptions + client DescribeInboundCrossClusterSearchConnectionsAPIClient + params *DescribeInboundCrossClusterSearchConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeInboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeInboundCrossClusterSearchConnectionsPaginator +func NewDescribeInboundCrossClusterSearchConnectionsPaginator(client DescribeInboundCrossClusterSearchConnectionsAPIClient, params *DescribeInboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeInboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeInboundCrossClusterSearchConnectionsPaginator { + options := DescribeInboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInboundCrossClusterSearchConnectionsInput{} + } + + return &DescribeInboundCrossClusterSearchConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInboundCrossClusterSearchConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInboundCrossClusterSearchConnections page. +func (p *DescribeInboundCrossClusterSearchConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInboundCrossClusterSearchConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInboundCrossClusterSearchConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInboundCrossClusterSearchConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go b/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go index bd8f5277c28..f6dc6475d6e 100644 --- a/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go +++ b/service/elasticsearchservice/api_op_DescribeOutboundCrossClusterSearchConnections.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -130,6 +131,90 @@ func addOperationDescribeOutboundCrossClusterSearchConnectionsMiddlewares(stack return nil } +// DescribeOutboundCrossClusterSearchConnectionsAPIClient is a client that +// implements the DescribeOutboundCrossClusterSearchConnections operation. +type DescribeOutboundCrossClusterSearchConnectionsAPIClient interface { + DescribeOutboundCrossClusterSearchConnections(context.Context, *DescribeOutboundCrossClusterSearchConnectionsInput, ...func(*Options)) (*DescribeOutboundCrossClusterSearchConnectionsOutput, error) +} + +var _ DescribeOutboundCrossClusterSearchConnectionsAPIClient = (*Client)(nil) + +// DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions is the paginator +// options for DescribeOutboundCrossClusterSearchConnections +type DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + 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 +} + +// DescribeOutboundCrossClusterSearchConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeOutboundCrossClusterSearchConnections +type DescribeOutboundCrossClusterSearchConnectionsPaginator struct { + options DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions + client DescribeOutboundCrossClusterSearchConnectionsAPIClient + params *DescribeOutboundCrossClusterSearchConnectionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOutboundCrossClusterSearchConnectionsPaginator returns a new +// DescribeOutboundCrossClusterSearchConnectionsPaginator +func NewDescribeOutboundCrossClusterSearchConnectionsPaginator(client DescribeOutboundCrossClusterSearchConnectionsAPIClient, params *DescribeOutboundCrossClusterSearchConnectionsInput, optFns ...func(*DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions)) *DescribeOutboundCrossClusterSearchConnectionsPaginator { + options := DescribeOutboundCrossClusterSearchConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOutboundCrossClusterSearchConnectionsInput{} + } + + return &DescribeOutboundCrossClusterSearchConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOutboundCrossClusterSearchConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOutboundCrossClusterSearchConnections page. +func (p *DescribeOutboundCrossClusterSearchConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOutboundCrossClusterSearchConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeOutboundCrossClusterSearchConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOutboundCrossClusterSearchConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribePackages.go b/service/elasticsearchservice/api_op_DescribePackages.go index 18b977600d3..dcfae5603e6 100644 --- a/service/elasticsearchservice/api_op_DescribePackages.go +++ b/service/elasticsearchservice/api_op_DescribePackages.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -110,6 +111,87 @@ func addOperationDescribePackagesMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribePackagesAPIClient is a client that implements the DescribePackages +// operation. +type DescribePackagesAPIClient interface { + DescribePackages(context.Context, *DescribePackagesInput, ...func(*Options)) (*DescribePackagesOutput, error) +} + +var _ DescribePackagesAPIClient = (*Client)(nil) + +// DescribePackagesPaginatorOptions is the paginator options for DescribePackages +type DescribePackagesPaginatorOptions struct { + // Limits results to a maximum number of packages. + 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 +} + +// DescribePackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribePackages +type DescribePackagesPaginator struct { + options DescribePackagesPaginatorOptions + client DescribePackagesAPIClient + params *DescribePackagesInput + nextToken *string + firstPage bool +} + +// NewDescribePackagesPaginator returns a new DescribePackagesPaginator +func NewDescribePackagesPaginator(client DescribePackagesAPIClient, params *DescribePackagesInput, optFns ...func(*DescribePackagesPaginatorOptions)) *DescribePackagesPaginator { + options := DescribePackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePackagesInput{} + } + + return &DescribePackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePackagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePackages page. +func (p *DescribePackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go index afd5d173b53..73913f3785c 100644 --- a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go +++ b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstanceOfferings.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -113,6 +114,90 @@ func addOperationDescribeReservedElasticsearchInstanceOfferingsMiddlewares(stack return nil } +// DescribeReservedElasticsearchInstanceOfferingsAPIClient is a client that +// implements the DescribeReservedElasticsearchInstanceOfferings operation. +type DescribeReservedElasticsearchInstanceOfferingsAPIClient interface { + DescribeReservedElasticsearchInstanceOfferings(context.Context, *DescribeReservedElasticsearchInstanceOfferingsInput, ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) +} + +var _ DescribeReservedElasticsearchInstanceOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions is the paginator +// options for DescribeReservedElasticsearchInstanceOfferings +type DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + 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 +} + +// DescribeReservedElasticsearchInstanceOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeReservedElasticsearchInstanceOfferings +type DescribeReservedElasticsearchInstanceOfferingsPaginator struct { + options DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions + client DescribeReservedElasticsearchInstanceOfferingsAPIClient + params *DescribeReservedElasticsearchInstanceOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedElasticsearchInstanceOfferingsPaginator returns a new +// DescribeReservedElasticsearchInstanceOfferingsPaginator +func NewDescribeReservedElasticsearchInstanceOfferingsPaginator(client DescribeReservedElasticsearchInstanceOfferingsAPIClient, params *DescribeReservedElasticsearchInstanceOfferingsInput, optFns ...func(*DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions)) *DescribeReservedElasticsearchInstanceOfferingsPaginator { + options := DescribeReservedElasticsearchInstanceOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedElasticsearchInstanceOfferingsInput{} + } + + return &DescribeReservedElasticsearchInstanceOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedElasticsearchInstanceOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedElasticsearchInstanceOfferings page. +func (p *DescribeReservedElasticsearchInstanceOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstanceOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeReservedElasticsearchInstanceOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedElasticsearchInstanceOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go index c172059849a..c3cd53568dd 100644 --- a/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go +++ b/service/elasticsearchservice/api_op_DescribeReservedElasticsearchInstances.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -113,6 +114,90 @@ func addOperationDescribeReservedElasticsearchInstancesMiddlewares(stack *middle return nil } +// DescribeReservedElasticsearchInstancesAPIClient is a client that implements the +// DescribeReservedElasticsearchInstances operation. +type DescribeReservedElasticsearchInstancesAPIClient interface { + DescribeReservedElasticsearchInstances(context.Context, *DescribeReservedElasticsearchInstancesInput, ...func(*Options)) (*DescribeReservedElasticsearchInstancesOutput, error) +} + +var _ DescribeReservedElasticsearchInstancesAPIClient = (*Client)(nil) + +// DescribeReservedElasticsearchInstancesPaginatorOptions is the paginator options +// for DescribeReservedElasticsearchInstances +type DescribeReservedElasticsearchInstancesPaginatorOptions struct { + // Set this value to limit the number of results returned. If not specified, + // defaults to 100. + 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 +} + +// DescribeReservedElasticsearchInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.DescribeReservedElasticsearchInstances +type DescribeReservedElasticsearchInstancesPaginator struct { + options DescribeReservedElasticsearchInstancesPaginatorOptions + client DescribeReservedElasticsearchInstancesAPIClient + params *DescribeReservedElasticsearchInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedElasticsearchInstancesPaginator returns a new +// DescribeReservedElasticsearchInstancesPaginator +func NewDescribeReservedElasticsearchInstancesPaginator(client DescribeReservedElasticsearchInstancesAPIClient, params *DescribeReservedElasticsearchInstancesInput, optFns ...func(*DescribeReservedElasticsearchInstancesPaginatorOptions)) *DescribeReservedElasticsearchInstancesPaginator { + options := DescribeReservedElasticsearchInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedElasticsearchInstancesInput{} + } + + return &DescribeReservedElasticsearchInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedElasticsearchInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedElasticsearchInstances page. +func (p *DescribeReservedElasticsearchInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedElasticsearchInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeReservedElasticsearchInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedElasticsearchInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_GetUpgradeHistory.go b/service/elasticsearchservice/api_op_GetUpgradeHistory.go index 017516c007d..5ba08f912ff 100644 --- a/service/elasticsearchservice/api_op_GetUpgradeHistory.go +++ b/service/elasticsearchservice/api_op_GetUpgradeHistory.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -124,6 +125,87 @@ func addOperationGetUpgradeHistoryMiddlewares(stack *middleware.Stack, options O return nil } +// GetUpgradeHistoryAPIClient is a client that implements the GetUpgradeHistory +// operation. +type GetUpgradeHistoryAPIClient interface { + GetUpgradeHistory(context.Context, *GetUpgradeHistoryInput, ...func(*Options)) (*GetUpgradeHistoryOutput, error) +} + +var _ GetUpgradeHistoryAPIClient = (*Client)(nil) + +// GetUpgradeHistoryPaginatorOptions is the paginator options for GetUpgradeHistory +type GetUpgradeHistoryPaginatorOptions struct { + // Set this value to limit the number of results returned. + 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 +} + +// GetUpgradeHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.GetUpgradeHistory +type GetUpgradeHistoryPaginator struct { + options GetUpgradeHistoryPaginatorOptions + client GetUpgradeHistoryAPIClient + params *GetUpgradeHistoryInput + nextToken *string + firstPage bool +} + +// NewGetUpgradeHistoryPaginator returns a new GetUpgradeHistoryPaginator +func NewGetUpgradeHistoryPaginator(client GetUpgradeHistoryAPIClient, params *GetUpgradeHistoryInput, optFns ...func(*GetUpgradeHistoryPaginatorOptions)) *GetUpgradeHistoryPaginator { + options := GetUpgradeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUpgradeHistoryInput{} + } + + return &GetUpgradeHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUpgradeHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUpgradeHistory page. +func (p *GetUpgradeHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUpgradeHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetUpgradeHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUpgradeHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListDomainsForPackage.go b/service/elasticsearchservice/api_op_ListDomainsForPackage.go index aa7b2de9df3..fe8e2e0849e 100644 --- a/service/elasticsearchservice/api_op_ListDomainsForPackage.go +++ b/service/elasticsearchservice/api_op_ListDomainsForPackage.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -115,6 +116,88 @@ func addOperationListDomainsForPackageMiddlewares(stack *middleware.Stack, optio return nil } +// ListDomainsForPackageAPIClient is a client that implements the +// ListDomainsForPackage operation. +type ListDomainsForPackageAPIClient interface { + ListDomainsForPackage(context.Context, *ListDomainsForPackageInput, ...func(*Options)) (*ListDomainsForPackageOutput, error) +} + +var _ ListDomainsForPackageAPIClient = (*Client)(nil) + +// ListDomainsForPackagePaginatorOptions is the paginator options for +// ListDomainsForPackage +type ListDomainsForPackagePaginatorOptions struct { + // Limits results to a maximum number of domains. + 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 +} + +// ListDomainsForPackagePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListDomainsForPackage +type ListDomainsForPackagePaginator struct { + options ListDomainsForPackagePaginatorOptions + client ListDomainsForPackageAPIClient + params *ListDomainsForPackageInput + nextToken *string + firstPage bool +} + +// NewListDomainsForPackagePaginator returns a new ListDomainsForPackagePaginator +func NewListDomainsForPackagePaginator(client ListDomainsForPackageAPIClient, params *ListDomainsForPackageInput, optFns ...func(*ListDomainsForPackagePaginatorOptions)) *ListDomainsForPackagePaginator { + options := ListDomainsForPackagePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsForPackageInput{} + } + + return &ListDomainsForPackagePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsForPackagePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomainsForPackage page. +func (p *ListDomainsForPackagePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsForPackageOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDomainsForPackage(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainsForPackage(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go b/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go index fc487f00180..d978a1bf6f8 100644 --- a/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go +++ b/service/elasticsearchservice/api_op_ListElasticsearchInstanceTypes.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -128,6 +129,90 @@ func addOperationListElasticsearchInstanceTypesMiddlewares(stack *middleware.Sta return nil } +// ListElasticsearchInstanceTypesAPIClient is a client that implements the +// ListElasticsearchInstanceTypes operation. +type ListElasticsearchInstanceTypesAPIClient interface { + ListElasticsearchInstanceTypes(context.Context, *ListElasticsearchInstanceTypesInput, ...func(*Options)) (*ListElasticsearchInstanceTypesOutput, error) +} + +var _ ListElasticsearchInstanceTypesAPIClient = (*Client)(nil) + +// ListElasticsearchInstanceTypesPaginatorOptions is the paginator options for +// ListElasticsearchInstanceTypes +type ListElasticsearchInstanceTypesPaginatorOptions struct { + // Set this value to limit the number of results returned. Value provided must be + // greater than 30 else it wont be honored. + 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 +} + +// ListElasticsearchInstanceTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListElasticsearchInstanceTypes +type ListElasticsearchInstanceTypesPaginator struct { + options ListElasticsearchInstanceTypesPaginatorOptions + client ListElasticsearchInstanceTypesAPIClient + params *ListElasticsearchInstanceTypesInput + nextToken *string + firstPage bool +} + +// NewListElasticsearchInstanceTypesPaginator returns a new +// ListElasticsearchInstanceTypesPaginator +func NewListElasticsearchInstanceTypesPaginator(client ListElasticsearchInstanceTypesAPIClient, params *ListElasticsearchInstanceTypesInput, optFns ...func(*ListElasticsearchInstanceTypesPaginatorOptions)) *ListElasticsearchInstanceTypesPaginator { + options := ListElasticsearchInstanceTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListElasticsearchInstanceTypesInput{} + } + + return &ListElasticsearchInstanceTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListElasticsearchInstanceTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListElasticsearchInstanceTypes page. +func (p *ListElasticsearchInstanceTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListElasticsearchInstanceTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListElasticsearchInstanceTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListElasticsearchInstanceTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListElasticsearchVersions.go b/service/elasticsearchservice/api_op_ListElasticsearchVersions.go index 27245e3a26a..da8edcbb0c3 100644 --- a/service/elasticsearchservice/api_op_ListElasticsearchVersions.go +++ b/service/elasticsearchservice/api_op_ListElasticsearchVersions.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/awslabs/smithy-go/middleware" @@ -116,6 +117,90 @@ func addOperationListElasticsearchVersionsMiddlewares(stack *middleware.Stack, o return nil } +// ListElasticsearchVersionsAPIClient is a client that implements the +// ListElasticsearchVersions operation. +type ListElasticsearchVersionsAPIClient interface { + ListElasticsearchVersions(context.Context, *ListElasticsearchVersionsInput, ...func(*Options)) (*ListElasticsearchVersionsOutput, error) +} + +var _ ListElasticsearchVersionsAPIClient = (*Client)(nil) + +// ListElasticsearchVersionsPaginatorOptions is the paginator options for +// ListElasticsearchVersions +type ListElasticsearchVersionsPaginatorOptions struct { + // Set this value to limit the number of results returned. Value provided must be + // greater than 10 else it wont be honored. + 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 +} + +// ListElasticsearchVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListElasticsearchVersions +type ListElasticsearchVersionsPaginator struct { + options ListElasticsearchVersionsPaginatorOptions + client ListElasticsearchVersionsAPIClient + params *ListElasticsearchVersionsInput + nextToken *string + firstPage bool +} + +// NewListElasticsearchVersionsPaginator returns a new +// ListElasticsearchVersionsPaginator +func NewListElasticsearchVersionsPaginator(client ListElasticsearchVersionsAPIClient, params *ListElasticsearchVersionsInput, optFns ...func(*ListElasticsearchVersionsPaginatorOptions)) *ListElasticsearchVersionsPaginator { + options := ListElasticsearchVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListElasticsearchVersionsInput{} + } + + return &ListElasticsearchVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListElasticsearchVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListElasticsearchVersions page. +func (p *ListElasticsearchVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListElasticsearchVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListElasticsearchVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListElasticsearchVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/api_op_ListPackagesForDomain.go b/service/elasticsearchservice/api_op_ListPackagesForDomain.go index 8c9354a6285..8d612ef4dc5 100644 --- a/service/elasticsearchservice/api_op_ListPackagesForDomain.go +++ b/service/elasticsearchservice/api_op_ListPackagesForDomain.go @@ -4,6 +4,7 @@ package elasticsearchservice 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/elasticsearchservice/types" @@ -117,6 +118,88 @@ func addOperationListPackagesForDomainMiddlewares(stack *middleware.Stack, optio return nil } +// ListPackagesForDomainAPIClient is a client that implements the +// ListPackagesForDomain operation. +type ListPackagesForDomainAPIClient interface { + ListPackagesForDomain(context.Context, *ListPackagesForDomainInput, ...func(*Options)) (*ListPackagesForDomainOutput, error) +} + +var _ ListPackagesForDomainAPIClient = (*Client)(nil) + +// ListPackagesForDomainPaginatorOptions is the paginator options for +// ListPackagesForDomain +type ListPackagesForDomainPaginatorOptions struct { + // Limits results to a maximum number of packages. + 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 +} + +// ListPackagesForDomainPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elasticsearchservice.ListPackagesForDomain +type ListPackagesForDomainPaginator struct { + options ListPackagesForDomainPaginatorOptions + client ListPackagesForDomainAPIClient + params *ListPackagesForDomainInput + nextToken *string + firstPage bool +} + +// NewListPackagesForDomainPaginator returns a new ListPackagesForDomainPaginator +func NewListPackagesForDomainPaginator(client ListPackagesForDomainAPIClient, params *ListPackagesForDomainInput, optFns ...func(*ListPackagesForDomainPaginatorOptions)) *ListPackagesForDomainPaginator { + options := ListPackagesForDomainPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagesForDomainInput{} + } + + return &ListPackagesForDomainPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagesForDomainPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackagesForDomain page. +func (p *ListPackagesForDomainPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagesForDomainOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPackagesForDomain(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagesForDomain(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elasticsearchservice/endpoints.go b/service/elasticsearchservice/endpoints.go index fba5fac389e..6b65de17981 100644 --- a/service/elasticsearchservice/endpoints.go +++ b/service/elasticsearchservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/elastictranscoder/api_op_ListJobsByPipeline.go b/service/elastictranscoder/api_op_ListJobsByPipeline.go index c649d936a61..a892e13b7ea 100644 --- a/service/elastictranscoder/api_op_ListJobsByPipeline.go +++ b/service/elastictranscoder/api_op_ListJobsByPipeline.go @@ -4,6 +4,7 @@ package elastictranscoder 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/elastictranscoder/types" @@ -122,6 +123,81 @@ func addOperationListJobsByPipelineMiddlewares(stack *middleware.Stack, options return nil } +// ListJobsByPipelineAPIClient is a client that implements the ListJobsByPipeline +// operation. +type ListJobsByPipelineAPIClient interface { + ListJobsByPipeline(context.Context, *ListJobsByPipelineInput, ...func(*Options)) (*ListJobsByPipelineOutput, error) +} + +var _ ListJobsByPipelineAPIClient = (*Client)(nil) + +// ListJobsByPipelinePaginatorOptions is the paginator options for +// ListJobsByPipeline +type ListJobsByPipelinePaginatorOptions struct { + // 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 +} + +// ListJobsByPipelinePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListJobsByPipeline +type ListJobsByPipelinePaginator struct { + options ListJobsByPipelinePaginatorOptions + client ListJobsByPipelineAPIClient + params *ListJobsByPipelineInput + nextToken *string + firstPage bool +} + +// NewListJobsByPipelinePaginator returns a new ListJobsByPipelinePaginator +func NewListJobsByPipelinePaginator(client ListJobsByPipelineAPIClient, params *ListJobsByPipelineInput, optFns ...func(*ListJobsByPipelinePaginatorOptions)) *ListJobsByPipelinePaginator { + options := ListJobsByPipelinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsByPipelineInput{} + } + + return &ListJobsByPipelinePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsByPipelinePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobsByPipeline page. +func (p *ListJobsByPipelinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsByPipelineOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListJobsByPipeline(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobsByPipeline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListJobsByStatus.go b/service/elastictranscoder/api_op_ListJobsByStatus.go index 87c5b5eb2df..3eeb6fe31e0 100644 --- a/service/elastictranscoder/api_op_ListJobsByStatus.go +++ b/service/elastictranscoder/api_op_ListJobsByStatus.go @@ -4,6 +4,7 @@ package elastictranscoder 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/elastictranscoder/types" @@ -123,6 +124,80 @@ func addOperationListJobsByStatusMiddlewares(stack *middleware.Stack, options Op return nil } +// ListJobsByStatusAPIClient is a client that implements the ListJobsByStatus +// operation. +type ListJobsByStatusAPIClient interface { + ListJobsByStatus(context.Context, *ListJobsByStatusInput, ...func(*Options)) (*ListJobsByStatusOutput, error) +} + +var _ ListJobsByStatusAPIClient = (*Client)(nil) + +// ListJobsByStatusPaginatorOptions is the paginator options for ListJobsByStatus +type ListJobsByStatusPaginatorOptions struct { + // 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 +} + +// ListJobsByStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListJobsByStatus +type ListJobsByStatusPaginator struct { + options ListJobsByStatusPaginatorOptions + client ListJobsByStatusAPIClient + params *ListJobsByStatusInput + nextToken *string + firstPage bool +} + +// NewListJobsByStatusPaginator returns a new ListJobsByStatusPaginator +func NewListJobsByStatusPaginator(client ListJobsByStatusAPIClient, params *ListJobsByStatusInput, optFns ...func(*ListJobsByStatusPaginatorOptions)) *ListJobsByStatusPaginator { + options := ListJobsByStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsByStatusInput{} + } + + return &ListJobsByStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsByStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobsByStatus page. +func (p *ListJobsByStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsByStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListJobsByStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobsByStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListPipelines.go b/service/elastictranscoder/api_op_ListPipelines.go index 32407fbb4f8..2571dab82ac 100644 --- a/service/elastictranscoder/api_op_ListPipelines.go +++ b/service/elastictranscoder/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package elastictranscoder 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/elastictranscoder/types" @@ -113,6 +114,79 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // 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 +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/api_op_ListPresets.go b/service/elastictranscoder/api_op_ListPresets.go index cbe9ada5171..b45729d1c7f 100644 --- a/service/elastictranscoder/api_op_ListPresets.go +++ b/service/elastictranscoder/api_op_ListPresets.go @@ -4,6 +4,7 @@ package elastictranscoder 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/elastictranscoder/types" @@ -113,6 +114,79 @@ func addOperationListPresetsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListPresetsAPIClient is a client that implements the ListPresets operation. +type ListPresetsAPIClient interface { + ListPresets(context.Context, *ListPresetsInput, ...func(*Options)) (*ListPresetsOutput, error) +} + +var _ ListPresetsAPIClient = (*Client)(nil) + +// ListPresetsPaginatorOptions is the paginator options for ListPresets +type ListPresetsPaginatorOptions struct { + // 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 +} + +// ListPresetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/elastictranscoder.ListPresets +type ListPresetsPaginator struct { + options ListPresetsPaginatorOptions + client ListPresetsAPIClient + params *ListPresetsInput + nextToken *string + firstPage bool +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPresetsInput{} + } + + return &ListPresetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPresetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPresets page. +func (p *ListPresetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPresetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + result, err := p.client.ListPresets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPresets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/elastictranscoder/endpoints.go b/service/elastictranscoder/endpoints.go index 6ab6b998ad0..00e5859e68c 100644 --- a/service/elastictranscoder/endpoints.go +++ b/service/elastictranscoder/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/emr/api_op_ListBootstrapActions.go b/service/emr/api_op_ListBootstrapActions.go index 4f9156efe35..6b9fd3d6308 100644 --- a/service/emr/api_op_ListBootstrapActions.go +++ b/service/emr/api_op_ListBootstrapActions.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -112,6 +113,81 @@ func addOperationListBootstrapActionsMiddlewares(stack *middleware.Stack, option return nil } +// ListBootstrapActionsAPIClient is a client that implements the +// ListBootstrapActions operation. +type ListBootstrapActionsAPIClient interface { + ListBootstrapActions(context.Context, *ListBootstrapActionsInput, ...func(*Options)) (*ListBootstrapActionsOutput, error) +} + +var _ ListBootstrapActionsAPIClient = (*Client)(nil) + +// ListBootstrapActionsPaginatorOptions is the paginator options for +// ListBootstrapActions +type ListBootstrapActionsPaginatorOptions struct { + // 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 +} + +// ListBootstrapActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListBootstrapActions +type ListBootstrapActionsPaginator struct { + options ListBootstrapActionsPaginatorOptions + client ListBootstrapActionsAPIClient + params *ListBootstrapActionsInput + nextToken *string + firstPage bool +} + +// NewListBootstrapActionsPaginator returns a new ListBootstrapActionsPaginator +func NewListBootstrapActionsPaginator(client ListBootstrapActionsAPIClient, params *ListBootstrapActionsInput, optFns ...func(*ListBootstrapActionsPaginatorOptions)) *ListBootstrapActionsPaginator { + options := ListBootstrapActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBootstrapActionsInput{} + } + + return &ListBootstrapActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBootstrapActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBootstrapActions page. +func (p *ListBootstrapActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBootstrapActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListBootstrapActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBootstrapActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListClusters.go b/service/emr/api_op_ListClusters.go index 026270028d7..8475da9b92d 100644 --- a/service/emr/api_op_ListClusters.go +++ b/service/emr/api_op_ListClusters.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -120,6 +121,79 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option 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 { + // 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 +// github.com/aws/aws-sdk-go-v2/service/emr.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 { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// 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.Marker = p.nextToken + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + 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/emr/api_op_ListInstanceFleets.go b/service/emr/api_op_ListInstanceFleets.go index 1e005afdbef..bea7e45d33f 100644 --- a/service/emr/api_op_ListInstanceFleets.go +++ b/service/emr/api_op_ListInstanceFleets.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -112,6 +113,81 @@ func addOperationListInstanceFleetsMiddlewares(stack *middleware.Stack, options return nil } +// ListInstanceFleetsAPIClient is a client that implements the ListInstanceFleets +// operation. +type ListInstanceFleetsAPIClient interface { + ListInstanceFleets(context.Context, *ListInstanceFleetsInput, ...func(*Options)) (*ListInstanceFleetsOutput, error) +} + +var _ ListInstanceFleetsAPIClient = (*Client)(nil) + +// ListInstanceFleetsPaginatorOptions is the paginator options for +// ListInstanceFleets +type ListInstanceFleetsPaginatorOptions struct { + // 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 +} + +// ListInstanceFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstanceFleets +type ListInstanceFleetsPaginator struct { + options ListInstanceFleetsPaginatorOptions + client ListInstanceFleetsAPIClient + params *ListInstanceFleetsInput + nextToken *string + firstPage bool +} + +// NewListInstanceFleetsPaginator returns a new ListInstanceFleetsPaginator +func NewListInstanceFleetsPaginator(client ListInstanceFleetsAPIClient, params *ListInstanceFleetsInput, optFns ...func(*ListInstanceFleetsPaginatorOptions)) *ListInstanceFleetsPaginator { + options := ListInstanceFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceFleetsInput{} + } + + return &ListInstanceFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceFleetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstanceFleets page. +func (p *ListInstanceFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstanceFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListInstanceGroups.go b/service/emr/api_op_ListInstanceGroups.go index 416331b46ea..bf7038a5e68 100644 --- a/service/emr/api_op_ListInstanceGroups.go +++ b/service/emr/api_op_ListInstanceGroups.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -112,6 +113,81 @@ func addOperationListInstanceGroupsMiddlewares(stack *middleware.Stack, options return nil } +// ListInstanceGroupsAPIClient is a client that implements the ListInstanceGroups +// operation. +type ListInstanceGroupsAPIClient interface { + ListInstanceGroups(context.Context, *ListInstanceGroupsInput, ...func(*Options)) (*ListInstanceGroupsOutput, error) +} + +var _ ListInstanceGroupsAPIClient = (*Client)(nil) + +// ListInstanceGroupsPaginatorOptions is the paginator options for +// ListInstanceGroups +type ListInstanceGroupsPaginatorOptions struct { + // 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 +} + +// ListInstanceGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstanceGroups +type ListInstanceGroupsPaginator struct { + options ListInstanceGroupsPaginatorOptions + client ListInstanceGroupsAPIClient + params *ListInstanceGroupsInput + nextToken *string + firstPage bool +} + +// NewListInstanceGroupsPaginator returns a new ListInstanceGroupsPaginator +func NewListInstanceGroupsPaginator(client ListInstanceGroupsAPIClient, params *ListInstanceGroupsInput, optFns ...func(*ListInstanceGroupsPaginatorOptions)) *ListInstanceGroupsPaginator { + options := ListInstanceGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceGroupsInput{} + } + + return &ListInstanceGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstanceGroups page. +func (p *ListInstanceGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstanceGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListInstances.go b/service/emr/api_op_ListInstances.go index 18bc36c66fc..58c5990ea05 100644 --- a/service/emr/api_op_ListInstances.go +++ b/service/emr/api_op_ListInstances.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -131,6 +132,79 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // 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 +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListNotebookExecutions.go b/service/emr/api_op_ListNotebookExecutions.go index 42dda4d5e93..986f362e582 100644 --- a/service/emr/api_op_ListNotebookExecutions.go +++ b/service/emr/api_op_ListNotebookExecutions.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -153,6 +154,81 @@ func addOperationListNotebookExecutionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListNotebookExecutionsAPIClient is a client that implements the +// ListNotebookExecutions operation. +type ListNotebookExecutionsAPIClient interface { + ListNotebookExecutions(context.Context, *ListNotebookExecutionsInput, ...func(*Options)) (*ListNotebookExecutionsOutput, error) +} + +var _ ListNotebookExecutionsAPIClient = (*Client)(nil) + +// ListNotebookExecutionsPaginatorOptions is the paginator options for +// ListNotebookExecutions +type ListNotebookExecutionsPaginatorOptions struct { + // 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 +} + +// ListNotebookExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListNotebookExecutions +type ListNotebookExecutionsPaginator struct { + options ListNotebookExecutionsPaginatorOptions + client ListNotebookExecutionsAPIClient + params *ListNotebookExecutionsInput + nextToken *string + firstPage bool +} + +// NewListNotebookExecutionsPaginator returns a new ListNotebookExecutionsPaginator +func NewListNotebookExecutionsPaginator(client ListNotebookExecutionsAPIClient, params *ListNotebookExecutionsInput, optFns ...func(*ListNotebookExecutionsPaginatorOptions)) *ListNotebookExecutionsPaginator { + options := ListNotebookExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookExecutionsInput{} + } + + return &ListNotebookExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNotebookExecutions page. +func (p *ListNotebookExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListNotebookExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListSecurityConfigurations.go b/service/emr/api_op_ListSecurityConfigurations.go index 9501df27556..c0953afee7e 100644 --- a/service/emr/api_op_ListSecurityConfigurations.go +++ b/service/emr/api_op_ListSecurityConfigurations.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -107,6 +108,82 @@ func addOperationListSecurityConfigurationsMiddlewares(stack *middleware.Stack, return nil } +// ListSecurityConfigurationsAPIClient is a client that implements the +// ListSecurityConfigurations operation. +type ListSecurityConfigurationsAPIClient interface { + ListSecurityConfigurations(context.Context, *ListSecurityConfigurationsInput, ...func(*Options)) (*ListSecurityConfigurationsOutput, error) +} + +var _ ListSecurityConfigurationsAPIClient = (*Client)(nil) + +// ListSecurityConfigurationsPaginatorOptions is the paginator options for +// ListSecurityConfigurations +type ListSecurityConfigurationsPaginatorOptions struct { + // 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 +} + +// ListSecurityConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListSecurityConfigurations +type ListSecurityConfigurationsPaginator struct { + options ListSecurityConfigurationsPaginatorOptions + client ListSecurityConfigurationsAPIClient + params *ListSecurityConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListSecurityConfigurationsPaginator returns a new +// ListSecurityConfigurationsPaginator +func NewListSecurityConfigurationsPaginator(client ListSecurityConfigurationsAPIClient, params *ListSecurityConfigurationsInput, optFns ...func(*ListSecurityConfigurationsPaginatorOptions)) *ListSecurityConfigurationsPaginator { + options := ListSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityConfigurationsInput{} + } + + return &ListSecurityConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecurityConfigurations page. +func (p *ListSecurityConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListSecurityConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/api_op_ListSteps.go b/service/emr/api_op_ListSteps.go index 43549e40001..5674b90fb3e 100644 --- a/service/emr/api_op_ListSteps.go +++ b/service/emr/api_op_ListSteps.go @@ -4,6 +4,7 @@ package emr 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/emr/types" @@ -123,6 +124,79 @@ func addOperationListStepsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListStepsAPIClient is a client that implements the ListSteps operation. +type ListStepsAPIClient interface { + ListSteps(context.Context, *ListStepsInput, ...func(*Options)) (*ListStepsOutput, error) +} + +var _ ListStepsAPIClient = (*Client)(nil) + +// ListStepsPaginatorOptions is the paginator options for ListSteps +type ListStepsPaginatorOptions struct { + // 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 +} + +// ListStepsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/emr.ListSteps +type ListStepsPaginator struct { + options ListStepsPaginatorOptions + client ListStepsAPIClient + params *ListStepsInput + nextToken *string + firstPage bool +} + +// NewListStepsPaginator returns a new ListStepsPaginator +func NewListStepsPaginator(client ListStepsAPIClient, params *ListStepsInput, optFns ...func(*ListStepsPaginatorOptions)) *ListStepsPaginator { + options := ListStepsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStepsInput{} + } + + return &ListStepsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStepsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSteps page. +func (p *ListStepsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStepsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + result, err := p.client.ListSteps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSteps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/emr/endpoints.go b/service/emr/endpoints.go index c97ed0850ca..99e8915e62b 100644 --- a/service/emr/endpoints.go +++ b/service/emr/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/eventbridge/endpoints.go b/service/eventbridge/endpoints.go index 3aa81d8d8eb..9ef6eea1b6a 100644 --- a/service/eventbridge/endpoints.go +++ b/service/eventbridge/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/firehose/endpoints.go b/service/firehose/endpoints.go index 1219418999d..c82441980d6 100644 --- a/service/firehose/endpoints.go +++ b/service/firehose/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/fms/api_op_ListComplianceStatus.go b/service/fms/api_op_ListComplianceStatus.go index fede24612cf..133b329b771 100644 --- a/service/fms/api_op_ListComplianceStatus.go +++ b/service/fms/api_op_ListComplianceStatus.go @@ -4,6 +4,7 @@ package fms 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/fms/types" @@ -128,6 +129,92 @@ func addOperationListComplianceStatusMiddlewares(stack *middleware.Stack, option return nil } +// ListComplianceStatusAPIClient is a client that implements the +// ListComplianceStatus operation. +type ListComplianceStatusAPIClient interface { + ListComplianceStatus(context.Context, *ListComplianceStatusInput, ...func(*Options)) (*ListComplianceStatusOutput, error) +} + +var _ ListComplianceStatusAPIClient = (*Client)(nil) + +// ListComplianceStatusPaginatorOptions is the paginator options for +// ListComplianceStatus +type ListComplianceStatusPaginatorOptions struct { + // Specifies the number of PolicyComplianceStatus objects that you want AWS + // Firewall Manager to return for this request. If you have more + // PolicyComplianceStatus objects than the number that you specify for MaxResults, + // the response includes a NextToken value that you can use to get another batch of + // PolicyComplianceStatus objects. + 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 +} + +// ListComplianceStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListComplianceStatus +type ListComplianceStatusPaginator struct { + options ListComplianceStatusPaginatorOptions + client ListComplianceStatusAPIClient + params *ListComplianceStatusInput + nextToken *string + firstPage bool +} + +// NewListComplianceStatusPaginator returns a new ListComplianceStatusPaginator +func NewListComplianceStatusPaginator(client ListComplianceStatusAPIClient, params *ListComplianceStatusInput, optFns ...func(*ListComplianceStatusPaginatorOptions)) *ListComplianceStatusPaginator { + options := ListComplianceStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceStatusInput{} + } + + return &ListComplianceStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComplianceStatus page. +func (p *ListComplianceStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListComplianceStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/api_op_ListMemberAccounts.go b/service/fms/api_op_ListMemberAccounts.go index 71c418c9ae4..85147093725 100644 --- a/service/fms/api_op_ListMemberAccounts.go +++ b/service/fms/api_op_ListMemberAccounts.go @@ -4,6 +4,7 @@ package fms 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/awslabs/smithy-go/middleware" @@ -117,6 +118,91 @@ func addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options return nil } +// ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts +// operation. +type ListMemberAccountsAPIClient interface { + ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) +} + +var _ ListMemberAccountsAPIClient = (*Client)(nil) + +// ListMemberAccountsPaginatorOptions is the paginator options for +// ListMemberAccounts +type ListMemberAccountsPaginatorOptions struct { + // Specifies the number of member account IDs that you want AWS Firewall Manager to + // return for this request. If you have more IDs than the number that you specify + // for MaxResults, the response includes a NextToken value that you can use to get + // another batch of member account IDs. + 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 +} + +// ListMemberAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListMemberAccounts +type ListMemberAccountsPaginator struct { + options ListMemberAccountsPaginatorOptions + client ListMemberAccountsAPIClient + params *ListMemberAccountsInput + nextToken *string + firstPage bool +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMemberAccountsInput{} + } + + return &ListMemberAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMemberAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMemberAccounts page. +func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMemberAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/api_op_ListPolicies.go b/service/fms/api_op_ListPolicies.go index f240100ec76..f269ee0090f 100644 --- a/service/fms/api_op_ListPolicies.go +++ b/service/fms/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package fms 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/fms/types" @@ -116,6 +117,89 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // Specifies the number of PolicySummary objects that you want AWS Firewall Manager + // to return for this request. If you have more PolicySummary objects than the + // number that you specify for MaxResults, the response includes a NextToken value + // that you can use to get another batch of PolicySummary objects. + 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 +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fms.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fms/endpoints.go b/service/fms/endpoints.go index 1d662a464fe..9d6e83164df 100644 --- a/service/fms/endpoints.go +++ b/service/fms/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/forecast/api_op_ListDatasetGroups.go b/service/forecast/api_op_ListDatasetGroups.go index 17a418cc570..02f8f60ac52 100644 --- a/service/forecast/api_op_ListDatasetGroups.go +++ b/service/forecast/api_op_ListDatasetGroups.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -112,6 +113,87 @@ func addOperationListDatasetGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// ListDatasetGroupsAPIClient is a client that implements the ListDatasetGroups +// operation. +type ListDatasetGroupsAPIClient interface { + ListDatasetGroups(context.Context, *ListDatasetGroupsInput, ...func(*Options)) (*ListDatasetGroupsOutput, error) +} + +var _ ListDatasetGroupsAPIClient = (*Client)(nil) + +// ListDatasetGroupsPaginatorOptions is the paginator options for ListDatasetGroups +type ListDatasetGroupsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListDatasetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasetGroups +type ListDatasetGroupsPaginator struct { + options ListDatasetGroupsPaginatorOptions + client ListDatasetGroupsAPIClient + params *ListDatasetGroupsInput + nextToken *string + firstPage bool +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetGroupsInput{} + } + + return &ListDatasetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasetGroups page. +func (p *ListDatasetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListDatasetImportJobs.go b/service/forecast/api_op_ListDatasetImportJobs.go index b0cd8fe663e..d18d5a0d419 100644 --- a/service/forecast/api_op_ListDatasetImportJobs.go +++ b/service/forecast/api_op_ListDatasetImportJobs.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -136,6 +137,88 @@ func addOperationListDatasetImportJobsMiddlewares(stack *middleware.Stack, optio return nil } +// ListDatasetImportJobsAPIClient is a client that implements the +// ListDatasetImportJobs operation. +type ListDatasetImportJobsAPIClient interface { + ListDatasetImportJobs(context.Context, *ListDatasetImportJobsInput, ...func(*Options)) (*ListDatasetImportJobsOutput, error) +} + +var _ ListDatasetImportJobsAPIClient = (*Client)(nil) + +// ListDatasetImportJobsPaginatorOptions is the paginator options for +// ListDatasetImportJobs +type ListDatasetImportJobsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListDatasetImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasetImportJobs +type ListDatasetImportJobsPaginator struct { + options ListDatasetImportJobsPaginatorOptions + client ListDatasetImportJobsAPIClient + params *ListDatasetImportJobsInput + nextToken *string + firstPage bool +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetImportJobsInput{} + } + + return &ListDatasetImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetImportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasetImportJobs page. +func (p *ListDatasetImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasetImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListDatasets.go b/service/forecast/api_op_ListDatasets.go index 95c701b0f30..27c47b7d048 100644 --- a/service/forecast/api_op_ListDatasets.go +++ b/service/forecast/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -111,6 +112,86 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListForecastExportJobs.go b/service/forecast/api_op_ListForecastExportJobs.go index 2b108d9b9c2..d7514cbcd47 100644 --- a/service/forecast/api_op_ListForecastExportJobs.go +++ b/service/forecast/api_op_ListForecastExportJobs.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -137,6 +138,88 @@ func addOperationListForecastExportJobsMiddlewares(stack *middleware.Stack, opti return nil } +// ListForecastExportJobsAPIClient is a client that implements the +// ListForecastExportJobs operation. +type ListForecastExportJobsAPIClient interface { + ListForecastExportJobs(context.Context, *ListForecastExportJobsInput, ...func(*Options)) (*ListForecastExportJobsOutput, error) +} + +var _ ListForecastExportJobsAPIClient = (*Client)(nil) + +// ListForecastExportJobsPaginatorOptions is the paginator options for +// ListForecastExportJobs +type ListForecastExportJobsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListForecastExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListForecastExportJobs +type ListForecastExportJobsPaginator struct { + options ListForecastExportJobsPaginatorOptions + client ListForecastExportJobsAPIClient + params *ListForecastExportJobsInput + nextToken *string + firstPage bool +} + +// NewListForecastExportJobsPaginator returns a new ListForecastExportJobsPaginator +func NewListForecastExportJobsPaginator(client ListForecastExportJobsAPIClient, params *ListForecastExportJobsInput, optFns ...func(*ListForecastExportJobsPaginatorOptions)) *ListForecastExportJobsPaginator { + options := ListForecastExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListForecastExportJobsInput{} + } + + return &ListForecastExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListForecastExportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListForecastExportJobs page. +func (p *ListForecastExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListForecastExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListForecastExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListForecastExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListForecasts.go b/service/forecast/api_op_ListForecasts.go index 6eab765186d..39144640e8b 100644 --- a/service/forecast/api_op_ListForecasts.go +++ b/service/forecast/api_op_ListForecasts.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -136,6 +137,86 @@ func addOperationListForecastsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListForecastsAPIClient is a client that implements the ListForecasts operation. +type ListForecastsAPIClient interface { + ListForecasts(context.Context, *ListForecastsInput, ...func(*Options)) (*ListForecastsOutput, error) +} + +var _ ListForecastsAPIClient = (*Client)(nil) + +// ListForecastsPaginatorOptions is the paginator options for ListForecasts +type ListForecastsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListForecastsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListForecasts +type ListForecastsPaginator struct { + options ListForecastsPaginatorOptions + client ListForecastsAPIClient + params *ListForecastsInput + nextToken *string + firstPage bool +} + +// NewListForecastsPaginator returns a new ListForecastsPaginator +func NewListForecastsPaginator(client ListForecastsAPIClient, params *ListForecastsInput, optFns ...func(*ListForecastsPaginatorOptions)) *ListForecastsPaginator { + options := ListForecastsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListForecastsInput{} + } + + return &ListForecastsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListForecastsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListForecasts page. +func (p *ListForecastsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListForecastsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListForecasts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListForecasts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/api_op_ListPredictors.go b/service/forecast/api_op_ListPredictors.go index bb4e6c9276e..7c6fabe9005 100644 --- a/service/forecast/api_op_ListPredictors.go +++ b/service/forecast/api_op_ListPredictors.go @@ -4,6 +4,7 @@ package forecast 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/forecast/types" @@ -136,6 +137,87 @@ func addOperationListPredictorsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListPredictorsAPIClient is a client that implements the ListPredictors +// operation. +type ListPredictorsAPIClient interface { + ListPredictors(context.Context, *ListPredictorsInput, ...func(*Options)) (*ListPredictorsOutput, error) +} + +var _ ListPredictorsAPIClient = (*Client)(nil) + +// ListPredictorsPaginatorOptions is the paginator options for ListPredictors +type ListPredictorsPaginatorOptions struct { + // The number of items to return in the response. + 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 +} + +// ListPredictorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/forecast.ListPredictors +type ListPredictorsPaginator struct { + options ListPredictorsPaginatorOptions + client ListPredictorsAPIClient + params *ListPredictorsInput + nextToken *string + firstPage bool +} + +// NewListPredictorsPaginator returns a new ListPredictorsPaginator +func NewListPredictorsPaginator(client ListPredictorsAPIClient, params *ListPredictorsInput, optFns ...func(*ListPredictorsPaginatorOptions)) *ListPredictorsPaginator { + options := ListPredictorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPredictorsInput{} + } + + return &ListPredictorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPredictorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPredictors page. +func (p *ListPredictorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPredictorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPredictors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPredictors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/forecast/endpoints.go b/service/forecast/endpoints.go index 24ea2997498..c8dc12fabf9 100644 --- a/service/forecast/endpoints.go +++ b/service/forecast/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/forecastquery/endpoints.go b/service/forecastquery/endpoints.go index e9aaa130c0b..dae2f88a743 100644 --- a/service/forecastquery/endpoints.go +++ b/service/forecastquery/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/frauddetector/api_op_DescribeModelVersions.go b/service/frauddetector/api_op_DescribeModelVersions.go index 0f8a1918efb..b67d915d14f 100644 --- a/service/frauddetector/api_op_DescribeModelVersions.go +++ b/service/frauddetector/api_op_DescribeModelVersions.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -116,6 +117,88 @@ func addOperationDescribeModelVersionsMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeModelVersionsAPIClient is a client that implements the +// DescribeModelVersions operation. +type DescribeModelVersionsAPIClient interface { + DescribeModelVersions(context.Context, *DescribeModelVersionsInput, ...func(*Options)) (*DescribeModelVersionsOutput, error) +} + +var _ DescribeModelVersionsAPIClient = (*Client)(nil) + +// DescribeModelVersionsPaginatorOptions is the paginator options for +// DescribeModelVersions +type DescribeModelVersionsPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeModelVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.DescribeModelVersions +type DescribeModelVersionsPaginator struct { + options DescribeModelVersionsPaginatorOptions + client DescribeModelVersionsAPIClient + params *DescribeModelVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeModelVersionsPaginator returns a new DescribeModelVersionsPaginator +func NewDescribeModelVersionsPaginator(client DescribeModelVersionsAPIClient, params *DescribeModelVersionsInput, optFns ...func(*DescribeModelVersionsPaginatorOptions)) *DescribeModelVersionsPaginator { + options := DescribeModelVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeModelVersionsInput{} + } + + return &DescribeModelVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeModelVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeModelVersions page. +func (p *DescribeModelVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeModelVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeModelVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeModelVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetDetectors.go b/service/frauddetector/api_op_GetDetectors.go index 1afc18fe7ca..b4bda393f50 100644 --- a/service/frauddetector/api_op_GetDetectors.go +++ b/service/frauddetector/api_op_GetDetectors.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,86 @@ func addOperationGetDetectorsMiddlewares(stack *middleware.Stack, options Option return nil } +// GetDetectorsAPIClient is a client that implements the GetDetectors operation. +type GetDetectorsAPIClient interface { + GetDetectors(context.Context, *GetDetectorsInput, ...func(*Options)) (*GetDetectorsOutput, error) +} + +var _ GetDetectorsAPIClient = (*Client)(nil) + +// GetDetectorsPaginatorOptions is the paginator options for GetDetectors +type GetDetectorsPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetDetectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetDetectors +type GetDetectorsPaginator struct { + options GetDetectorsPaginatorOptions + client GetDetectorsAPIClient + params *GetDetectorsInput + nextToken *string + firstPage bool +} + +// NewGetDetectorsPaginator returns a new GetDetectorsPaginator +func NewGetDetectorsPaginator(client GetDetectorsAPIClient, params *GetDetectorsInput, optFns ...func(*GetDetectorsPaginatorOptions)) *GetDetectorsPaginator { + options := GetDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDetectorsInput{} + } + + return &GetDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDetectorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDetectors page. +func (p *GetDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDetectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetDetectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDetectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetEntityTypes.go b/service/frauddetector/api_op_GetEntityTypes.go index 204aef0c65a..694407f3c0c 100644 --- a/service/frauddetector/api_op_GetEntityTypes.go +++ b/service/frauddetector/api_op_GetEntityTypes.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,87 @@ func addOperationGetEntityTypesMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetEntityTypesAPIClient is a client that implements the GetEntityTypes +// operation. +type GetEntityTypesAPIClient interface { + GetEntityTypes(context.Context, *GetEntityTypesInput, ...func(*Options)) (*GetEntityTypesOutput, error) +} + +var _ GetEntityTypesAPIClient = (*Client)(nil) + +// GetEntityTypesPaginatorOptions is the paginator options for GetEntityTypes +type GetEntityTypesPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetEntityTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetEntityTypes +type GetEntityTypesPaginator struct { + options GetEntityTypesPaginatorOptions + client GetEntityTypesAPIClient + params *GetEntityTypesInput + nextToken *string + firstPage bool +} + +// NewGetEntityTypesPaginator returns a new GetEntityTypesPaginator +func NewGetEntityTypesPaginator(client GetEntityTypesAPIClient, params *GetEntityTypesInput, optFns ...func(*GetEntityTypesPaginatorOptions)) *GetEntityTypesPaginator { + options := GetEntityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEntityTypesInput{} + } + + return &GetEntityTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEntityTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetEntityTypes page. +func (p *GetEntityTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEntityTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetEntityTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEntityTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetEventTypes.go b/service/frauddetector/api_op_GetEventTypes.go index ab719bd0ca1..bd48756d033 100644 --- a/service/frauddetector/api_op_GetEventTypes.go +++ b/service/frauddetector/api_op_GetEventTypes.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,86 @@ func addOperationGetEventTypesMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetEventTypesAPIClient is a client that implements the GetEventTypes operation. +type GetEventTypesAPIClient interface { + GetEventTypes(context.Context, *GetEventTypesInput, ...func(*Options)) (*GetEventTypesOutput, error) +} + +var _ GetEventTypesAPIClient = (*Client)(nil) + +// GetEventTypesPaginatorOptions is the paginator options for GetEventTypes +type GetEventTypesPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetEventTypes +type GetEventTypesPaginator struct { + options GetEventTypesPaginatorOptions + client GetEventTypesAPIClient + params *GetEventTypesInput + nextToken *string + firstPage bool +} + +// NewGetEventTypesPaginator returns a new GetEventTypesPaginator +func NewGetEventTypesPaginator(client GetEventTypesAPIClient, params *GetEventTypesInput, optFns ...func(*GetEventTypesPaginatorOptions)) *GetEventTypesPaginator { + options := GetEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEventTypesInput{} + } + + return &GetEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEventTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetEventTypes page. +func (p *GetEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetExternalModels.go b/service/frauddetector/api_op_GetExternalModels.go index e267abeea0e..5c401fd4d2c 100644 --- a/service/frauddetector/api_op_GetExternalModels.go +++ b/service/frauddetector/api_op_GetExternalModels.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,87 @@ func addOperationGetExternalModelsMiddlewares(stack *middleware.Stack, options O return nil } +// GetExternalModelsAPIClient is a client that implements the GetExternalModels +// operation. +type GetExternalModelsAPIClient interface { + GetExternalModels(context.Context, *GetExternalModelsInput, ...func(*Options)) (*GetExternalModelsOutput, error) +} + +var _ GetExternalModelsAPIClient = (*Client)(nil) + +// GetExternalModelsPaginatorOptions is the paginator options for GetExternalModels +type GetExternalModelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetExternalModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetExternalModels +type GetExternalModelsPaginator struct { + options GetExternalModelsPaginatorOptions + client GetExternalModelsAPIClient + params *GetExternalModelsInput + nextToken *string + firstPage bool +} + +// NewGetExternalModelsPaginator returns a new GetExternalModelsPaginator +func NewGetExternalModelsPaginator(client GetExternalModelsAPIClient, params *GetExternalModelsInput, optFns ...func(*GetExternalModelsPaginatorOptions)) *GetExternalModelsPaginator { + options := GetExternalModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExternalModelsInput{} + } + + return &GetExternalModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExternalModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetExternalModels page. +func (p *GetExternalModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExternalModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetExternalModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExternalModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetLabels.go b/service/frauddetector/api_op_GetLabels.go index 946a761e4f2..5b8d24428a7 100644 --- a/service/frauddetector/api_op_GetLabels.go +++ b/service/frauddetector/api_op_GetLabels.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,86 @@ func addOperationGetLabelsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetLabelsAPIClient is a client that implements the GetLabels operation. +type GetLabelsAPIClient interface { + GetLabels(context.Context, *GetLabelsInput, ...func(*Options)) (*GetLabelsOutput, error) +} + +var _ GetLabelsAPIClient = (*Client)(nil) + +// GetLabelsPaginatorOptions is the paginator options for GetLabels +type GetLabelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetLabelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetLabels +type GetLabelsPaginator struct { + options GetLabelsPaginatorOptions + client GetLabelsAPIClient + params *GetLabelsInput + nextToken *string + firstPage bool +} + +// NewGetLabelsPaginator returns a new GetLabelsPaginator +func NewGetLabelsPaginator(client GetLabelsAPIClient, params *GetLabelsInput, optFns ...func(*GetLabelsPaginatorOptions)) *GetLabelsPaginator { + options := GetLabelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLabelsInput{} + } + + return &GetLabelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLabelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLabels page. +func (p *GetLabelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLabelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetLabels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLabels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetModels.go b/service/frauddetector/api_op_GetModels.go index 25cd7508f41..b3bead5277b 100644 --- a/service/frauddetector/api_op_GetModels.go +++ b/service/frauddetector/api_op_GetModels.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -118,6 +119,86 @@ func addOperationGetModelsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetModelsAPIClient is a client that implements the GetModels operation. +type GetModelsAPIClient interface { + GetModels(context.Context, *GetModelsInput, ...func(*Options)) (*GetModelsOutput, error) +} + +var _ GetModelsAPIClient = (*Client)(nil) + +// GetModelsPaginatorOptions is the paginator options for GetModels +type GetModelsPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetModels +type GetModelsPaginator struct { + options GetModelsPaginatorOptions + client GetModelsAPIClient + params *GetModelsInput + nextToken *string + firstPage bool +} + +// NewGetModelsPaginator returns a new GetModelsPaginator +func NewGetModelsPaginator(client GetModelsAPIClient, params *GetModelsInput, optFns ...func(*GetModelsPaginatorOptions)) *GetModelsPaginator { + options := GetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetModelsInput{} + } + + return &GetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetModels page. +func (p *GetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetOutcomes.go b/service/frauddetector/api_op_GetOutcomes.go index 3223bde48e4..fd59da23f22 100644 --- a/service/frauddetector/api_op_GetOutcomes.go +++ b/service/frauddetector/api_op_GetOutcomes.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -112,6 +113,86 @@ func addOperationGetOutcomesMiddlewares(stack *middleware.Stack, options Options return nil } +// GetOutcomesAPIClient is a client that implements the GetOutcomes operation. +type GetOutcomesAPIClient interface { + GetOutcomes(context.Context, *GetOutcomesInput, ...func(*Options)) (*GetOutcomesOutput, error) +} + +var _ GetOutcomesAPIClient = (*Client)(nil) + +// GetOutcomesPaginatorOptions is the paginator options for GetOutcomes +type GetOutcomesPaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// GetOutcomesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetOutcomes +type GetOutcomesPaginator struct { + options GetOutcomesPaginatorOptions + client GetOutcomesAPIClient + params *GetOutcomesInput + nextToken *string + firstPage bool +} + +// NewGetOutcomesPaginator returns a new GetOutcomesPaginator +func NewGetOutcomesPaginator(client GetOutcomesAPIClient, params *GetOutcomesInput, optFns ...func(*GetOutcomesPaginatorOptions)) *GetOutcomesPaginator { + options := GetOutcomesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOutcomesInput{} + } + + return &GetOutcomesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOutcomesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetOutcomes page. +func (p *GetOutcomesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOutcomesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetOutcomes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOutcomes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetRules.go b/service/frauddetector/api_op_GetRules.go index 2a22386d5fa..0198a2771ca 100644 --- a/service/frauddetector/api_op_GetRules.go +++ b/service/frauddetector/api_op_GetRules.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -126,6 +127,86 @@ func addOperationGetRulesMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// GetRulesAPIClient is a client that implements the GetRules operation. +type GetRulesAPIClient interface { + GetRules(context.Context, *GetRulesInput, ...func(*Options)) (*GetRulesOutput, error) +} + +var _ GetRulesAPIClient = (*Client)(nil) + +// GetRulesPaginatorOptions is the paginator options for GetRules +type GetRulesPaginatorOptions struct { + // The maximum number of rules to return for the request. + 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 +} + +// GetRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetRules +type GetRulesPaginator struct { + options GetRulesPaginatorOptions + client GetRulesAPIClient + params *GetRulesInput + nextToken *string + firstPage bool +} + +// NewGetRulesPaginator returns a new GetRulesPaginator +func NewGetRulesPaginator(client GetRulesAPIClient, params *GetRulesInput, optFns ...func(*GetRulesPaginatorOptions)) *GetRulesPaginator { + options := GetRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetRulesInput{} + } + + return &GetRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetRules page. +func (p *GetRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_GetVariables.go b/service/frauddetector/api_op_GetVariables.go index 7bf84eb26d2..cfbad4872f4 100644 --- a/service/frauddetector/api_op_GetVariables.go +++ b/service/frauddetector/api_op_GetVariables.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -113,6 +114,86 @@ func addOperationGetVariablesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetVariablesAPIClient is a client that implements the GetVariables operation. +type GetVariablesAPIClient interface { + GetVariables(context.Context, *GetVariablesInput, ...func(*Options)) (*GetVariablesOutput, error) +} + +var _ GetVariablesAPIClient = (*Client)(nil) + +// GetVariablesPaginatorOptions is the paginator options for GetVariables +type GetVariablesPaginatorOptions struct { + // The max size per page determined for the get variable request. + 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 +} + +// GetVariablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.GetVariables +type GetVariablesPaginator struct { + options GetVariablesPaginatorOptions + client GetVariablesAPIClient + params *GetVariablesInput + nextToken *string + firstPage bool +} + +// NewGetVariablesPaginator returns a new GetVariablesPaginator +func NewGetVariablesPaginator(client GetVariablesAPIClient, params *GetVariablesInput, optFns ...func(*GetVariablesPaginatorOptions)) *GetVariablesPaginator { + options := GetVariablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetVariablesInput{} + } + + return &GetVariablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetVariablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetVariables page. +func (p *GetVariablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetVariablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetVariables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetVariables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/api_op_ListTagsForResource.go b/service/frauddetector/api_op_ListTagsForResource.go index 66b8e6a5825..2f345369084 100644 --- a/service/frauddetector/api_op_ListTagsForResource.go +++ b/service/frauddetector/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package frauddetector 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/frauddetector/types" @@ -115,6 +116,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of objects to return for the request. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/frauddetector.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/frauddetector/endpoints.go b/service/frauddetector/endpoints.go index 86125e3263d..31c5d7f5806 100644 --- a/service/frauddetector/endpoints.go +++ b/service/frauddetector/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/fsx/api_op_DescribeBackups.go b/service/fsx/api_op_DescribeBackups.go index 9242b15f25f..a244d1f1a64 100644 --- a/service/fsx/api_op_DescribeBackups.go +++ b/service/fsx/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package fsx 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/fsx/types" @@ -140,6 +141,90 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // Maximum number of backups to return in the response (integer). This parameter + // value must be greater than 0. The number of items that Amazon FSx returns is the + // minimum of the MaxResults parameter specified in the request and the service's + // internal maximum number of items per page. + 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 +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/api_op_DescribeDataRepositoryTasks.go b/service/fsx/api_op_DescribeDataRepositoryTasks.go index 8119d4f57cb..ac3c5fc0f62 100644 --- a/service/fsx/api_op_DescribeDataRepositoryTasks.go +++ b/service/fsx/api_op_DescribeDataRepositoryTasks.go @@ -4,6 +4,7 @@ package fsx 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/fsx/types" @@ -128,6 +129,90 @@ func addOperationDescribeDataRepositoryTasksMiddlewares(stack *middleware.Stack, return nil } +// DescribeDataRepositoryTasksAPIClient is a client that implements the +// DescribeDataRepositoryTasks operation. +type DescribeDataRepositoryTasksAPIClient interface { + DescribeDataRepositoryTasks(context.Context, *DescribeDataRepositoryTasksInput, ...func(*Options)) (*DescribeDataRepositoryTasksOutput, error) +} + +var _ DescribeDataRepositoryTasksAPIClient = (*Client)(nil) + +// DescribeDataRepositoryTasksPaginatorOptions is the paginator options for +// DescribeDataRepositoryTasks +type DescribeDataRepositoryTasksPaginatorOptions struct { + // The maximum number of resources to return in the response. This value must be an + // integer greater than zero. + 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 +} + +// DescribeDataRepositoryTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeDataRepositoryTasks +type DescribeDataRepositoryTasksPaginator struct { + options DescribeDataRepositoryTasksPaginatorOptions + client DescribeDataRepositoryTasksAPIClient + params *DescribeDataRepositoryTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeDataRepositoryTasksPaginator returns a new +// DescribeDataRepositoryTasksPaginator +func NewDescribeDataRepositoryTasksPaginator(client DescribeDataRepositoryTasksAPIClient, params *DescribeDataRepositoryTasksInput, optFns ...func(*DescribeDataRepositoryTasksPaginatorOptions)) *DescribeDataRepositoryTasksPaginator { + options := DescribeDataRepositoryTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDataRepositoryTasksInput{} + } + + return &DescribeDataRepositoryTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDataRepositoryTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDataRepositoryTasks page. +func (p *DescribeDataRepositoryTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDataRepositoryTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeDataRepositoryTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDataRepositoryTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/api_op_DescribeFileSystems.go b/service/fsx/api_op_DescribeFileSystems.go index 0cdc850e8bb..0591717bd5e 100644 --- a/service/fsx/api_op_DescribeFileSystems.go +++ b/service/fsx/api_op_DescribeFileSystems.go @@ -4,6 +4,7 @@ package fsx 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/fsx/types" @@ -136,6 +137,91 @@ func addOperationDescribeFileSystemsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeFileSystemsAPIClient is a client that implements the DescribeFileSystems +// operation. +type DescribeFileSystemsAPIClient interface { + DescribeFileSystems(context.Context, *DescribeFileSystemsInput, ...func(*Options)) (*DescribeFileSystemsOutput, error) +} + +var _ DescribeFileSystemsAPIClient = (*Client)(nil) + +// DescribeFileSystemsPaginatorOptions is the paginator options for +// DescribeFileSystems +type DescribeFileSystemsPaginatorOptions struct { + // Maximum number of file systems to return in the response (integer). This + // parameter value must be greater than 0. The number of items that Amazon FSx + // returns is the minimum of the MaxResults parameter specified in the request and + // the service's internal maximum number of items per page. + 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 +} + +// DescribeFileSystemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/fsx.DescribeFileSystems +type DescribeFileSystemsPaginator struct { + options DescribeFileSystemsPaginatorOptions + client DescribeFileSystemsAPIClient + params *DescribeFileSystemsInput + nextToken *string + firstPage bool +} + +// NewDescribeFileSystemsPaginator returns a new DescribeFileSystemsPaginator +func NewDescribeFileSystemsPaginator(client DescribeFileSystemsAPIClient, params *DescribeFileSystemsInput, optFns ...func(*DescribeFileSystemsPaginatorOptions)) *DescribeFileSystemsPaginator { + options := DescribeFileSystemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFileSystemsInput{} + } + + return &DescribeFileSystemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFileSystemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFileSystems page. +func (p *DescribeFileSystemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFileSystemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeFileSystems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFileSystems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/fsx/endpoints.go b/service/fsx/endpoints.go index 24b48c83741..2556cf3a03c 100644 --- a/service/fsx/endpoints.go +++ b/service/fsx/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/gamelift/api_op_DescribeFleetAttributes.go b/service/gamelift/api_op_DescribeFleetAttributes.go index b6f3a4d8f59..d425e3a835a 100644 --- a/service/gamelift/api_op_DescribeFleetAttributes.go +++ b/service/gamelift/api_op_DescribeFleetAttributes.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -163,6 +164,91 @@ func addOperationDescribeFleetAttributesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeFleetAttributesAPIClient is a client that implements the +// DescribeFleetAttributes operation. +type DescribeFleetAttributesAPIClient interface { + DescribeFleetAttributes(context.Context, *DescribeFleetAttributesInput, ...func(*Options)) (*DescribeFleetAttributesOutput, error) +} + +var _ DescribeFleetAttributesAPIClient = (*Client)(nil) + +// DescribeFleetAttributesPaginatorOptions is the paginator options for +// DescribeFleetAttributes +type DescribeFleetAttributesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + 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 +} + +// DescribeFleetAttributesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetAttributes +type DescribeFleetAttributesPaginator struct { + options DescribeFleetAttributesPaginatorOptions + client DescribeFleetAttributesAPIClient + params *DescribeFleetAttributesInput + nextToken *string + firstPage bool +} + +// NewDescribeFleetAttributesPaginator returns a new +// DescribeFleetAttributesPaginator +func NewDescribeFleetAttributesPaginator(client DescribeFleetAttributesAPIClient, params *DescribeFleetAttributesInput, optFns ...func(*DescribeFleetAttributesPaginatorOptions)) *DescribeFleetAttributesPaginator { + options := DescribeFleetAttributesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetAttributesInput{} + } + + return &DescribeFleetAttributesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetAttributesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFleetAttributes page. +func (p *DescribeFleetAttributesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetAttributesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeFleetAttributes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetAttributes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetCapacity.go b/service/gamelift/api_op_DescribeFleetCapacity.go index e7a9992f3da..1fdff7b5e6b 100644 --- a/service/gamelift/api_op_DescribeFleetCapacity.go +++ b/service/gamelift/api_op_DescribeFleetCapacity.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -164,6 +165,90 @@ func addOperationDescribeFleetCapacityMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeFleetCapacityAPIClient is a client that implements the +// DescribeFleetCapacity operation. +type DescribeFleetCapacityAPIClient interface { + DescribeFleetCapacity(context.Context, *DescribeFleetCapacityInput, ...func(*Options)) (*DescribeFleetCapacityOutput, error) +} + +var _ DescribeFleetCapacityAPIClient = (*Client)(nil) + +// DescribeFleetCapacityPaginatorOptions is the paginator options for +// DescribeFleetCapacity +type DescribeFleetCapacityPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + 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 +} + +// DescribeFleetCapacityPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetCapacity +type DescribeFleetCapacityPaginator struct { + options DescribeFleetCapacityPaginatorOptions + client DescribeFleetCapacityAPIClient + params *DescribeFleetCapacityInput + nextToken *string + firstPage bool +} + +// NewDescribeFleetCapacityPaginator returns a new DescribeFleetCapacityPaginator +func NewDescribeFleetCapacityPaginator(client DescribeFleetCapacityAPIClient, params *DescribeFleetCapacityInput, optFns ...func(*DescribeFleetCapacityPaginatorOptions)) *DescribeFleetCapacityPaginator { + options := DescribeFleetCapacityPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetCapacityInput{} + } + + return &DescribeFleetCapacityPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetCapacityPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFleetCapacity page. +func (p *DescribeFleetCapacityPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetCapacityOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeFleetCapacity(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetCapacity(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetEvents.go b/service/gamelift/api_op_DescribeFleetEvents.go index 9608b1c3fc0..66172d6e460 100644 --- a/service/gamelift/api_op_DescribeFleetEvents.go +++ b/service/gamelift/api_op_DescribeFleetEvents.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -168,6 +169,89 @@ func addOperationDescribeFleetEventsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeFleetEventsAPIClient is a client that implements the DescribeFleetEvents +// operation. +type DescribeFleetEventsAPIClient interface { + DescribeFleetEvents(context.Context, *DescribeFleetEventsInput, ...func(*Options)) (*DescribeFleetEventsOutput, error) +} + +var _ DescribeFleetEventsAPIClient = (*Client)(nil) + +// DescribeFleetEventsPaginatorOptions is the paginator options for +// DescribeFleetEvents +type DescribeFleetEventsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeFleetEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetEvents +type DescribeFleetEventsPaginator struct { + options DescribeFleetEventsPaginatorOptions + client DescribeFleetEventsAPIClient + params *DescribeFleetEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeFleetEventsPaginator returns a new DescribeFleetEventsPaginator +func NewDescribeFleetEventsPaginator(client DescribeFleetEventsAPIClient, params *DescribeFleetEventsInput, optFns ...func(*DescribeFleetEventsPaginatorOptions)) *DescribeFleetEventsPaginator { + options := DescribeFleetEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetEventsInput{} + } + + return &DescribeFleetEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFleetEvents page. +func (p *DescribeFleetEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeFleetEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeFleetUtilization.go b/service/gamelift/api_op_DescribeFleetUtilization.go index 1c891c06596..c0c3e173a0a 100644 --- a/service/gamelift/api_op_DescribeFleetUtilization.go +++ b/service/gamelift/api_op_DescribeFleetUtilization.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -165,6 +166,91 @@ func addOperationDescribeFleetUtilizationMiddlewares(stack *middleware.Stack, op return nil } +// DescribeFleetUtilizationAPIClient is a client that implements the +// DescribeFleetUtilization operation. +type DescribeFleetUtilizationAPIClient interface { + DescribeFleetUtilization(context.Context, *DescribeFleetUtilizationInput, ...func(*Options)) (*DescribeFleetUtilizationOutput, error) +} + +var _ DescribeFleetUtilizationAPIClient = (*Client)(nil) + +// DescribeFleetUtilizationPaginatorOptions is the paginator options for +// DescribeFleetUtilization +type DescribeFleetUtilizationPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is ignored when the + // request specifies one or a list of fleet IDs. + 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 +} + +// DescribeFleetUtilizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeFleetUtilization +type DescribeFleetUtilizationPaginator struct { + options DescribeFleetUtilizationPaginatorOptions + client DescribeFleetUtilizationAPIClient + params *DescribeFleetUtilizationInput + nextToken *string + firstPage bool +} + +// NewDescribeFleetUtilizationPaginator returns a new +// DescribeFleetUtilizationPaginator +func NewDescribeFleetUtilizationPaginator(client DescribeFleetUtilizationAPIClient, params *DescribeFleetUtilizationInput, optFns ...func(*DescribeFleetUtilizationPaginatorOptions)) *DescribeFleetUtilizationPaginator { + options := DescribeFleetUtilizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFleetUtilizationInput{} + } + + return &DescribeFleetUtilizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFleetUtilizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFleetUtilization page. +func (p *DescribeFleetUtilizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFleetUtilizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeFleetUtilization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFleetUtilization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameServerInstances.go b/service/gamelift/api_op_DescribeGameServerInstances.go index 7f90159d611..4f6ee8bf547 100644 --- a/service/gamelift/api_op_DescribeGameServerInstances.go +++ b/service/gamelift/api_op_DescribeGameServerInstances.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -157,6 +158,90 @@ func addOperationDescribeGameServerInstancesMiddlewares(stack *middleware.Stack, return nil } +// DescribeGameServerInstancesAPIClient is a client that implements the +// DescribeGameServerInstances operation. +type DescribeGameServerInstancesAPIClient interface { + DescribeGameServerInstances(context.Context, *DescribeGameServerInstancesInput, ...func(*Options)) (*DescribeGameServerInstancesOutput, error) +} + +var _ DescribeGameServerInstancesAPIClient = (*Client)(nil) + +// DescribeGameServerInstancesPaginatorOptions is the paginator options for +// DescribeGameServerInstances +type DescribeGameServerInstancesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + 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 +} + +// DescribeGameServerInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameServerInstances +type DescribeGameServerInstancesPaginator struct { + options DescribeGameServerInstancesPaginatorOptions + client DescribeGameServerInstancesAPIClient + params *DescribeGameServerInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeGameServerInstancesPaginator returns a new +// DescribeGameServerInstancesPaginator +func NewDescribeGameServerInstancesPaginator(client DescribeGameServerInstancesAPIClient, params *DescribeGameServerInstancesInput, optFns ...func(*DescribeGameServerInstancesPaginatorOptions)) *DescribeGameServerInstancesPaginator { + options := DescribeGameServerInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameServerInstancesInput{} + } + + return &DescribeGameServerInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameServerInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGameServerInstances page. +func (p *DescribeGameServerInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameServerInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeGameServerInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameServerInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessionDetails.go b/service/gamelift/api_op_DescribeGameSessionDetails.go index d246b7ebfa5..d554f996873 100644 --- a/service/gamelift/api_op_DescribeGameSessionDetails.go +++ b/service/gamelift/api_op_DescribeGameSessionDetails.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -159,6 +160,90 @@ func addOperationDescribeGameSessionDetailsMiddlewares(stack *middleware.Stack, return nil } +// DescribeGameSessionDetailsAPIClient is a client that implements the +// DescribeGameSessionDetails operation. +type DescribeGameSessionDetailsAPIClient interface { + DescribeGameSessionDetails(context.Context, *DescribeGameSessionDetailsInput, ...func(*Options)) (*DescribeGameSessionDetailsOutput, error) +} + +var _ DescribeGameSessionDetailsAPIClient = (*Client)(nil) + +// DescribeGameSessionDetailsPaginatorOptions is the paginator options for +// DescribeGameSessionDetails +type DescribeGameSessionDetailsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeGameSessionDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessionDetails +type DescribeGameSessionDetailsPaginator struct { + options DescribeGameSessionDetailsPaginatorOptions + client DescribeGameSessionDetailsAPIClient + params *DescribeGameSessionDetailsInput + nextToken *string + firstPage bool +} + +// NewDescribeGameSessionDetailsPaginator returns a new +// DescribeGameSessionDetailsPaginator +func NewDescribeGameSessionDetailsPaginator(client DescribeGameSessionDetailsAPIClient, params *DescribeGameSessionDetailsInput, optFns ...func(*DescribeGameSessionDetailsPaginatorOptions)) *DescribeGameSessionDetailsPaginator { + options := DescribeGameSessionDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionDetailsInput{} + } + + return &DescribeGameSessionDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionDetailsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGameSessionDetails page. +func (p *DescribeGameSessionDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeGameSessionDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessionDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessionQueues.go b/service/gamelift/api_op_DescribeGameSessionQueues.go index 988e04cc628..1a20005ff17 100644 --- a/service/gamelift/api_op_DescribeGameSessionQueues.go +++ b/service/gamelift/api_op_DescribeGameSessionQueues.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -131,6 +132,90 @@ func addOperationDescribeGameSessionQueuesMiddlewares(stack *middleware.Stack, o return nil } +// DescribeGameSessionQueuesAPIClient is a client that implements the +// DescribeGameSessionQueues operation. +type DescribeGameSessionQueuesAPIClient interface { + DescribeGameSessionQueues(context.Context, *DescribeGameSessionQueuesInput, ...func(*Options)) (*DescribeGameSessionQueuesOutput, error) +} + +var _ DescribeGameSessionQueuesAPIClient = (*Client)(nil) + +// DescribeGameSessionQueuesPaginatorOptions is the paginator options for +// DescribeGameSessionQueues +type DescribeGameSessionQueuesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. You can request up to 50 results. + 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 +} + +// DescribeGameSessionQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessionQueues +type DescribeGameSessionQueuesPaginator struct { + options DescribeGameSessionQueuesPaginatorOptions + client DescribeGameSessionQueuesAPIClient + params *DescribeGameSessionQueuesInput + nextToken *string + firstPage bool +} + +// NewDescribeGameSessionQueuesPaginator returns a new +// DescribeGameSessionQueuesPaginator +func NewDescribeGameSessionQueuesPaginator(client DescribeGameSessionQueuesAPIClient, params *DescribeGameSessionQueuesInput, optFns ...func(*DescribeGameSessionQueuesPaginatorOptions)) *DescribeGameSessionQueuesPaginator { + options := DescribeGameSessionQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionQueuesInput{} + } + + return &DescribeGameSessionQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGameSessionQueues page. +func (p *DescribeGameSessionQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeGameSessionQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessionQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeGameSessions.go b/service/gamelift/api_op_DescribeGameSessions.go index 9bfce9a4d7e..72e9ddda4a4 100644 --- a/service/gamelift/api_op_DescribeGameSessions.go +++ b/service/gamelift/api_op_DescribeGameSessions.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -159,6 +160,89 @@ func addOperationDescribeGameSessionsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeGameSessionsAPIClient is a client that implements the +// DescribeGameSessions operation. +type DescribeGameSessionsAPIClient interface { + DescribeGameSessions(context.Context, *DescribeGameSessionsInput, ...func(*Options)) (*DescribeGameSessionsOutput, error) +} + +var _ DescribeGameSessionsAPIClient = (*Client)(nil) + +// DescribeGameSessionsPaginatorOptions is the paginator options for +// DescribeGameSessions +type DescribeGameSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeGameSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeGameSessions +type DescribeGameSessionsPaginator struct { + options DescribeGameSessionsPaginatorOptions + client DescribeGameSessionsAPIClient + params *DescribeGameSessionsInput + nextToken *string + firstPage bool +} + +// NewDescribeGameSessionsPaginator returns a new DescribeGameSessionsPaginator +func NewDescribeGameSessionsPaginator(client DescribeGameSessionsAPIClient, params *DescribeGameSessionsInput, optFns ...func(*DescribeGameSessionsPaginatorOptions)) *DescribeGameSessionsPaginator { + options := DescribeGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGameSessionsInput{} + } + + return &DescribeGameSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGameSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGameSessions page. +func (p *DescribeGameSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGameSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeGameSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGameSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeInstances.go b/service/gamelift/api_op_DescribeInstances.go index 1cd9066b549..53666df7122 100644 --- a/service/gamelift/api_op_DescribeInstances.go +++ b/service/gamelift/api_op_DescribeInstances.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -138,6 +139,88 @@ func addOperationDescribeInstancesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeInstancesAPIClient is a client that implements the DescribeInstances +// operation. +type DescribeInstancesAPIClient interface { + DescribeInstances(context.Context, *DescribeInstancesInput, ...func(*Options)) (*DescribeInstancesOutput, error) +} + +var _ DescribeInstancesAPIClient = (*Client)(nil) + +// DescribeInstancesPaginatorOptions is the paginator options for DescribeInstances +type DescribeInstancesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeInstances +type DescribeInstancesPaginator struct { + options DescribeInstancesPaginatorOptions + client DescribeInstancesAPIClient + params *DescribeInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstancesPaginator returns a new DescribeInstancesPaginator +func NewDescribeInstancesPaginator(client DescribeInstancesAPIClient, params *DescribeInstancesInput, optFns ...func(*DescribeInstancesPaginatorOptions)) *DescribeInstancesPaginator { + options := DescribeInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancesInput{} + } + + return &DescribeInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstances page. +func (p *DescribeInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go index 9a18d1e755e..c8946a54cfc 100644 --- a/service/gamelift/api_op_DescribeMatchmakingConfigurations.go +++ b/service/gamelift/api_op_DescribeMatchmakingConfigurations.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -151,6 +152,90 @@ func addOperationDescribeMatchmakingConfigurationsMiddlewares(stack *middleware. return nil } +// DescribeMatchmakingConfigurationsAPIClient is a client that implements the +// DescribeMatchmakingConfigurations operation. +type DescribeMatchmakingConfigurationsAPIClient interface { + DescribeMatchmakingConfigurations(context.Context, *DescribeMatchmakingConfigurationsInput, ...func(*Options)) (*DescribeMatchmakingConfigurationsOutput, error) +} + +var _ DescribeMatchmakingConfigurationsAPIClient = (*Client)(nil) + +// DescribeMatchmakingConfigurationsPaginatorOptions is the paginator options for +// DescribeMatchmakingConfigurations +type DescribeMatchmakingConfigurationsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. This parameter is limited to 10. + 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 +} + +// DescribeMatchmakingConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeMatchmakingConfigurations +type DescribeMatchmakingConfigurationsPaginator struct { + options DescribeMatchmakingConfigurationsPaginatorOptions + client DescribeMatchmakingConfigurationsAPIClient + params *DescribeMatchmakingConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeMatchmakingConfigurationsPaginator returns a new +// DescribeMatchmakingConfigurationsPaginator +func NewDescribeMatchmakingConfigurationsPaginator(client DescribeMatchmakingConfigurationsAPIClient, params *DescribeMatchmakingConfigurationsInput, optFns ...func(*DescribeMatchmakingConfigurationsPaginatorOptions)) *DescribeMatchmakingConfigurationsPaginator { + options := DescribeMatchmakingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMatchmakingConfigurationsInput{} + } + + return &DescribeMatchmakingConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMatchmakingConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMatchmakingConfigurations page. +func (p *DescribeMatchmakingConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMatchmakingConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeMatchmakingConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMatchmakingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go index 6ef68d29f21..2d87b9f7b29 100644 --- a/service/gamelift/api_op_DescribeMatchmakingRuleSets.go +++ b/service/gamelift/api_op_DescribeMatchmakingRuleSets.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -149,6 +150,90 @@ func addOperationDescribeMatchmakingRuleSetsMiddlewares(stack *middleware.Stack, return nil } +// DescribeMatchmakingRuleSetsAPIClient is a client that implements the +// DescribeMatchmakingRuleSets operation. +type DescribeMatchmakingRuleSetsAPIClient interface { + DescribeMatchmakingRuleSets(context.Context, *DescribeMatchmakingRuleSetsInput, ...func(*Options)) (*DescribeMatchmakingRuleSetsOutput, error) +} + +var _ DescribeMatchmakingRuleSetsAPIClient = (*Client)(nil) + +// DescribeMatchmakingRuleSetsPaginatorOptions is the paginator options for +// DescribeMatchmakingRuleSets +type DescribeMatchmakingRuleSetsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeMatchmakingRuleSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeMatchmakingRuleSets +type DescribeMatchmakingRuleSetsPaginator struct { + options DescribeMatchmakingRuleSetsPaginatorOptions + client DescribeMatchmakingRuleSetsAPIClient + params *DescribeMatchmakingRuleSetsInput + nextToken *string + firstPage bool +} + +// NewDescribeMatchmakingRuleSetsPaginator returns a new +// DescribeMatchmakingRuleSetsPaginator +func NewDescribeMatchmakingRuleSetsPaginator(client DescribeMatchmakingRuleSetsAPIClient, params *DescribeMatchmakingRuleSetsInput, optFns ...func(*DescribeMatchmakingRuleSetsPaginatorOptions)) *DescribeMatchmakingRuleSetsPaginator { + options := DescribeMatchmakingRuleSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMatchmakingRuleSetsInput{} + } + + return &DescribeMatchmakingRuleSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMatchmakingRuleSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMatchmakingRuleSets page. +func (p *DescribeMatchmakingRuleSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMatchmakingRuleSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeMatchmakingRuleSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMatchmakingRuleSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribePlayerSessions.go b/service/gamelift/api_op_DescribePlayerSessions.go index 8304a778cce..c1f1d8ef8a9 100644 --- a/service/gamelift/api_op_DescribePlayerSessions.go +++ b/service/gamelift/api_op_DescribePlayerSessions.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -166,6 +167,90 @@ func addOperationDescribePlayerSessionsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribePlayerSessionsAPIClient is a client that implements the +// DescribePlayerSessions operation. +type DescribePlayerSessionsAPIClient interface { + DescribePlayerSessions(context.Context, *DescribePlayerSessionsInput, ...func(*Options)) (*DescribePlayerSessionsOutput, error) +} + +var _ DescribePlayerSessionsAPIClient = (*Client)(nil) + +// DescribePlayerSessionsPaginatorOptions is the paginator options for +// DescribePlayerSessions +type DescribePlayerSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. If a player session ID is specified, + // this parameter is ignored. + 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 +} + +// DescribePlayerSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribePlayerSessions +type DescribePlayerSessionsPaginator struct { + options DescribePlayerSessionsPaginatorOptions + client DescribePlayerSessionsAPIClient + params *DescribePlayerSessionsInput + nextToken *string + firstPage bool +} + +// NewDescribePlayerSessionsPaginator returns a new DescribePlayerSessionsPaginator +func NewDescribePlayerSessionsPaginator(client DescribePlayerSessionsAPIClient, params *DescribePlayerSessionsInput, optFns ...func(*DescribePlayerSessionsPaginatorOptions)) *DescribePlayerSessionsPaginator { + options := DescribePlayerSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePlayerSessionsInput{} + } + + return &DescribePlayerSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePlayerSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePlayerSessions page. +func (p *DescribePlayerSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePlayerSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribePlayerSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePlayerSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_DescribeScalingPolicies.go b/service/gamelift/api_op_DescribeScalingPolicies.go index 3657492c549..a02a5e0cb7f 100644 --- a/service/gamelift/api_op_DescribeScalingPolicies.go +++ b/service/gamelift/api_op_DescribeScalingPolicies.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -176,6 +177,90 @@ func addOperationDescribeScalingPoliciesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeScalingPoliciesAPIClient is a client that implements the +// DescribeScalingPolicies operation. +type DescribeScalingPoliciesAPIClient interface { + DescribeScalingPolicies(context.Context, *DescribeScalingPoliciesInput, ...func(*Options)) (*DescribeScalingPoliciesOutput, error) +} + +var _ DescribeScalingPoliciesAPIClient = (*Client)(nil) + +// DescribeScalingPoliciesPaginatorOptions is the paginator options for +// DescribeScalingPolicies +type DescribeScalingPoliciesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// DescribeScalingPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.DescribeScalingPolicies +type DescribeScalingPoliciesPaginator struct { + options DescribeScalingPoliciesPaginatorOptions + client DescribeScalingPoliciesAPIClient + params *DescribeScalingPoliciesInput + nextToken *string + firstPage bool +} + +// NewDescribeScalingPoliciesPaginator returns a new +// DescribeScalingPoliciesPaginator +func NewDescribeScalingPoliciesPaginator(client DescribeScalingPoliciesAPIClient, params *DescribeScalingPoliciesInput, optFns ...func(*DescribeScalingPoliciesPaginatorOptions)) *DescribeScalingPoliciesPaginator { + options := DescribeScalingPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScalingPoliciesInput{} + } + + return &DescribeScalingPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScalingPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScalingPolicies page. +func (p *DescribeScalingPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScalingPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeScalingPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScalingPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListAliases.go b/service/gamelift/api_op_ListAliases.go index 1bcd0dc1cdf..555a188ae0f 100644 --- a/service/gamelift/api_op_ListAliases.go +++ b/service/gamelift/api_op_ListAliases.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -145,6 +146,87 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListBuilds.go b/service/gamelift/api_op_ListBuilds.go index 97d45f306ce..dd1f31b92c0 100644 --- a/service/gamelift/api_op_ListBuilds.go +++ b/service/gamelift/api_op_ListBuilds.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -143,6 +144,87 @@ func addOperationListBuildsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListBuildsAPIClient is a client that implements the ListBuilds operation. +type ListBuildsAPIClient interface { + ListBuilds(context.Context, *ListBuildsInput, ...func(*Options)) (*ListBuildsOutput, error) +} + +var _ ListBuildsAPIClient = (*Client)(nil) + +// ListBuildsPaginatorOptions is the paginator options for ListBuilds +type ListBuildsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListBuildsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListBuilds +type ListBuildsPaginator struct { + options ListBuildsPaginatorOptions + client ListBuildsAPIClient + params *ListBuildsInput + nextToken *string + firstPage bool +} + +// NewListBuildsPaginator returns a new ListBuildsPaginator +func NewListBuildsPaginator(client ListBuildsAPIClient, params *ListBuildsInput, optFns ...func(*ListBuildsPaginatorOptions)) *ListBuildsPaginator { + options := ListBuildsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBuildsInput{} + } + + return &ListBuildsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBuildsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBuilds page. +func (p *ListBuildsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBuildsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListBuilds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBuilds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListFleets.go b/service/gamelift/api_op_ListFleets.go index 73ab60fa5b2..27c3e5c5ee3 100644 --- a/service/gamelift/api_op_ListFleets.go +++ b/service/gamelift/api_op_ListFleets.go @@ -4,6 +4,7 @@ package gamelift 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/awslabs/smithy-go/middleware" @@ -143,6 +144,87 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListGameServerGroups.go b/service/gamelift/api_op_ListGameServerGroups.go index 3471ef7a7ce..af41bf573af 100644 --- a/service/gamelift/api_op_ListGameServerGroups.go +++ b/service/gamelift/api_op_ListGameServerGroups.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -133,6 +134,89 @@ func addOperationListGameServerGroupsMiddlewares(stack *middleware.Stack, option return nil } +// ListGameServerGroupsAPIClient is a client that implements the +// ListGameServerGroups operation. +type ListGameServerGroupsAPIClient interface { + ListGameServerGroups(context.Context, *ListGameServerGroupsInput, ...func(*Options)) (*ListGameServerGroupsOutput, error) +} + +var _ ListGameServerGroupsAPIClient = (*Client)(nil) + +// ListGameServerGroupsPaginatorOptions is the paginator options for +// ListGameServerGroups +type ListGameServerGroupsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + 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 +} + +// ListGameServerGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListGameServerGroups +type ListGameServerGroupsPaginator struct { + options ListGameServerGroupsPaginatorOptions + client ListGameServerGroupsAPIClient + params *ListGameServerGroupsInput + nextToken *string + firstPage bool +} + +// NewListGameServerGroupsPaginator returns a new ListGameServerGroupsPaginator +func NewListGameServerGroupsPaginator(client ListGameServerGroupsAPIClient, params *ListGameServerGroupsInput, optFns ...func(*ListGameServerGroupsPaginatorOptions)) *ListGameServerGroupsPaginator { + options := ListGameServerGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGameServerGroupsInput{} + } + + return &ListGameServerGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGameServerGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGameServerGroups page. +func (p *ListGameServerGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGameServerGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGameServerGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGameServerGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListGameServers.go b/service/gamelift/api_op_ListGameServers.go index e7f74819d21..062b1e73c9d 100644 --- a/service/gamelift/api_op_ListGameServers.go +++ b/service/gamelift/api_op_ListGameServers.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -145,6 +146,88 @@ func addOperationListGameServersMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListGameServersAPIClient is a client that implements the ListGameServers +// operation. +type ListGameServersAPIClient interface { + ListGameServers(context.Context, *ListGameServersInput, ...func(*Options)) (*ListGameServersOutput, error) +} + +var _ ListGameServersAPIClient = (*Client)(nil) + +// ListGameServersPaginatorOptions is the paginator options for ListGameServers +type ListGameServersPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential segments. + 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 +} + +// ListGameServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListGameServers +type ListGameServersPaginator struct { + options ListGameServersPaginatorOptions + client ListGameServersAPIClient + params *ListGameServersInput + nextToken *string + firstPage bool +} + +// NewListGameServersPaginator returns a new ListGameServersPaginator +func NewListGameServersPaginator(client ListGameServersAPIClient, params *ListGameServersInput, optFns ...func(*ListGameServersPaginatorOptions)) *ListGameServersPaginator { + options := ListGameServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGameServersInput{} + } + + return &ListGameServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGameServersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGameServers page. +func (p *ListGameServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGameServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGameServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGameServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_ListScripts.go b/service/gamelift/api_op_ListScripts.go index 54d8f044f04..4b735497464 100644 --- a/service/gamelift/api_op_ListScripts.go +++ b/service/gamelift/api_op_ListScripts.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -124,6 +125,87 @@ func addOperationListScriptsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListScriptsAPIClient is a client that implements the ListScripts operation. +type ListScriptsAPIClient interface { + ListScripts(context.Context, *ListScriptsInput, ...func(*Options)) (*ListScriptsOutput, error) +} + +var _ ListScriptsAPIClient = (*Client)(nil) + +// ListScriptsPaginatorOptions is the paginator options for ListScripts +type ListScriptsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. + 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 +} + +// ListScriptsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.ListScripts +type ListScriptsPaginator struct { + options ListScriptsPaginatorOptions + client ListScriptsAPIClient + params *ListScriptsInput + nextToken *string + firstPage bool +} + +// NewListScriptsPaginator returns a new ListScriptsPaginator +func NewListScriptsPaginator(client ListScriptsAPIClient, params *ListScriptsInput, optFns ...func(*ListScriptsPaginatorOptions)) *ListScriptsPaginator { + options := ListScriptsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScriptsInput{} + } + + return &ListScriptsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScriptsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListScripts page. +func (p *ListScriptsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScriptsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListScripts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScripts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/api_op_SearchGameSessions.go b/service/gamelift/api_op_SearchGameSessions.go index fae2995df93..f44e0ddc84b 100644 --- a/service/gamelift/api_op_SearchGameSessions.go +++ b/service/gamelift/api_op_SearchGameSessions.go @@ -4,6 +4,7 @@ package gamelift 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/gamelift/types" @@ -255,6 +256,90 @@ func addOperationSearchGameSessionsMiddlewares(stack *middleware.Stack, options return nil } +// SearchGameSessionsAPIClient is a client that implements the SearchGameSessions +// operation. +type SearchGameSessionsAPIClient interface { + SearchGameSessions(context.Context, *SearchGameSessionsInput, ...func(*Options)) (*SearchGameSessionsOutput, error) +} + +var _ SearchGameSessionsAPIClient = (*Client)(nil) + +// SearchGameSessionsPaginatorOptions is the paginator options for +// SearchGameSessions +type SearchGameSessionsPaginatorOptions struct { + // The maximum number of results to return. Use this parameter with NextToken to + // get results as a set of sequential pages. The maximum number of results returned + // is 20, even if this value is not set or is set higher than 20. + 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 +} + +// SearchGameSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/gamelift.SearchGameSessions +type SearchGameSessionsPaginator struct { + options SearchGameSessionsPaginatorOptions + client SearchGameSessionsAPIClient + params *SearchGameSessionsInput + nextToken *string + firstPage bool +} + +// NewSearchGameSessionsPaginator returns a new SearchGameSessionsPaginator +func NewSearchGameSessionsPaginator(client SearchGameSessionsAPIClient, params *SearchGameSessionsInput, optFns ...func(*SearchGameSessionsPaginatorOptions)) *SearchGameSessionsPaginator { + options := SearchGameSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchGameSessionsInput{} + } + + return &SearchGameSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchGameSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchGameSessions page. +func (p *SearchGameSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchGameSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.SearchGameSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchGameSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/gamelift/endpoints.go b/service/gamelift/endpoints.go index 7bc2bde5167..38d2c4f6c78 100644 --- a/service/gamelift/endpoints.go +++ b/service/gamelift/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/glacier/endpoints.go b/service/glacier/endpoints.go index f6266a2c717..b17bb912d49 100644 --- a/service/glacier/endpoints.go +++ b/service/glacier/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/globalaccelerator/endpoints.go b/service/globalaccelerator/endpoints.go index e0e2ccdb2f9..cbadb8603f5 100644 --- a/service/globalaccelerator/endpoints.go +++ b/service/globalaccelerator/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/glue/api_op_GetClassifiers.go b/service/glue/api_op_GetClassifiers.go index 355c9fa354c..920f9770be5 100644 --- a/service/glue/api_op_GetClassifiers.go +++ b/service/glue/api_op_GetClassifiers.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -105,6 +106,87 @@ func addOperationGetClassifiersMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetClassifiersAPIClient is a client that implements the GetClassifiers +// operation. +type GetClassifiersAPIClient interface { + GetClassifiers(context.Context, *GetClassifiersInput, ...func(*Options)) (*GetClassifiersOutput, error) +} + +var _ GetClassifiersAPIClient = (*Client)(nil) + +// GetClassifiersPaginatorOptions is the paginator options for GetClassifiers +type GetClassifiersPaginatorOptions struct { + // The size of the list to return (optional). + 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 +} + +// GetClassifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetClassifiers +type GetClassifiersPaginator struct { + options GetClassifiersPaginatorOptions + client GetClassifiersAPIClient + params *GetClassifiersInput + nextToken *string + firstPage bool +} + +// NewGetClassifiersPaginator returns a new GetClassifiersPaginator +func NewGetClassifiersPaginator(client GetClassifiersAPIClient, params *GetClassifiersInput, optFns ...func(*GetClassifiersPaginatorOptions)) *GetClassifiersPaginator { + options := GetClassifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetClassifiersInput{} + } + + return &GetClassifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetClassifiersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetClassifiers page. +func (p *GetClassifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetClassifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetClassifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetClassifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetConnections.go b/service/glue/api_op_GetConnections.go index 9f603274664..95613c44618 100644 --- a/service/glue/api_op_GetConnections.go +++ b/service/glue/api_op_GetConnections.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -120,6 +121,87 @@ func addOperationGetConnectionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetConnectionsAPIClient is a client that implements the GetConnections +// operation. +type GetConnectionsAPIClient interface { + GetConnections(context.Context, *GetConnectionsInput, ...func(*Options)) (*GetConnectionsOutput, error) +} + +var _ GetConnectionsAPIClient = (*Client)(nil) + +// GetConnectionsPaginatorOptions is the paginator options for GetConnections +type GetConnectionsPaginatorOptions struct { + // The maximum number of connections to return in one response. + 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 +} + +// GetConnectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetConnections +type GetConnectionsPaginator struct { + options GetConnectionsPaginatorOptions + client GetConnectionsAPIClient + params *GetConnectionsInput + nextToken *string + firstPage bool +} + +// NewGetConnectionsPaginator returns a new GetConnectionsPaginator +func NewGetConnectionsPaginator(client GetConnectionsAPIClient, params *GetConnectionsInput, optFns ...func(*GetConnectionsPaginatorOptions)) *GetConnectionsPaginator { + options := GetConnectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetConnectionsInput{} + } + + return &GetConnectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetConnectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetConnections page. +func (p *GetConnectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConnectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetConnections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetConnections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetCrawlerMetrics.go b/service/glue/api_op_GetCrawlerMetrics.go index a3b4e7c7bee..121a318ba30 100644 --- a/service/glue/api_op_GetCrawlerMetrics.go +++ b/service/glue/api_op_GetCrawlerMetrics.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -109,6 +110,87 @@ func addOperationGetCrawlerMetricsMiddlewares(stack *middleware.Stack, options O return nil } +// GetCrawlerMetricsAPIClient is a client that implements the GetCrawlerMetrics +// operation. +type GetCrawlerMetricsAPIClient interface { + GetCrawlerMetrics(context.Context, *GetCrawlerMetricsInput, ...func(*Options)) (*GetCrawlerMetricsOutput, error) +} + +var _ GetCrawlerMetricsAPIClient = (*Client)(nil) + +// GetCrawlerMetricsPaginatorOptions is the paginator options for GetCrawlerMetrics +type GetCrawlerMetricsPaginatorOptions struct { + // The maximum size of a list 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 +} + +// GetCrawlerMetricsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetCrawlerMetrics +type GetCrawlerMetricsPaginator struct { + options GetCrawlerMetricsPaginatorOptions + client GetCrawlerMetricsAPIClient + params *GetCrawlerMetricsInput + nextToken *string + firstPage bool +} + +// NewGetCrawlerMetricsPaginator returns a new GetCrawlerMetricsPaginator +func NewGetCrawlerMetricsPaginator(client GetCrawlerMetricsAPIClient, params *GetCrawlerMetricsInput, optFns ...func(*GetCrawlerMetricsPaginatorOptions)) *GetCrawlerMetricsPaginator { + options := GetCrawlerMetricsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCrawlerMetricsInput{} + } + + return &GetCrawlerMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCrawlerMetricsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCrawlerMetrics page. +func (p *GetCrawlerMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCrawlerMetricsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCrawlerMetrics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCrawlerMetrics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetCrawlers.go b/service/glue/api_op_GetCrawlers.go index 4179286e053..8d4788ae130 100644 --- a/service/glue/api_op_GetCrawlers.go +++ b/service/glue/api_op_GetCrawlers.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -106,6 +107,86 @@ func addOperationGetCrawlersMiddlewares(stack *middleware.Stack, options Options return nil } +// GetCrawlersAPIClient is a client that implements the GetCrawlers operation. +type GetCrawlersAPIClient interface { + GetCrawlers(context.Context, *GetCrawlersInput, ...func(*Options)) (*GetCrawlersOutput, error) +} + +var _ GetCrawlersAPIClient = (*Client)(nil) + +// GetCrawlersPaginatorOptions is the paginator options for GetCrawlers +type GetCrawlersPaginatorOptions struct { + // The number of crawlers to return on each call. + 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 +} + +// GetCrawlersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetCrawlers +type GetCrawlersPaginator struct { + options GetCrawlersPaginatorOptions + client GetCrawlersAPIClient + params *GetCrawlersInput + nextToken *string + firstPage bool +} + +// NewGetCrawlersPaginator returns a new GetCrawlersPaginator +func NewGetCrawlersPaginator(client GetCrawlersAPIClient, params *GetCrawlersInput, optFns ...func(*GetCrawlersPaginatorOptions)) *GetCrawlersPaginator { + options := GetCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCrawlersInput{} + } + + return &GetCrawlersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCrawlersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCrawlers page. +func (p *GetCrawlersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCrawlersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCrawlers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCrawlers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetDatabases.go b/service/glue/api_op_GetDatabases.go index eaee6500ac6..3f34c39d2eb 100644 --- a/service/glue/api_op_GetDatabases.go +++ b/service/glue/api_op_GetDatabases.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -123,6 +124,86 @@ func addOperationGetDatabasesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetDatabasesAPIClient is a client that implements the GetDatabases operation. +type GetDatabasesAPIClient interface { + GetDatabases(context.Context, *GetDatabasesInput, ...func(*Options)) (*GetDatabasesOutput, error) +} + +var _ GetDatabasesAPIClient = (*Client)(nil) + +// GetDatabasesPaginatorOptions is the paginator options for GetDatabases +type GetDatabasesPaginatorOptions struct { + // The maximum number of databases to return in one response. + 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 +} + +// GetDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetDatabases +type GetDatabasesPaginator struct { + options GetDatabasesPaginatorOptions + client GetDatabasesAPIClient + params *GetDatabasesInput + nextToken *string + firstPage bool +} + +// NewGetDatabasesPaginator returns a new GetDatabasesPaginator +func NewGetDatabasesPaginator(client GetDatabasesAPIClient, params *GetDatabasesInput, optFns ...func(*GetDatabasesPaginatorOptions)) *GetDatabasesPaginator { + options := GetDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDatabasesInput{} + } + + return &GetDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDatabasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDatabases page. +func (p *GetDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetDevEndpoints.go b/service/glue/api_op_GetDevEndpoints.go index 748fa1362ef..daa0e500a00 100644 --- a/service/glue/api_op_GetDevEndpoints.go +++ b/service/glue/api_op_GetDevEndpoints.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -109,6 +110,87 @@ func addOperationGetDevEndpointsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetDevEndpointsAPIClient is a client that implements the GetDevEndpoints +// operation. +type GetDevEndpointsAPIClient interface { + GetDevEndpoints(context.Context, *GetDevEndpointsInput, ...func(*Options)) (*GetDevEndpointsOutput, error) +} + +var _ GetDevEndpointsAPIClient = (*Client)(nil) + +// GetDevEndpointsPaginatorOptions is the paginator options for GetDevEndpoints +type GetDevEndpointsPaginatorOptions struct { + // The maximum size of information 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 +} + +// GetDevEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetDevEndpoints +type GetDevEndpointsPaginator struct { + options GetDevEndpointsPaginatorOptions + client GetDevEndpointsAPIClient + params *GetDevEndpointsInput + nextToken *string + firstPage bool +} + +// NewGetDevEndpointsPaginator returns a new GetDevEndpointsPaginator +func NewGetDevEndpointsPaginator(client GetDevEndpointsAPIClient, params *GetDevEndpointsInput, optFns ...func(*GetDevEndpointsPaginatorOptions)) *GetDevEndpointsPaginator { + options := GetDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDevEndpointsInput{} + } + + return &GetDevEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDevEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDevEndpoints page. +func (p *GetDevEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetDevEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDevEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetJobRuns.go b/service/glue/api_op_GetJobRuns.go index b6e9f1fa9a3..f8c771782d6 100644 --- a/service/glue/api_op_GetJobRuns.go +++ b/service/glue/api_op_GetJobRuns.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -113,6 +114,86 @@ func addOperationGetJobRunsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetJobRunsAPIClient is a client that implements the GetJobRuns operation. +type GetJobRunsAPIClient interface { + GetJobRuns(context.Context, *GetJobRunsInput, ...func(*Options)) (*GetJobRunsOutput, error) +} + +var _ GetJobRunsAPIClient = (*Client)(nil) + +// GetJobRunsPaginatorOptions is the paginator options for GetJobRuns +type GetJobRunsPaginatorOptions struct { + // The maximum size of the response. + 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 +} + +// GetJobRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetJobRuns +type GetJobRunsPaginator struct { + options GetJobRunsPaginatorOptions + client GetJobRunsAPIClient + params *GetJobRunsInput + nextToken *string + firstPage bool +} + +// NewGetJobRunsPaginator returns a new GetJobRunsPaginator +func NewGetJobRunsPaginator(client GetJobRunsAPIClient, params *GetJobRunsInput, optFns ...func(*GetJobRunsPaginatorOptions)) *GetJobRunsPaginator { + options := GetJobRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetJobRunsInput{} + } + + return &GetJobRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetJobRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetJobRuns page. +func (p *GetJobRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetJobRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetJobRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetJobRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetJobs.go b/service/glue/api_op_GetJobs.go index 5161600fb28..40afe2a7463 100644 --- a/service/glue/api_op_GetJobs.go +++ b/service/glue/api_op_GetJobs.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -105,6 +106,86 @@ func addOperationGetJobsMiddlewares(stack *middleware.Stack, options Options) (e return nil } +// GetJobsAPIClient is a client that implements the GetJobs operation. +type GetJobsAPIClient interface { + GetJobs(context.Context, *GetJobsInput, ...func(*Options)) (*GetJobsOutput, error) +} + +var _ GetJobsAPIClient = (*Client)(nil) + +// GetJobsPaginatorOptions is the paginator options for GetJobs +type GetJobsPaginatorOptions struct { + // The maximum size of the response. + 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 +} + +// GetJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetJobs +type GetJobsPaginator struct { + options GetJobsPaginatorOptions + client GetJobsAPIClient + params *GetJobsInput + nextToken *string + firstPage bool +} + +// NewGetJobsPaginator returns a new GetJobsPaginator +func NewGetJobsPaginator(client GetJobsAPIClient, params *GetJobsInput, optFns ...func(*GetJobsPaginatorOptions)) *GetJobsPaginator { + options := GetJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetJobsInput{} + } + + return &GetJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetJobs page. +func (p *GetJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetMLTaskRuns.go b/service/glue/api_op_GetMLTaskRuns.go index 67ddccdc8f4..248a57e045e 100644 --- a/service/glue/api_op_GetMLTaskRuns.go +++ b/service/glue/api_op_GetMLTaskRuns.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -124,6 +125,86 @@ func addOperationGetMLTaskRunsMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetMLTaskRunsAPIClient is a client that implements the GetMLTaskRuns operation. +type GetMLTaskRunsAPIClient interface { + GetMLTaskRuns(context.Context, *GetMLTaskRunsInput, ...func(*Options)) (*GetMLTaskRunsOutput, error) +} + +var _ GetMLTaskRunsAPIClient = (*Client)(nil) + +// GetMLTaskRunsPaginatorOptions is the paginator options for GetMLTaskRuns +type GetMLTaskRunsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetMLTaskRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetMLTaskRuns +type GetMLTaskRunsPaginator struct { + options GetMLTaskRunsPaginatorOptions + client GetMLTaskRunsAPIClient + params *GetMLTaskRunsInput + nextToken *string + firstPage bool +} + +// NewGetMLTaskRunsPaginator returns a new GetMLTaskRunsPaginator +func NewGetMLTaskRunsPaginator(client GetMLTaskRunsAPIClient, params *GetMLTaskRunsInput, optFns ...func(*GetMLTaskRunsPaginatorOptions)) *GetMLTaskRunsPaginator { + options := GetMLTaskRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMLTaskRunsInput{} + } + + return &GetMLTaskRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMLTaskRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetMLTaskRuns page. +func (p *GetMLTaskRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMLTaskRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetMLTaskRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMLTaskRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetMLTransforms.go b/service/glue/api_op_GetMLTransforms.go index 9b3ae6b341d..dc85223a9b5 100644 --- a/service/glue/api_op_GetMLTransforms.go +++ b/service/glue/api_op_GetMLTransforms.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -120,6 +121,87 @@ func addOperationGetMLTransformsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetMLTransformsAPIClient is a client that implements the GetMLTransforms +// operation. +type GetMLTransformsAPIClient interface { + GetMLTransforms(context.Context, *GetMLTransformsInput, ...func(*Options)) (*GetMLTransformsOutput, error) +} + +var _ GetMLTransformsAPIClient = (*Client)(nil) + +// GetMLTransformsPaginatorOptions is the paginator options for GetMLTransforms +type GetMLTransformsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetMLTransformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetMLTransforms +type GetMLTransformsPaginator struct { + options GetMLTransformsPaginatorOptions + client GetMLTransformsAPIClient + params *GetMLTransformsInput + nextToken *string + firstPage bool +} + +// NewGetMLTransformsPaginator returns a new GetMLTransformsPaginator +func NewGetMLTransformsPaginator(client GetMLTransformsAPIClient, params *GetMLTransformsInput, optFns ...func(*GetMLTransformsPaginatorOptions)) *GetMLTransformsPaginator { + options := GetMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetMLTransformsInput{} + } + + return &GetMLTransformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetMLTransformsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetMLTransforms page. +func (p *GetMLTransformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetMLTransformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetMLTransforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetMLTransforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetPartitionIndexes.go b/service/glue/api_op_GetPartitionIndexes.go index 8ebb0e304ff..ae03ef3180f 100644 --- a/service/glue/api_op_GetPartitionIndexes.go +++ b/service/glue/api_op_GetPartitionIndexes.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -120,6 +121,81 @@ func addOperationGetPartitionIndexesMiddlewares(stack *middleware.Stack, options return nil } +// GetPartitionIndexesAPIClient is a client that implements the GetPartitionIndexes +// operation. +type GetPartitionIndexesAPIClient interface { + GetPartitionIndexes(context.Context, *GetPartitionIndexesInput, ...func(*Options)) (*GetPartitionIndexesOutput, error) +} + +var _ GetPartitionIndexesAPIClient = (*Client)(nil) + +// GetPartitionIndexesPaginatorOptions is the paginator options for +// GetPartitionIndexes +type GetPartitionIndexesPaginatorOptions struct { + // 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 +} + +// GetPartitionIndexesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetPartitionIndexes +type GetPartitionIndexesPaginator struct { + options GetPartitionIndexesPaginatorOptions + client GetPartitionIndexesAPIClient + params *GetPartitionIndexesInput + nextToken *string + firstPage bool +} + +// NewGetPartitionIndexesPaginator returns a new GetPartitionIndexesPaginator +func NewGetPartitionIndexesPaginator(client GetPartitionIndexesAPIClient, params *GetPartitionIndexesInput, optFns ...func(*GetPartitionIndexesPaginatorOptions)) *GetPartitionIndexesPaginator { + options := GetPartitionIndexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPartitionIndexesInput{} + } + + return &GetPartitionIndexesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPartitionIndexesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetPartitionIndexes page. +func (p *GetPartitionIndexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPartitionIndexesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetPartitionIndexes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPartitionIndexes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetPartitions.go b/service/glue/api_op_GetPartitions.go index 15a28e7a8f2..3e6ef04ed2c 100644 --- a/service/glue/api_op_GetPartitions.go +++ b/service/glue/api_op_GetPartitions.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -173,6 +174,86 @@ func addOperationGetPartitionsMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetPartitionsAPIClient is a client that implements the GetPartitions operation. +type GetPartitionsAPIClient interface { + GetPartitions(context.Context, *GetPartitionsInput, ...func(*Options)) (*GetPartitionsOutput, error) +} + +var _ GetPartitionsAPIClient = (*Client)(nil) + +// GetPartitionsPaginatorOptions is the paginator options for GetPartitions +type GetPartitionsPaginatorOptions struct { + // The maximum number of partitions to return in a single response. + 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 +} + +// GetPartitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetPartitions +type GetPartitionsPaginator struct { + options GetPartitionsPaginatorOptions + client GetPartitionsAPIClient + params *GetPartitionsInput + nextToken *string + firstPage bool +} + +// NewGetPartitionsPaginator returns a new GetPartitionsPaginator +func NewGetPartitionsPaginator(client GetPartitionsAPIClient, params *GetPartitionsInput, optFns ...func(*GetPartitionsPaginatorOptions)) *GetPartitionsPaginator { + options := GetPartitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPartitionsInput{} + } + + return &GetPartitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPartitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetPartitions page. +func (p *GetPartitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPartitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetPartitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPartitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetSecurityConfigurations.go b/service/glue/api_op_GetSecurityConfigurations.go index c2dfc3d3922..cb0b7547456 100644 --- a/service/glue/api_op_GetSecurityConfigurations.go +++ b/service/glue/api_op_GetSecurityConfigurations.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -105,6 +106,89 @@ func addOperationGetSecurityConfigurationsMiddlewares(stack *middleware.Stack, o return nil } +// GetSecurityConfigurationsAPIClient is a client that implements the +// GetSecurityConfigurations operation. +type GetSecurityConfigurationsAPIClient interface { + GetSecurityConfigurations(context.Context, *GetSecurityConfigurationsInput, ...func(*Options)) (*GetSecurityConfigurationsOutput, error) +} + +var _ GetSecurityConfigurationsAPIClient = (*Client)(nil) + +// GetSecurityConfigurationsPaginatorOptions is the paginator options for +// GetSecurityConfigurations +type GetSecurityConfigurationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetSecurityConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetSecurityConfigurations +type GetSecurityConfigurationsPaginator struct { + options GetSecurityConfigurationsPaginatorOptions + client GetSecurityConfigurationsAPIClient + params *GetSecurityConfigurationsInput + nextToken *string + firstPage bool +} + +// NewGetSecurityConfigurationsPaginator returns a new +// GetSecurityConfigurationsPaginator +func NewGetSecurityConfigurationsPaginator(client GetSecurityConfigurationsAPIClient, params *GetSecurityConfigurationsInput, optFns ...func(*GetSecurityConfigurationsPaginatorOptions)) *GetSecurityConfigurationsPaginator { + options := GetSecurityConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSecurityConfigurationsInput{} + } + + return &GetSecurityConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSecurityConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSecurityConfigurations page. +func (p *GetSecurityConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSecurityConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSecurityConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSecurityConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTableVersions.go b/service/glue/api_op_GetTableVersions.go index cb980451e0d..5f11f3f84b4 100644 --- a/service/glue/api_op_GetTableVersions.go +++ b/service/glue/api_op_GetTableVersions.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -125,6 +126,87 @@ func addOperationGetTableVersionsMiddlewares(stack *middleware.Stack, options Op return nil } +// GetTableVersionsAPIClient is a client that implements the GetTableVersions +// operation. +type GetTableVersionsAPIClient interface { + GetTableVersions(context.Context, *GetTableVersionsInput, ...func(*Options)) (*GetTableVersionsOutput, error) +} + +var _ GetTableVersionsAPIClient = (*Client)(nil) + +// GetTableVersionsPaginatorOptions is the paginator options for GetTableVersions +type GetTableVersionsPaginatorOptions struct { + // The maximum number of table versions to return in one response. + 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 +} + +// GetTableVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTableVersions +type GetTableVersionsPaginator struct { + options GetTableVersionsPaginatorOptions + client GetTableVersionsAPIClient + params *GetTableVersionsInput + nextToken *string + firstPage bool +} + +// NewGetTableVersionsPaginator returns a new GetTableVersionsPaginator +func NewGetTableVersionsPaginator(client GetTableVersionsAPIClient, params *GetTableVersionsInput, optFns ...func(*GetTableVersionsPaginatorOptions)) *GetTableVersionsPaginator { + options := GetTableVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTableVersionsInput{} + } + + return &GetTableVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTableVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTableVersions page. +func (p *GetTableVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTableVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetTableVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTableVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTables.go b/service/glue/api_op_GetTables.go index 7a4a7eded94..b4f1c5afb2b 100644 --- a/service/glue/api_op_GetTables.go +++ b/service/glue/api_op_GetTables.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -122,6 +123,86 @@ func addOperationGetTablesMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetTablesAPIClient is a client that implements the GetTables operation. +type GetTablesAPIClient interface { + GetTables(context.Context, *GetTablesInput, ...func(*Options)) (*GetTablesOutput, error) +} + +var _ GetTablesAPIClient = (*Client)(nil) + +// GetTablesPaginatorOptions is the paginator options for GetTables +type GetTablesPaginatorOptions struct { + // The maximum number of tables to return in a single response. + 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 +} + +// GetTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTables +type GetTablesPaginator struct { + options GetTablesPaginatorOptions + client GetTablesAPIClient + params *GetTablesInput + nextToken *string + firstPage bool +} + +// NewGetTablesPaginator returns a new GetTablesPaginator +func NewGetTablesPaginator(client GetTablesAPIClient, params *GetTablesInput, optFns ...func(*GetTablesPaginatorOptions)) *GetTablesPaginator { + options := GetTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTablesInput{} + } + + return &GetTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTables page. +func (p *GetTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetTriggers.go b/service/glue/api_op_GetTriggers.go index 7c086b5ca5f..39687c233fe 100644 --- a/service/glue/api_op_GetTriggers.go +++ b/service/glue/api_op_GetTriggers.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -109,6 +110,86 @@ func addOperationGetTriggersMiddlewares(stack *middleware.Stack, options Options return nil } +// GetTriggersAPIClient is a client that implements the GetTriggers operation. +type GetTriggersAPIClient interface { + GetTriggers(context.Context, *GetTriggersInput, ...func(*Options)) (*GetTriggersOutput, error) +} + +var _ GetTriggersAPIClient = (*Client)(nil) + +// GetTriggersPaginatorOptions is the paginator options for GetTriggers +type GetTriggersPaginatorOptions struct { + // The maximum size of the response. + 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 +} + +// GetTriggersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetTriggers +type GetTriggersPaginator struct { + options GetTriggersPaginatorOptions + client GetTriggersAPIClient + params *GetTriggersInput + nextToken *string + firstPage bool +} + +// NewGetTriggersPaginator returns a new GetTriggersPaginator +func NewGetTriggersPaginator(client GetTriggersAPIClient, params *GetTriggersInput, optFns ...func(*GetTriggersPaginatorOptions)) *GetTriggersPaginator { + options := GetTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTriggersInput{} + } + + return &GetTriggersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTriggersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTriggers page. +func (p *GetTriggersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTriggersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetTriggers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTriggers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetUserDefinedFunctions.go b/service/glue/api_op_GetUserDefinedFunctions.go index 75361487302..c4b978b5611 100644 --- a/service/glue/api_op_GetUserDefinedFunctions.go +++ b/service/glue/api_op_GetUserDefinedFunctions.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -123,6 +124,89 @@ func addOperationGetUserDefinedFunctionsMiddlewares(stack *middleware.Stack, opt return nil } +// GetUserDefinedFunctionsAPIClient is a client that implements the +// GetUserDefinedFunctions operation. +type GetUserDefinedFunctionsAPIClient interface { + GetUserDefinedFunctions(context.Context, *GetUserDefinedFunctionsInput, ...func(*Options)) (*GetUserDefinedFunctionsOutput, error) +} + +var _ GetUserDefinedFunctionsAPIClient = (*Client)(nil) + +// GetUserDefinedFunctionsPaginatorOptions is the paginator options for +// GetUserDefinedFunctions +type GetUserDefinedFunctionsPaginatorOptions struct { + // The maximum number of functions to return in one response. + 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 +} + +// GetUserDefinedFunctionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetUserDefinedFunctions +type GetUserDefinedFunctionsPaginator struct { + options GetUserDefinedFunctionsPaginatorOptions + client GetUserDefinedFunctionsAPIClient + params *GetUserDefinedFunctionsInput + nextToken *string + firstPage bool +} + +// NewGetUserDefinedFunctionsPaginator returns a new +// GetUserDefinedFunctionsPaginator +func NewGetUserDefinedFunctionsPaginator(client GetUserDefinedFunctionsAPIClient, params *GetUserDefinedFunctionsInput, optFns ...func(*GetUserDefinedFunctionsPaginatorOptions)) *GetUserDefinedFunctionsPaginator { + options := GetUserDefinedFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUserDefinedFunctionsInput{} + } + + return &GetUserDefinedFunctionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUserDefinedFunctionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUserDefinedFunctions page. +func (p *GetUserDefinedFunctionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUserDefinedFunctionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetUserDefinedFunctions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUserDefinedFunctions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_GetWorkflowRuns.go b/service/glue/api_op_GetWorkflowRuns.go index aeb38859129..2064628dad8 100644 --- a/service/glue/api_op_GetWorkflowRuns.go +++ b/service/glue/api_op_GetWorkflowRuns.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -116,6 +117,87 @@ func addOperationGetWorkflowRunsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetWorkflowRunsAPIClient is a client that implements the GetWorkflowRuns +// operation. +type GetWorkflowRunsAPIClient interface { + GetWorkflowRuns(context.Context, *GetWorkflowRunsInput, ...func(*Options)) (*GetWorkflowRunsOutput, error) +} + +var _ GetWorkflowRunsAPIClient = (*Client)(nil) + +// GetWorkflowRunsPaginatorOptions is the paginator options for GetWorkflowRuns +type GetWorkflowRunsPaginatorOptions struct { + // The maximum number of workflow runs to be included in the response. + 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 +} + +// GetWorkflowRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.GetWorkflowRuns +type GetWorkflowRunsPaginator struct { + options GetWorkflowRunsPaginatorOptions + client GetWorkflowRunsAPIClient + params *GetWorkflowRunsInput + nextToken *string + firstPage bool +} + +// NewGetWorkflowRunsPaginator returns a new GetWorkflowRunsPaginator +func NewGetWorkflowRunsPaginator(client GetWorkflowRunsAPIClient, params *GetWorkflowRunsInput, optFns ...func(*GetWorkflowRunsPaginatorOptions)) *GetWorkflowRunsPaginator { + options := GetWorkflowRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetWorkflowRunsInput{} + } + + return &GetWorkflowRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetWorkflowRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetWorkflowRuns page. +func (p *GetWorkflowRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetWorkflowRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetWorkflowRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetWorkflowRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListCrawlers.go b/service/glue/api_op_ListCrawlers.go index 5706665d7d4..486e0541622 100644 --- a/service/glue/api_op_ListCrawlers.go +++ b/service/glue/api_op_ListCrawlers.go @@ -4,6 +4,7 @@ package glue 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/awslabs/smithy-go/middleware" @@ -114,6 +115,86 @@ func addOperationListCrawlersMiddlewares(stack *middleware.Stack, options Option return nil } +// ListCrawlersAPIClient is a client that implements the ListCrawlers operation. +type ListCrawlersAPIClient interface { + ListCrawlers(context.Context, *ListCrawlersInput, ...func(*Options)) (*ListCrawlersOutput, error) +} + +var _ ListCrawlersAPIClient = (*Client)(nil) + +// ListCrawlersPaginatorOptions is the paginator options for ListCrawlers +type ListCrawlersPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListCrawlersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListCrawlers +type ListCrawlersPaginator struct { + options ListCrawlersPaginatorOptions + client ListCrawlersAPIClient + params *ListCrawlersInput + nextToken *string + firstPage bool +} + +// NewListCrawlersPaginator returns a new ListCrawlersPaginator +func NewListCrawlersPaginator(client ListCrawlersAPIClient, params *ListCrawlersInput, optFns ...func(*ListCrawlersPaginatorOptions)) *ListCrawlersPaginator { + options := ListCrawlersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCrawlersInput{} + } + + return &ListCrawlersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCrawlersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCrawlers page. +func (p *ListCrawlersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCrawlersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCrawlers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCrawlers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListDevEndpoints.go b/service/glue/api_op_ListDevEndpoints.go index 9e68293fc57..3064f528576 100644 --- a/service/glue/api_op_ListDevEndpoints.go +++ b/service/glue/api_op_ListDevEndpoints.go @@ -4,6 +4,7 @@ package glue 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/awslabs/smithy-go/middleware" @@ -114,6 +115,87 @@ func addOperationListDevEndpointsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListDevEndpointsAPIClient is a client that implements the ListDevEndpoints +// operation. +type ListDevEndpointsAPIClient interface { + ListDevEndpoints(context.Context, *ListDevEndpointsInput, ...func(*Options)) (*ListDevEndpointsOutput, error) +} + +var _ ListDevEndpointsAPIClient = (*Client)(nil) + +// ListDevEndpointsPaginatorOptions is the paginator options for ListDevEndpoints +type ListDevEndpointsPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListDevEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListDevEndpoints +type ListDevEndpointsPaginator struct { + options ListDevEndpointsPaginatorOptions + client ListDevEndpointsAPIClient + params *ListDevEndpointsInput + nextToken *string + firstPage bool +} + +// NewListDevEndpointsPaginator returns a new ListDevEndpointsPaginator +func NewListDevEndpointsPaginator(client ListDevEndpointsAPIClient, params *ListDevEndpointsInput, optFns ...func(*ListDevEndpointsPaginatorOptions)) *ListDevEndpointsPaginator { + options := ListDevEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevEndpointsInput{} + } + + return &ListDevEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDevEndpoints page. +func (p *ListDevEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDevEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListJobs.go b/service/glue/api_op_ListJobs.go index 3c812f45e73..1922d5ba905 100644 --- a/service/glue/api_op_ListJobs.go +++ b/service/glue/api_op_ListJobs.go @@ -4,6 +4,7 @@ package glue 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/awslabs/smithy-go/middleware" @@ -113,6 +114,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListMLTransforms.go b/service/glue/api_op_ListMLTransforms.go index e2cc9abef35..2ebbf3f4f4b 100644 --- a/service/glue/api_op_ListMLTransforms.go +++ b/service/glue/api_op_ListMLTransforms.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -125,6 +126,87 @@ func addOperationListMLTransformsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListMLTransformsAPIClient is a client that implements the ListMLTransforms +// operation. +type ListMLTransformsAPIClient interface { + ListMLTransforms(context.Context, *ListMLTransformsInput, ...func(*Options)) (*ListMLTransformsOutput, error) +} + +var _ ListMLTransformsAPIClient = (*Client)(nil) + +// ListMLTransformsPaginatorOptions is the paginator options for ListMLTransforms +type ListMLTransformsPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListMLTransformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListMLTransforms +type ListMLTransformsPaginator struct { + options ListMLTransformsPaginatorOptions + client ListMLTransformsAPIClient + params *ListMLTransformsInput + nextToken *string + firstPage bool +} + +// NewListMLTransformsPaginator returns a new ListMLTransformsPaginator +func NewListMLTransformsPaginator(client ListMLTransformsAPIClient, params *ListMLTransformsInput, optFns ...func(*ListMLTransformsPaginatorOptions)) *ListMLTransformsPaginator { + options := ListMLTransformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMLTransformsInput{} + } + + return &ListMLTransformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMLTransformsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMLTransforms page. +func (p *ListMLTransformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMLTransformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMLTransforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMLTransforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListTriggers.go b/service/glue/api_op_ListTriggers.go index b810b2e94c3..edacddf8291 100644 --- a/service/glue/api_op_ListTriggers.go +++ b/service/glue/api_op_ListTriggers.go @@ -4,6 +4,7 @@ package glue 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/awslabs/smithy-go/middleware" @@ -118,6 +119,86 @@ func addOperationListTriggersMiddlewares(stack *middleware.Stack, options Option return nil } +// ListTriggersAPIClient is a client that implements the ListTriggers operation. +type ListTriggersAPIClient interface { + ListTriggers(context.Context, *ListTriggersInput, ...func(*Options)) (*ListTriggersOutput, error) +} + +var _ ListTriggersAPIClient = (*Client)(nil) + +// ListTriggersPaginatorOptions is the paginator options for ListTriggers +type ListTriggersPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListTriggersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListTriggers +type ListTriggersPaginator struct { + options ListTriggersPaginatorOptions + client ListTriggersAPIClient + params *ListTriggersInput + nextToken *string + firstPage bool +} + +// NewListTriggersPaginator returns a new ListTriggersPaginator +func NewListTriggersPaginator(client ListTriggersAPIClient, params *ListTriggersInput, optFns ...func(*ListTriggersPaginatorOptions)) *ListTriggersPaginator { + options := ListTriggersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTriggersInput{} + } + + return &ListTriggersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTriggersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTriggers page. +func (p *ListTriggersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTriggersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTriggers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTriggers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_ListWorkflows.go b/service/glue/api_op_ListWorkflows.go index f22392aee11..6ebc3bc3358 100644 --- a/service/glue/api_op_ListWorkflows.go +++ b/service/glue/api_op_ListWorkflows.go @@ -4,6 +4,7 @@ package glue 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/awslabs/smithy-go/middleware" @@ -104,6 +105,86 @@ func addOperationListWorkflowsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListWorkflowsAPIClient is a client that implements the ListWorkflows operation. +type ListWorkflowsAPIClient interface { + ListWorkflows(context.Context, *ListWorkflowsInput, ...func(*Options)) (*ListWorkflowsOutput, error) +} + +var _ ListWorkflowsAPIClient = (*Client)(nil) + +// ListWorkflowsPaginatorOptions is the paginator options for ListWorkflows +type ListWorkflowsPaginatorOptions struct { + // The maximum size of a list 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 +} + +// ListWorkflowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.ListWorkflows +type ListWorkflowsPaginator struct { + options ListWorkflowsPaginatorOptions + client ListWorkflowsAPIClient + params *ListWorkflowsInput + nextToken *string + firstPage bool +} + +// NewListWorkflowsPaginator returns a new ListWorkflowsPaginator +func NewListWorkflowsPaginator(client ListWorkflowsAPIClient, params *ListWorkflowsInput, optFns ...func(*ListWorkflowsPaginatorOptions)) *ListWorkflowsPaginator { + options := ListWorkflowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkflowsInput{} + } + + return &ListWorkflowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkflows page. +func (p *ListWorkflowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkflows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkflows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/api_op_SearchTables.go b/service/glue/api_op_SearchTables.go index 82e586ec1ae..b28ae04753e 100644 --- a/service/glue/api_op_SearchTables.go +++ b/service/glue/api_op_SearchTables.go @@ -4,6 +4,7 @@ package glue 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/glue/types" @@ -146,6 +147,86 @@ func addOperationSearchTablesMiddlewares(stack *middleware.Stack, options Option return nil } +// SearchTablesAPIClient is a client that implements the SearchTables operation. +type SearchTablesAPIClient interface { + SearchTables(context.Context, *SearchTablesInput, ...func(*Options)) (*SearchTablesOutput, error) +} + +var _ SearchTablesAPIClient = (*Client)(nil) + +// SearchTablesPaginatorOptions is the paginator options for SearchTables +type SearchTablesPaginatorOptions struct { + // The maximum number of tables to return in a single response. + 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 +} + +// SearchTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/glue.SearchTables +type SearchTablesPaginator struct { + options SearchTablesPaginatorOptions + client SearchTablesAPIClient + params *SearchTablesInput + nextToken *string + firstPage bool +} + +// NewSearchTablesPaginator returns a new SearchTablesPaginator +func NewSearchTablesPaginator(client SearchTablesAPIClient, params *SearchTablesInput, optFns ...func(*SearchTablesPaginatorOptions)) *SearchTablesPaginator { + options := SearchTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchTablesInput{} + } + + return &SearchTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchTables page. +func (p *SearchTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/glue/endpoints.go b/service/glue/endpoints.go index 4c21bdbd2eb..54e4a6a8fa0 100644 --- a/service/glue/endpoints.go +++ b/service/glue/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/greengrass/endpoints.go b/service/greengrass/endpoints.go index b4c6a5a7be6..5f9d786bc18 100644 --- a/service/greengrass/endpoints.go +++ b/service/greengrass/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/groundstation/api_op_ListConfigs.go b/service/groundstation/api_op_ListConfigs.go index 8b200cd909d..04d82ac9c11 100644 --- a/service/groundstation/api_op_ListConfigs.go +++ b/service/groundstation/api_op_ListConfigs.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -105,3 +106,83 @@ func addOperationListConfigsMiddlewares(stack *middleware.Stack, options Options } return nil } + +// ListConfigsAPIClient is a client that implements the ListConfigs operation. +type ListConfigsAPIClient interface { + ListConfigs(context.Context, *ListConfigsInput, ...func(*Options)) (*ListConfigsOutput, error) +} + +var _ ListConfigsAPIClient = (*Client)(nil) + +// ListConfigsPaginatorOptions is the paginator options for ListConfigs +type ListConfigsPaginatorOptions struct { + // Maximum number of Configs returned. + 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 +} + +// ListConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListConfigs +type ListConfigsPaginator struct { + options ListConfigsPaginatorOptions + client ListConfigsAPIClient + params *ListConfigsInput + nextToken *string + firstPage bool +} + +// NewListConfigsPaginator returns a new ListConfigsPaginator +func NewListConfigsPaginator(client ListConfigsAPIClient, params *ListConfigsInput, optFns ...func(*ListConfigsPaginatorOptions)) *ListConfigsPaginator { + options := ListConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigsInput{} + } + + return &ListConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigs page. +func (p *ListConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListContacts.go b/service/groundstation/api_op_ListContacts.go index e7f5b2f4375..12291100bc6 100644 --- a/service/groundstation/api_op_ListContacts.go +++ b/service/groundstation/api_op_ListContacts.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -134,3 +135,83 @@ func addOperationListContactsMiddlewares(stack *middleware.Stack, options Option } return nil } + +// ListContactsAPIClient is a client that implements the ListContacts operation. +type ListContactsAPIClient interface { + ListContacts(context.Context, *ListContactsInput, ...func(*Options)) (*ListContactsOutput, error) +} + +var _ ListContactsAPIClient = (*Client)(nil) + +// ListContactsPaginatorOptions is the paginator options for ListContacts +type ListContactsPaginatorOptions struct { + // Maximum number of contacts returned. + 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 +} + +// ListContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListContacts +type ListContactsPaginator struct { + options ListContactsPaginatorOptions + client ListContactsAPIClient + params *ListContactsInput + nextToken *string + firstPage bool +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactsInput{} + } + + return &ListContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContacts page. +func (p *ListContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListDataflowEndpointGroups.go b/service/groundstation/api_op_ListDataflowEndpointGroups.go index 3e9b84d1c48..96602eb48e8 100644 --- a/service/groundstation/api_op_ListDataflowEndpointGroups.go +++ b/service/groundstation/api_op_ListDataflowEndpointGroups.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -105,3 +106,86 @@ func addOperationListDataflowEndpointGroupsMiddlewares(stack *middleware.Stack, } return nil } + +// ListDataflowEndpointGroupsAPIClient is a client that implements the +// ListDataflowEndpointGroups operation. +type ListDataflowEndpointGroupsAPIClient interface { + ListDataflowEndpointGroups(context.Context, *ListDataflowEndpointGroupsInput, ...func(*Options)) (*ListDataflowEndpointGroupsOutput, error) +} + +var _ ListDataflowEndpointGroupsAPIClient = (*Client)(nil) + +// ListDataflowEndpointGroupsPaginatorOptions is the paginator options for +// ListDataflowEndpointGroups +type ListDataflowEndpointGroupsPaginatorOptions struct { + // Maximum number of dataflow endpoint groups returned. + 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 +} + +// ListDataflowEndpointGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListDataflowEndpointGroups +type ListDataflowEndpointGroupsPaginator struct { + options ListDataflowEndpointGroupsPaginatorOptions + client ListDataflowEndpointGroupsAPIClient + params *ListDataflowEndpointGroupsInput + nextToken *string + firstPage bool +} + +// NewListDataflowEndpointGroupsPaginator returns a new +// ListDataflowEndpointGroupsPaginator +func NewListDataflowEndpointGroupsPaginator(client ListDataflowEndpointGroupsAPIClient, params *ListDataflowEndpointGroupsInput, optFns ...func(*ListDataflowEndpointGroupsPaginatorOptions)) *ListDataflowEndpointGroupsPaginator { + options := ListDataflowEndpointGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataflowEndpointGroupsInput{} + } + + return &ListDataflowEndpointGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataflowEndpointGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataflowEndpointGroups page. +func (p *ListDataflowEndpointGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataflowEndpointGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDataflowEndpointGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListGroundStations.go b/service/groundstation/api_op_ListGroundStations.go index b36f75aa1d2..4b3eff73118 100644 --- a/service/groundstation/api_op_ListGroundStations.go +++ b/service/groundstation/api_op_ListGroundStations.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -108,3 +109,85 @@ func addOperationListGroundStationsMiddlewares(stack *middleware.Stack, options } return nil } + +// ListGroundStationsAPIClient is a client that implements the ListGroundStations +// operation. +type ListGroundStationsAPIClient interface { + ListGroundStations(context.Context, *ListGroundStationsInput, ...func(*Options)) (*ListGroundStationsOutput, error) +} + +var _ ListGroundStationsAPIClient = (*Client)(nil) + +// ListGroundStationsPaginatorOptions is the paginator options for +// ListGroundStations +type ListGroundStationsPaginatorOptions struct { + // Maximum number of ground stations returned. + 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 +} + +// ListGroundStationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListGroundStations +type ListGroundStationsPaginator struct { + options ListGroundStationsPaginatorOptions + client ListGroundStationsAPIClient + params *ListGroundStationsInput + nextToken *string + firstPage bool +} + +// NewListGroundStationsPaginator returns a new ListGroundStationsPaginator +func NewListGroundStationsPaginator(client ListGroundStationsAPIClient, params *ListGroundStationsInput, optFns ...func(*ListGroundStationsPaginatorOptions)) *ListGroundStationsPaginator { + options := ListGroundStationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroundStationsInput{} + } + + return &ListGroundStationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroundStationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroundStations page. +func (p *ListGroundStationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroundStationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroundStations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListMissionProfiles.go b/service/groundstation/api_op_ListMissionProfiles.go index 5d8c672745f..0e838592e6d 100644 --- a/service/groundstation/api_op_ListMissionProfiles.go +++ b/service/groundstation/api_op_ListMissionProfiles.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -105,3 +106,85 @@ func addOperationListMissionProfilesMiddlewares(stack *middleware.Stack, options } return nil } + +// ListMissionProfilesAPIClient is a client that implements the ListMissionProfiles +// operation. +type ListMissionProfilesAPIClient interface { + ListMissionProfiles(context.Context, *ListMissionProfilesInput, ...func(*Options)) (*ListMissionProfilesOutput, error) +} + +var _ ListMissionProfilesAPIClient = (*Client)(nil) + +// ListMissionProfilesPaginatorOptions is the paginator options for +// ListMissionProfiles +type ListMissionProfilesPaginatorOptions struct { + // Maximum number of mission profiles returned. + 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 +} + +// ListMissionProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListMissionProfiles +type ListMissionProfilesPaginator struct { + options ListMissionProfilesPaginatorOptions + client ListMissionProfilesAPIClient + params *ListMissionProfilesInput + nextToken *string + firstPage bool +} + +// NewListMissionProfilesPaginator returns a new ListMissionProfilesPaginator +func NewListMissionProfilesPaginator(client ListMissionProfilesAPIClient, params *ListMissionProfilesInput, optFns ...func(*ListMissionProfilesPaginatorOptions)) *ListMissionProfilesPaginator { + options := ListMissionProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMissionProfilesInput{} + } + + return &ListMissionProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMissionProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMissionProfiles page. +func (p *ListMissionProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMissionProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMissionProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/api_op_ListSatellites.go b/service/groundstation/api_op_ListSatellites.go index 256ee264375..06461e1647f 100644 --- a/service/groundstation/api_op_ListSatellites.go +++ b/service/groundstation/api_op_ListSatellites.go @@ -4,6 +4,7 @@ package groundstation 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/groundstation/types" @@ -105,3 +106,84 @@ func addOperationListSatellitesMiddlewares(stack *middleware.Stack, options Opti } return nil } + +// ListSatellitesAPIClient is a client that implements the ListSatellites +// operation. +type ListSatellitesAPIClient interface { + ListSatellites(context.Context, *ListSatellitesInput, ...func(*Options)) (*ListSatellitesOutput, error) +} + +var _ ListSatellitesAPIClient = (*Client)(nil) + +// ListSatellitesPaginatorOptions is the paginator options for ListSatellites +type ListSatellitesPaginatorOptions struct { + // Maximum number of satellites returned. + 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 +} + +// ListSatellitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/groundstation.ListSatellites +type ListSatellitesPaginator struct { + options ListSatellitesPaginatorOptions + client ListSatellitesAPIClient + params *ListSatellitesInput + nextToken *string + firstPage bool +} + +// NewListSatellitesPaginator returns a new ListSatellitesPaginator +func NewListSatellitesPaginator(client ListSatellitesAPIClient, params *ListSatellitesInput, optFns ...func(*ListSatellitesPaginatorOptions)) *ListSatellitesPaginator { + options := ListSatellitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSatellitesInput{} + } + + return &ListSatellitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSatellitesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSatellites page. +func (p *ListSatellitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSatellitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSatellites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} diff --git a/service/groundstation/endpoints.go b/service/groundstation/endpoints.go index 41e88696173..cfaf661c548 100644 --- a/service/groundstation/endpoints.go +++ b/service/groundstation/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/guardduty/api_op_GetUsageStatistics.go b/service/guardduty/api_op_GetUsageStatistics.go index a99f6bb5f4a..80e5c07f2e9 100644 --- a/service/guardduty/api_op_GetUsageStatistics.go +++ b/service/guardduty/api_op_GetUsageStatistics.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -139,6 +140,88 @@ func addOperationGetUsageStatisticsMiddlewares(stack *middleware.Stack, options return nil } +// GetUsageStatisticsAPIClient is a client that implements the GetUsageStatistics +// operation. +type GetUsageStatisticsAPIClient interface { + GetUsageStatistics(context.Context, *GetUsageStatisticsInput, ...func(*Options)) (*GetUsageStatisticsOutput, error) +} + +var _ GetUsageStatisticsAPIClient = (*Client)(nil) + +// GetUsageStatisticsPaginatorOptions is the paginator options for +// GetUsageStatistics +type GetUsageStatisticsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// GetUsageStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.GetUsageStatistics +type GetUsageStatisticsPaginator struct { + options GetUsageStatisticsPaginatorOptions + client GetUsageStatisticsAPIClient + params *GetUsageStatisticsInput + nextToken *string + firstPage bool +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageStatisticsInput{} + } + + return &GetUsageStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsageStatisticsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUsageStatistics page. +func (p *GetUsageStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetUsageStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListDetectors.go b/service/guardduty/api_op_ListDetectors.go index 80b19b646a1..676d50be7b2 100644 --- a/service/guardduty/api_op_ListDetectors.go +++ b/service/guardduty/api_op_ListDetectors.go @@ -4,6 +4,7 @@ package guardduty 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/awslabs/smithy-go/middleware" @@ -111,6 +112,87 @@ func addOperationListDetectorsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListDetectorsAPIClient is a client that implements the ListDetectors operation. +type ListDetectorsAPIClient interface { + ListDetectors(context.Context, *ListDetectorsInput, ...func(*Options)) (*ListDetectorsOutput, error) +} + +var _ ListDetectorsAPIClient = (*Client)(nil) + +// ListDetectorsPaginatorOptions is the paginator options for ListDetectors +type ListDetectorsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListDetectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListDetectors +type ListDetectorsPaginator struct { + options ListDetectorsPaginatorOptions + client ListDetectorsAPIClient + params *ListDetectorsInput + nextToken *string + firstPage bool +} + +// NewListDetectorsPaginator returns a new ListDetectorsPaginator +func NewListDetectorsPaginator(client ListDetectorsAPIClient, params *ListDetectorsInput, optFns ...func(*ListDetectorsPaginatorOptions)) *ListDetectorsPaginator { + options := ListDetectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDetectorsInput{} + } + + return &ListDetectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDetectorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDetectors page. +func (p *ListDetectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDetectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDetectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDetectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListFilters.go b/service/guardduty/api_op_ListFilters.go index b4e9aac70fb..69622a26909 100644 --- a/service/guardduty/api_op_ListFilters.go +++ b/service/guardduty/api_op_ListFilters.go @@ -4,6 +4,7 @@ package guardduty 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/awslabs/smithy-go/middleware" @@ -119,6 +120,87 @@ func addOperationListFiltersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListFiltersAPIClient is a client that implements the ListFilters operation. +type ListFiltersAPIClient interface { + ListFilters(context.Context, *ListFiltersInput, ...func(*Options)) (*ListFiltersOutput, error) +} + +var _ ListFiltersAPIClient = (*Client)(nil) + +// ListFiltersPaginatorOptions is the paginator options for ListFilters +type ListFiltersPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListFilters +type ListFiltersPaginator struct { + options ListFiltersPaginatorOptions + client ListFiltersAPIClient + params *ListFiltersInput + nextToken *string + firstPage bool +} + +// NewListFiltersPaginator returns a new ListFiltersPaginator +func NewListFiltersPaginator(client ListFiltersAPIClient, params *ListFiltersInput, optFns ...func(*ListFiltersPaginatorOptions)) *ListFiltersPaginator { + options := ListFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFiltersInput{} + } + + return &ListFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFilters page. +func (p *ListFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListFindings.go b/service/guardduty/api_op_ListFindings.go index 6f6111f29c3..dbdf36486da 100644 --- a/service/guardduty/api_op_ListFindings.go +++ b/service/guardduty/api_op_ListFindings.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -265,6 +266,87 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListIPSets.go b/service/guardduty/api_op_ListIPSets.go index 51efaceb878..44f86c5072c 100644 --- a/service/guardduty/api_op_ListIPSets.go +++ b/service/guardduty/api_op_ListIPSets.go @@ -4,6 +4,7 @@ package guardduty 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/awslabs/smithy-go/middleware" @@ -121,6 +122,87 @@ func addOperationListIPSetsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListIPSetsAPIClient is a client that implements the ListIPSets operation. +type ListIPSetsAPIClient interface { + ListIPSets(context.Context, *ListIPSetsInput, ...func(*Options)) (*ListIPSetsOutput, error) +} + +var _ ListIPSetsAPIClient = (*Client)(nil) + +// ListIPSetsPaginatorOptions is the paginator options for ListIPSets +type ListIPSetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListIPSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListIPSets +type ListIPSetsPaginator struct { + options ListIPSetsPaginatorOptions + client ListIPSetsAPIClient + params *ListIPSetsInput + nextToken *string + firstPage bool +} + +// NewListIPSetsPaginator returns a new ListIPSetsPaginator +func NewListIPSetsPaginator(client ListIPSetsAPIClient, params *ListIPSetsInput, optFns ...func(*ListIPSetsPaginatorOptions)) *ListIPSetsPaginator { + options := ListIPSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIPSetsInput{} + } + + return &ListIPSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIPSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIPSets page. +func (p *ListIPSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIPSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListIPSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIPSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListInvitations.go b/service/guardduty/api_op_ListInvitations.go index fae869035bf..c597ac0b152 100644 --- a/service/guardduty/api_op_ListInvitations.go +++ b/service/guardduty/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -111,6 +112,88 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListMembers.go b/service/guardduty/api_op_ListMembers.go index f3a9d4114da..0a73473f1ca 100644 --- a/service/guardduty/api_op_ListMembers.go +++ b/service/guardduty/api_op_ListMembers.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -123,6 +124,87 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListOrganizationAdminAccounts.go b/service/guardduty/api_op_ListOrganizationAdminAccounts.go index 980916d51a9..3f677e6885d 100644 --- a/service/guardduty/api_op_ListOrganizationAdminAccounts.go +++ b/service/guardduty/api_op_ListOrganizationAdminAccounts.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -110,6 +111,89 @@ func addOperationListOrganizationAdminAccountsMiddlewares(stack *middleware.Stac return nil } +// ListOrganizationAdminAccountsAPIClient is a client that implements the +// ListOrganizationAdminAccounts operation. +type ListOrganizationAdminAccountsAPIClient interface { + ListOrganizationAdminAccounts(context.Context, *ListOrganizationAdminAccountsInput, ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) +} + +var _ ListOrganizationAdminAccountsAPIClient = (*Client)(nil) + +// ListOrganizationAdminAccountsPaginatorOptions is the paginator options for +// ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListOrganizationAdminAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginator struct { + options ListOrganizationAdminAccountsPaginatorOptions + client ListOrganizationAdminAccountsAPIClient + params *ListOrganizationAdminAccountsInput + nextToken *string + firstPage bool +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationAdminAccountsInput{} + } + + return &ListOrganizationAdminAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationAdminAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOrganizationAdminAccounts page. +func (p *ListOrganizationAdminAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListOrganizationAdminAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationAdminAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListPublishingDestinations.go b/service/guardduty/api_op_ListPublishingDestinations.go index 66a0b79909a..f9a27c44f1a 100644 --- a/service/guardduty/api_op_ListPublishingDestinations.go +++ b/service/guardduty/api_op_ListPublishingDestinations.go @@ -4,6 +4,7 @@ package guardduty 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/guardduty/types" @@ -123,6 +124,89 @@ func addOperationListPublishingDestinationsMiddlewares(stack *middleware.Stack, return nil } +// ListPublishingDestinationsAPIClient is a client that implements the +// ListPublishingDestinations operation. +type ListPublishingDestinationsAPIClient interface { + ListPublishingDestinations(context.Context, *ListPublishingDestinationsInput, ...func(*Options)) (*ListPublishingDestinationsOutput, error) +} + +var _ ListPublishingDestinationsAPIClient = (*Client)(nil) + +// ListPublishingDestinationsPaginatorOptions is the paginator options for +// ListPublishingDestinations +type ListPublishingDestinationsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListPublishingDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListPublishingDestinations +type ListPublishingDestinationsPaginator struct { + options ListPublishingDestinationsPaginatorOptions + client ListPublishingDestinationsAPIClient + params *ListPublishingDestinationsInput + nextToken *string + firstPage bool +} + +// NewListPublishingDestinationsPaginator returns a new +// ListPublishingDestinationsPaginator +func NewListPublishingDestinationsPaginator(client ListPublishingDestinationsAPIClient, params *ListPublishingDestinationsInput, optFns ...func(*ListPublishingDestinationsPaginatorOptions)) *ListPublishingDestinationsPaginator { + options := ListPublishingDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPublishingDestinationsInput{} + } + + return &ListPublishingDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPublishingDestinationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPublishingDestinations page. +func (p *ListPublishingDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPublishingDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPublishingDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPublishingDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/api_op_ListThreatIntelSets.go b/service/guardduty/api_op_ListThreatIntelSets.go index e86b1a6d30d..21e91046f56 100644 --- a/service/guardduty/api_op_ListThreatIntelSets.go +++ b/service/guardduty/api_op_ListThreatIntelSets.go @@ -4,6 +4,7 @@ package guardduty 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/awslabs/smithy-go/middleware" @@ -121,6 +122,89 @@ func addOperationListThreatIntelSetsMiddlewares(stack *middleware.Stack, options return nil } +// ListThreatIntelSetsAPIClient is a client that implements the ListThreatIntelSets +// operation. +type ListThreatIntelSetsAPIClient interface { + ListThreatIntelSets(context.Context, *ListThreatIntelSetsInput, ...func(*Options)) (*ListThreatIntelSetsOutput, error) +} + +var _ ListThreatIntelSetsAPIClient = (*Client)(nil) + +// ListThreatIntelSetsPaginatorOptions is the paginator options for +// ListThreatIntelSets +type ListThreatIntelSetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 50. The maximum value is 50. + 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 +} + +// ListThreatIntelSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/guardduty.ListThreatIntelSets +type ListThreatIntelSetsPaginator struct { + options ListThreatIntelSetsPaginatorOptions + client ListThreatIntelSetsAPIClient + params *ListThreatIntelSetsInput + nextToken *string + firstPage bool +} + +// NewListThreatIntelSetsPaginator returns a new ListThreatIntelSetsPaginator +func NewListThreatIntelSetsPaginator(client ListThreatIntelSetsAPIClient, params *ListThreatIntelSetsInput, optFns ...func(*ListThreatIntelSetsPaginatorOptions)) *ListThreatIntelSetsPaginator { + options := ListThreatIntelSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThreatIntelSetsInput{} + } + + return &ListThreatIntelSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThreatIntelSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThreatIntelSets page. +func (p *ListThreatIntelSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThreatIntelSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListThreatIntelSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThreatIntelSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/guardduty/endpoints.go b/service/guardduty/endpoints.go index dffd6a595df..a5a32494c3a 100644 --- a/service/guardduty/endpoints.go +++ b/service/guardduty/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/health/api_op_DescribeAffectedAccountsForOrganization.go b/service/health/api_op_DescribeAffectedAccountsForOrganization.go index f6bd2e203b4..5c9cba9c8b3 100644 --- a/service/health/api_op_DescribeAffectedAccountsForOrganization.go +++ b/service/health/api_op_DescribeAffectedAccountsForOrganization.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -151,6 +152,90 @@ func addOperationDescribeAffectedAccountsForOrganizationMiddlewares(stack *middl return nil } +// DescribeAffectedAccountsForOrganizationAPIClient is a client that implements the +// DescribeAffectedAccountsForOrganization operation. +type DescribeAffectedAccountsForOrganizationAPIClient interface { + DescribeAffectedAccountsForOrganization(context.Context, *DescribeAffectedAccountsForOrganizationInput, ...func(*Options)) (*DescribeAffectedAccountsForOrganizationOutput, error) +} + +var _ DescribeAffectedAccountsForOrganizationAPIClient = (*Client)(nil) + +// DescribeAffectedAccountsForOrganizationPaginatorOptions is the paginator options +// for DescribeAffectedAccountsForOrganization +type DescribeAffectedAccountsForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeAffectedAccountsForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedAccountsForOrganization +type DescribeAffectedAccountsForOrganizationPaginator struct { + options DescribeAffectedAccountsForOrganizationPaginatorOptions + client DescribeAffectedAccountsForOrganizationAPIClient + params *DescribeAffectedAccountsForOrganizationInput + nextToken *string + firstPage bool +} + +// NewDescribeAffectedAccountsForOrganizationPaginator returns a new +// DescribeAffectedAccountsForOrganizationPaginator +func NewDescribeAffectedAccountsForOrganizationPaginator(client DescribeAffectedAccountsForOrganizationAPIClient, params *DescribeAffectedAccountsForOrganizationInput, optFns ...func(*DescribeAffectedAccountsForOrganizationPaginatorOptions)) *DescribeAffectedAccountsForOrganizationPaginator { + options := DescribeAffectedAccountsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedAccountsForOrganizationInput{} + } + + return &DescribeAffectedAccountsForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedAccountsForOrganizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAffectedAccountsForOrganization page. +func (p *DescribeAffectedAccountsForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedAccountsForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeAffectedAccountsForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedAccountsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeAffectedEntities.go b/service/health/api_op_DescribeAffectedEntities.go index 258af81132f..175aa8208f2 100644 --- a/service/health/api_op_DescribeAffectedEntities.go +++ b/service/health/api_op_DescribeAffectedEntities.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -134,6 +135,90 @@ func addOperationDescribeAffectedEntitiesMiddlewares(stack *middleware.Stack, op return nil } +// DescribeAffectedEntitiesAPIClient is a client that implements the +// DescribeAffectedEntities operation. +type DescribeAffectedEntitiesAPIClient interface { + DescribeAffectedEntities(context.Context, *DescribeAffectedEntitiesInput, ...func(*Options)) (*DescribeAffectedEntitiesOutput, error) +} + +var _ DescribeAffectedEntitiesAPIClient = (*Client)(nil) + +// DescribeAffectedEntitiesPaginatorOptions is the paginator options for +// DescribeAffectedEntities +type DescribeAffectedEntitiesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeAffectedEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedEntities +type DescribeAffectedEntitiesPaginator struct { + options DescribeAffectedEntitiesPaginatorOptions + client DescribeAffectedEntitiesAPIClient + params *DescribeAffectedEntitiesInput + nextToken *string + firstPage bool +} + +// NewDescribeAffectedEntitiesPaginator returns a new +// DescribeAffectedEntitiesPaginator +func NewDescribeAffectedEntitiesPaginator(client DescribeAffectedEntitiesAPIClient, params *DescribeAffectedEntitiesInput, optFns ...func(*DescribeAffectedEntitiesPaginatorOptions)) *DescribeAffectedEntitiesPaginator { + options := DescribeAffectedEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedEntitiesInput{} + } + + return &DescribeAffectedEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedEntitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAffectedEntities page. +func (p *DescribeAffectedEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeAffectedEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go index b2af490aabf..b47fbf133f8 100644 --- a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go +++ b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -143,6 +144,90 @@ func addOperationDescribeAffectedEntitiesForOrganizationMiddlewares(stack *middl return nil } +// DescribeAffectedEntitiesForOrganizationAPIClient is a client that implements the +// DescribeAffectedEntitiesForOrganization operation. +type DescribeAffectedEntitiesForOrganizationAPIClient interface { + DescribeAffectedEntitiesForOrganization(context.Context, *DescribeAffectedEntitiesForOrganizationInput, ...func(*Options)) (*DescribeAffectedEntitiesForOrganizationOutput, error) +} + +var _ DescribeAffectedEntitiesForOrganizationAPIClient = (*Client)(nil) + +// DescribeAffectedEntitiesForOrganizationPaginatorOptions is the paginator options +// for DescribeAffectedEntitiesForOrganization +type DescribeAffectedEntitiesForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeAffectedEntitiesForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeAffectedEntitiesForOrganization +type DescribeAffectedEntitiesForOrganizationPaginator struct { + options DescribeAffectedEntitiesForOrganizationPaginatorOptions + client DescribeAffectedEntitiesForOrganizationAPIClient + params *DescribeAffectedEntitiesForOrganizationInput + nextToken *string + firstPage bool +} + +// NewDescribeAffectedEntitiesForOrganizationPaginator returns a new +// DescribeAffectedEntitiesForOrganizationPaginator +func NewDescribeAffectedEntitiesForOrganizationPaginator(client DescribeAffectedEntitiesForOrganizationAPIClient, params *DescribeAffectedEntitiesForOrganizationInput, optFns ...func(*DescribeAffectedEntitiesForOrganizationPaginatorOptions)) *DescribeAffectedEntitiesForOrganizationPaginator { + options := DescribeAffectedEntitiesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAffectedEntitiesForOrganizationInput{} + } + + return &DescribeAffectedEntitiesForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAffectedEntitiesForOrganizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAffectedEntitiesForOrganization page. +func (p *DescribeAffectedEntitiesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAffectedEntitiesForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeAffectedEntitiesForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAffectedEntitiesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventAggregates.go b/service/health/api_op_DescribeEventAggregates.go index 605a2d493fc..d1b18e23e31 100644 --- a/service/health/api_op_DescribeEventAggregates.go +++ b/service/health/api_op_DescribeEventAggregates.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -128,6 +129,90 @@ func addOperationDescribeEventAggregatesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeEventAggregatesAPIClient is a client that implements the +// DescribeEventAggregates operation. +type DescribeEventAggregatesAPIClient interface { + DescribeEventAggregates(context.Context, *DescribeEventAggregatesInput, ...func(*Options)) (*DescribeEventAggregatesOutput, error) +} + +var _ DescribeEventAggregatesAPIClient = (*Client)(nil) + +// DescribeEventAggregatesPaginatorOptions is the paginator options for +// DescribeEventAggregates +type DescribeEventAggregatesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeEventAggregatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventAggregates +type DescribeEventAggregatesPaginator struct { + options DescribeEventAggregatesPaginatorOptions + client DescribeEventAggregatesAPIClient + params *DescribeEventAggregatesInput + nextToken *string + firstPage bool +} + +// NewDescribeEventAggregatesPaginator returns a new +// DescribeEventAggregatesPaginator +func NewDescribeEventAggregatesPaginator(client DescribeEventAggregatesAPIClient, params *DescribeEventAggregatesInput, optFns ...func(*DescribeEventAggregatesPaginatorOptions)) *DescribeEventAggregatesPaginator { + options := DescribeEventAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventAggregatesInput{} + } + + return &DescribeEventAggregatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventAggregatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventAggregates page. +func (p *DescribeEventAggregatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventAggregatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEventAggregates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventAggregates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventTypes.go b/service/health/api_op_DescribeEventTypes.go index ab2cbc3294a..f0c5e090423 100644 --- a/service/health/api_op_DescribeEventTypes.go +++ b/service/health/api_op_DescribeEventTypes.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -127,6 +128,89 @@ func addOperationDescribeEventTypesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeEventTypesAPIClient is a client that implements the DescribeEventTypes +// operation. +type DescribeEventTypesAPIClient interface { + DescribeEventTypes(context.Context, *DescribeEventTypesInput, ...func(*Options)) (*DescribeEventTypesOutput, error) +} + +var _ DescribeEventTypesAPIClient = (*Client)(nil) + +// DescribeEventTypesPaginatorOptions is the paginator options for +// DescribeEventTypes +type DescribeEventTypesPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeEventTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventTypes +type DescribeEventTypesPaginator struct { + options DescribeEventTypesPaginatorOptions + client DescribeEventTypesAPIClient + params *DescribeEventTypesInput + nextToken *string + firstPage bool +} + +// NewDescribeEventTypesPaginator returns a new DescribeEventTypesPaginator +func NewDescribeEventTypesPaginator(client DescribeEventTypesAPIClient, params *DescribeEventTypesInput, optFns ...func(*DescribeEventTypesPaginatorOptions)) *DescribeEventTypesPaginator { + options := DescribeEventTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventTypesInput{} + } + + return &DescribeEventTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventTypes page. +func (p *DescribeEventTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEventTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEvents.go b/service/health/api_op_DescribeEvents.go index 3c7f6d9b608..076da70a464 100644 --- a/service/health/api_op_DescribeEvents.go +++ b/service/health/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -143,6 +144,88 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/api_op_DescribeEventsForOrganization.go b/service/health/api_op_DescribeEventsForOrganization.go index 5c828ec13df..a1c01d58744 100644 --- a/service/health/api_op_DescribeEventsForOrganization.go +++ b/service/health/api_op_DescribeEventsForOrganization.go @@ -4,6 +4,7 @@ package health 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/health/types" @@ -150,6 +151,90 @@ func addOperationDescribeEventsForOrganizationMiddlewares(stack *middleware.Stac return nil } +// DescribeEventsForOrganizationAPIClient is a client that implements the +// DescribeEventsForOrganization operation. +type DescribeEventsForOrganizationAPIClient interface { + DescribeEventsForOrganization(context.Context, *DescribeEventsForOrganizationInput, ...func(*Options)) (*DescribeEventsForOrganizationOutput, error) +} + +var _ DescribeEventsForOrganizationAPIClient = (*Client)(nil) + +// DescribeEventsForOrganizationPaginatorOptions is the paginator options for +// DescribeEventsForOrganization +type DescribeEventsForOrganizationPaginatorOptions struct { + // The maximum number of items to return in one batch, between 10 and 100, + // inclusive. + 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 +} + +// DescribeEventsForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/health.DescribeEventsForOrganization +type DescribeEventsForOrganizationPaginator struct { + options DescribeEventsForOrganizationPaginatorOptions + client DescribeEventsForOrganizationAPIClient + params *DescribeEventsForOrganizationInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsForOrganizationPaginator returns a new +// DescribeEventsForOrganizationPaginator +func NewDescribeEventsForOrganizationPaginator(client DescribeEventsForOrganizationAPIClient, params *DescribeEventsForOrganizationInput, optFns ...func(*DescribeEventsForOrganizationPaginatorOptions)) *DescribeEventsForOrganizationPaginator { + options := DescribeEventsForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsForOrganizationInput{} + } + + return &DescribeEventsForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsForOrganizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventsForOrganization page. +func (p *DescribeEventsForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEventsForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventsForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/health/endpoints.go b/service/health/endpoints.go index d27754810d0..ad842a51cca 100644 --- a/service/health/endpoints.go +++ b/service/health/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/honeycode/endpoints.go b/service/honeycode/endpoints.go index 64f40e66b5b..24bfb2a4b1e 100644 --- a/service/honeycode/endpoints.go +++ b/service/honeycode/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iam/api_op_GetAccountAuthorizationDetails.go b/service/iam/api_op_GetAccountAuthorizationDetails.go index 77100b73d83..514be909815 100644 --- a/service/iam/api_op_GetAccountAuthorizationDetails.go +++ b/service/iam/api_op_GetAccountAuthorizationDetails.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -149,6 +150,95 @@ func addOperationGetAccountAuthorizationDetailsMiddlewares(stack *middleware.Sta return nil } +// GetAccountAuthorizationDetailsAPIClient is a client that implements the +// GetAccountAuthorizationDetails operation. +type GetAccountAuthorizationDetailsAPIClient interface { + GetAccountAuthorizationDetails(context.Context, *GetAccountAuthorizationDetailsInput, ...func(*Options)) (*GetAccountAuthorizationDetailsOutput, error) +} + +var _ GetAccountAuthorizationDetailsAPIClient = (*Client)(nil) + +// GetAccountAuthorizationDetailsPaginatorOptions is the paginator options for +// GetAccountAuthorizationDetails +type GetAccountAuthorizationDetailsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// GetAccountAuthorizationDetailsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.GetAccountAuthorizationDetails +type GetAccountAuthorizationDetailsPaginator struct { + options GetAccountAuthorizationDetailsPaginatorOptions + client GetAccountAuthorizationDetailsAPIClient + params *GetAccountAuthorizationDetailsInput + nextToken *string + firstPage bool +} + +// NewGetAccountAuthorizationDetailsPaginator returns a new +// GetAccountAuthorizationDetailsPaginator +func NewGetAccountAuthorizationDetailsPaginator(client GetAccountAuthorizationDetailsAPIClient, params *GetAccountAuthorizationDetailsInput, optFns ...func(*GetAccountAuthorizationDetailsPaginatorOptions)) *GetAccountAuthorizationDetailsPaginator { + options := GetAccountAuthorizationDetailsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAccountAuthorizationDetailsInput{} + } + + return &GetAccountAuthorizationDetailsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAccountAuthorizationDetailsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetAccountAuthorizationDetails page. +func (p *GetAccountAuthorizationDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAccountAuthorizationDetailsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.GetAccountAuthorizationDetails(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAccountAuthorizationDetails(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_GetGroup.go b/service/iam/api_op_GetGroup.go index 20c0649d56f..c1b8f2db881 100644 --- a/service/iam/api_op_GetGroup.go +++ b/service/iam/api_op_GetGroup.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -143,6 +144,92 @@ func addOperationGetGroupMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// GetGroupAPIClient is a client that implements the GetGroup operation. +type GetGroupAPIClient interface { + GetGroup(context.Context, *GetGroupInput, ...func(*Options)) (*GetGroupOutput, error) +} + +var _ GetGroupAPIClient = (*Client)(nil) + +// GetGroupPaginatorOptions is the paginator options for GetGroup +type GetGroupPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// GetGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.GetGroup +type GetGroupPaginator struct { + options GetGroupPaginatorOptions + client GetGroupAPIClient + params *GetGroupInput + nextToken *string + firstPage bool +} + +// NewGetGroupPaginator returns a new GetGroupPaginator +func NewGetGroupPaginator(client GetGroupAPIClient, params *GetGroupInput, optFns ...func(*GetGroupPaginatorOptions)) *GetGroupPaginator { + options := GetGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupInput{} + } + + return &GetGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetGroup page. +func (p *GetGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.GetGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAccessKeys.go b/service/iam/api_op_ListAccessKeys.go index 98cc412051f..2ddb5a57749 100644 --- a/service/iam/api_op_ListAccessKeys.go +++ b/service/iam/api_op_ListAccessKeys.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -141,6 +142,93 @@ func addOperationListAccessKeysMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListAccessKeysAPIClient is a client that implements the ListAccessKeys +// operation. +type ListAccessKeysAPIClient interface { + ListAccessKeys(context.Context, *ListAccessKeysInput, ...func(*Options)) (*ListAccessKeysOutput, error) +} + +var _ ListAccessKeysAPIClient = (*Client)(nil) + +// ListAccessKeysPaginatorOptions is the paginator options for ListAccessKeys +type ListAccessKeysPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListAccessKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAccessKeys +type ListAccessKeysPaginator struct { + options ListAccessKeysPaginatorOptions + client ListAccessKeysAPIClient + params *ListAccessKeysInput + nextToken *string + firstPage bool +} + +// NewListAccessKeysPaginator returns a new ListAccessKeysPaginator +func NewListAccessKeysPaginator(client ListAccessKeysAPIClient, params *ListAccessKeysInput, optFns ...func(*ListAccessKeysPaginatorOptions)) *ListAccessKeysPaginator { + options := ListAccessKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessKeysInput{} + } + + return &ListAccessKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccessKeys page. +func (p *ListAccessKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAccessKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccessKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAccountAliases.go b/service/iam/api_op_ListAccountAliases.go index a1f89e10047..74dc310bfe3 100644 --- a/service/iam/api_op_ListAccountAliases.go +++ b/service/iam/api_op_ListAccountAliases.go @@ -4,6 +4,7 @@ package iam 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/awslabs/smithy-go/middleware" @@ -130,6 +131,94 @@ func addOperationListAccountAliasesMiddlewares(stack *middleware.Stack, options return nil } +// ListAccountAliasesAPIClient is a client that implements the ListAccountAliases +// operation. +type ListAccountAliasesAPIClient interface { + ListAccountAliases(context.Context, *ListAccountAliasesInput, ...func(*Options)) (*ListAccountAliasesOutput, error) +} + +var _ ListAccountAliasesAPIClient = (*Client)(nil) + +// ListAccountAliasesPaginatorOptions is the paginator options for +// ListAccountAliases +type ListAccountAliasesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListAccountAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAccountAliases +type ListAccountAliasesPaginator struct { + options ListAccountAliasesPaginatorOptions + client ListAccountAliasesAPIClient + params *ListAccountAliasesInput + nextToken *string + firstPage bool +} + +// NewListAccountAliasesPaginator returns a new ListAccountAliasesPaginator +func NewListAccountAliasesPaginator(client ListAccountAliasesAPIClient, params *ListAccountAliasesInput, optFns ...func(*ListAccountAliasesPaginatorOptions)) *ListAccountAliasesPaginator { + options := ListAccountAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAliasesInput{} + } + + return &ListAccountAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountAliases page. +func (p *ListAccountAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAccountAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedGroupPolicies.go b/service/iam/api_op_ListAttachedGroupPolicies.go index 05058684218..7b65cbe5f5f 100644 --- a/service/iam/api_op_ListAttachedGroupPolicies.go +++ b/service/iam/api_op_ListAttachedGroupPolicies.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -154,6 +155,95 @@ func addOperationListAttachedGroupPoliciesMiddlewares(stack *middleware.Stack, o return nil } +// ListAttachedGroupPoliciesAPIClient is a client that implements the +// ListAttachedGroupPolicies operation. +type ListAttachedGroupPoliciesAPIClient interface { + ListAttachedGroupPolicies(context.Context, *ListAttachedGroupPoliciesInput, ...func(*Options)) (*ListAttachedGroupPoliciesOutput, error) +} + +var _ ListAttachedGroupPoliciesAPIClient = (*Client)(nil) + +// ListAttachedGroupPoliciesPaginatorOptions is the paginator options for +// ListAttachedGroupPolicies +type ListAttachedGroupPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListAttachedGroupPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedGroupPolicies +type ListAttachedGroupPoliciesPaginator struct { + options ListAttachedGroupPoliciesPaginatorOptions + client ListAttachedGroupPoliciesAPIClient + params *ListAttachedGroupPoliciesInput + nextToken *string + firstPage bool +} + +// NewListAttachedGroupPoliciesPaginator returns a new +// ListAttachedGroupPoliciesPaginator +func NewListAttachedGroupPoliciesPaginator(client ListAttachedGroupPoliciesAPIClient, params *ListAttachedGroupPoliciesInput, optFns ...func(*ListAttachedGroupPoliciesPaginatorOptions)) *ListAttachedGroupPoliciesPaginator { + options := ListAttachedGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedGroupPoliciesInput{} + } + + return &ListAttachedGroupPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedGroupPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttachedGroupPolicies page. +func (p *ListAttachedGroupPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedGroupPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAttachedGroupPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedGroupPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedRolePolicies.go b/service/iam/api_op_ListAttachedRolePolicies.go index 391ad5003df..2d17708b42e 100644 --- a/service/iam/api_op_ListAttachedRolePolicies.go +++ b/service/iam/api_op_ListAttachedRolePolicies.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -154,6 +155,95 @@ func addOperationListAttachedRolePoliciesMiddlewares(stack *middleware.Stack, op return nil } +// ListAttachedRolePoliciesAPIClient is a client that implements the +// ListAttachedRolePolicies operation. +type ListAttachedRolePoliciesAPIClient interface { + ListAttachedRolePolicies(context.Context, *ListAttachedRolePoliciesInput, ...func(*Options)) (*ListAttachedRolePoliciesOutput, error) +} + +var _ ListAttachedRolePoliciesAPIClient = (*Client)(nil) + +// ListAttachedRolePoliciesPaginatorOptions is the paginator options for +// ListAttachedRolePolicies +type ListAttachedRolePoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListAttachedRolePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedRolePolicies +type ListAttachedRolePoliciesPaginator struct { + options ListAttachedRolePoliciesPaginatorOptions + client ListAttachedRolePoliciesAPIClient + params *ListAttachedRolePoliciesInput + nextToken *string + firstPage bool +} + +// NewListAttachedRolePoliciesPaginator returns a new +// ListAttachedRolePoliciesPaginator +func NewListAttachedRolePoliciesPaginator(client ListAttachedRolePoliciesAPIClient, params *ListAttachedRolePoliciesInput, optFns ...func(*ListAttachedRolePoliciesPaginatorOptions)) *ListAttachedRolePoliciesPaginator { + options := ListAttachedRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedRolePoliciesInput{} + } + + return &ListAttachedRolePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedRolePoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttachedRolePolicies page. +func (p *ListAttachedRolePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedRolePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAttachedRolePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedRolePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListAttachedUserPolicies.go b/service/iam/api_op_ListAttachedUserPolicies.go index 6a8c8dc29d7..7e9bf15a3b7 100644 --- a/service/iam/api_op_ListAttachedUserPolicies.go +++ b/service/iam/api_op_ListAttachedUserPolicies.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -154,6 +155,95 @@ func addOperationListAttachedUserPoliciesMiddlewares(stack *middleware.Stack, op return nil } +// ListAttachedUserPoliciesAPIClient is a client that implements the +// ListAttachedUserPolicies operation. +type ListAttachedUserPoliciesAPIClient interface { + ListAttachedUserPolicies(context.Context, *ListAttachedUserPoliciesInput, ...func(*Options)) (*ListAttachedUserPoliciesOutput, error) +} + +var _ ListAttachedUserPoliciesAPIClient = (*Client)(nil) + +// ListAttachedUserPoliciesPaginatorOptions is the paginator options for +// ListAttachedUserPolicies +type ListAttachedUserPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListAttachedUserPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListAttachedUserPolicies +type ListAttachedUserPoliciesPaginator struct { + options ListAttachedUserPoliciesPaginatorOptions + client ListAttachedUserPoliciesAPIClient + params *ListAttachedUserPoliciesInput + nextToken *string + firstPage bool +} + +// NewListAttachedUserPoliciesPaginator returns a new +// ListAttachedUserPoliciesPaginator +func NewListAttachedUserPoliciesPaginator(client ListAttachedUserPoliciesAPIClient, params *ListAttachedUserPoliciesInput, optFns ...func(*ListAttachedUserPoliciesPaginatorOptions)) *ListAttachedUserPoliciesPaginator { + options := ListAttachedUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedUserPoliciesInput{} + } + + return &ListAttachedUserPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedUserPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttachedUserPolicies page. +func (p *ListAttachedUserPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedUserPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAttachedUserPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedUserPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListEntitiesForPolicy.go b/service/iam/api_op_ListEntitiesForPolicy.go index 48ffe05b23b..ebf04366d7d 100644 --- a/service/iam/api_op_ListEntitiesForPolicy.go +++ b/service/iam/api_op_ListEntitiesForPolicy.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -170,6 +171,94 @@ func addOperationListEntitiesForPolicyMiddlewares(stack *middleware.Stack, optio return nil } +// ListEntitiesForPolicyAPIClient is a client that implements the +// ListEntitiesForPolicy operation. +type ListEntitiesForPolicyAPIClient interface { + ListEntitiesForPolicy(context.Context, *ListEntitiesForPolicyInput, ...func(*Options)) (*ListEntitiesForPolicyOutput, error) +} + +var _ ListEntitiesForPolicyAPIClient = (*Client)(nil) + +// ListEntitiesForPolicyPaginatorOptions is the paginator options for +// ListEntitiesForPolicy +type ListEntitiesForPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListEntitiesForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListEntitiesForPolicy +type ListEntitiesForPolicyPaginator struct { + options ListEntitiesForPolicyPaginatorOptions + client ListEntitiesForPolicyAPIClient + params *ListEntitiesForPolicyInput + nextToken *string + firstPage bool +} + +// NewListEntitiesForPolicyPaginator returns a new ListEntitiesForPolicyPaginator +func NewListEntitiesForPolicyPaginator(client ListEntitiesForPolicyAPIClient, params *ListEntitiesForPolicyInput, optFns ...func(*ListEntitiesForPolicyPaginatorOptions)) *ListEntitiesForPolicyPaginator { + options := ListEntitiesForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesForPolicyInput{} + } + + return &ListEntitiesForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesForPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEntitiesForPolicy page. +func (p *ListEntitiesForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListEntitiesForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitiesForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroupPolicies.go b/service/iam/api_op_ListGroupPolicies.go index 271c13c0f93..b4db19eab2f 100644 --- a/service/iam/api_op_ListGroupPolicies.go +++ b/service/iam/api_op_ListGroupPolicies.go @@ -4,6 +4,7 @@ package iam 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/awslabs/smithy-go/middleware" @@ -146,6 +147,93 @@ func addOperationListGroupPoliciesMiddlewares(stack *middleware.Stack, options O return nil } +// ListGroupPoliciesAPIClient is a client that implements the ListGroupPolicies +// operation. +type ListGroupPoliciesAPIClient interface { + ListGroupPolicies(context.Context, *ListGroupPoliciesInput, ...func(*Options)) (*ListGroupPoliciesOutput, error) +} + +var _ ListGroupPoliciesAPIClient = (*Client)(nil) + +// ListGroupPoliciesPaginatorOptions is the paginator options for ListGroupPolicies +type ListGroupPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListGroupPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroupPolicies +type ListGroupPoliciesPaginator struct { + options ListGroupPoliciesPaginatorOptions + client ListGroupPoliciesAPIClient + params *ListGroupPoliciesInput + nextToken *string + firstPage bool +} + +// NewListGroupPoliciesPaginator returns a new ListGroupPoliciesPaginator +func NewListGroupPoliciesPaginator(client ListGroupPoliciesAPIClient, params *ListGroupPoliciesInput, optFns ...func(*ListGroupPoliciesPaginatorOptions)) *ListGroupPoliciesPaginator { + options := ListGroupPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupPoliciesInput{} + } + + return &ListGroupPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroupPolicies page. +func (p *ListGroupPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListGroupPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroups.go b/service/iam/api_op_ListGroups.go index b6b2fdc6371..503d4a7072e 100644 --- a/service/iam/api_op_ListGroups.go +++ b/service/iam/api_op_ListGroups.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -138,6 +139,92 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListGroupsForUser.go b/service/iam/api_op_ListGroupsForUser.go index 87ac764dc58..34ec62b3ba3 100644 --- a/service/iam/api_op_ListGroupsForUser.go +++ b/service/iam/api_op_ListGroupsForUser.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -138,6 +139,93 @@ func addOperationListGroupsForUserMiddlewares(stack *middleware.Stack, options O return nil } +// ListGroupsForUserAPIClient is a client that implements the ListGroupsForUser +// operation. +type ListGroupsForUserAPIClient interface { + ListGroupsForUser(context.Context, *ListGroupsForUserInput, ...func(*Options)) (*ListGroupsForUserOutput, error) +} + +var _ ListGroupsForUserAPIClient = (*Client)(nil) + +// ListGroupsForUserPaginatorOptions is the paginator options for ListGroupsForUser +type ListGroupsForUserPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListGroupsForUserPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListGroupsForUser +type ListGroupsForUserPaginator struct { + options ListGroupsForUserPaginatorOptions + client ListGroupsForUserAPIClient + params *ListGroupsForUserInput + nextToken *string + firstPage bool +} + +// NewListGroupsForUserPaginator returns a new ListGroupsForUserPaginator +func NewListGroupsForUserPaginator(client ListGroupsForUserAPIClient, params *ListGroupsForUserInput, optFns ...func(*ListGroupsForUserPaginatorOptions)) *ListGroupsForUserPaginator { + options := ListGroupsForUserPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsForUserInput{} + } + + return &ListGroupsForUserPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsForUserPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroupsForUser page. +func (p *ListGroupsForUserPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsForUserOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListGroupsForUser(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupsForUser(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListInstanceProfiles.go b/service/iam/api_op_ListInstanceProfiles.go index 2f58197517d..357251b2ccb 100644 --- a/service/iam/api_op_ListInstanceProfiles.go +++ b/service/iam/api_op_ListInstanceProfiles.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -141,6 +142,94 @@ func addOperationListInstanceProfilesMiddlewares(stack *middleware.Stack, option return nil } +// ListInstanceProfilesAPIClient is a client that implements the +// ListInstanceProfiles operation. +type ListInstanceProfilesAPIClient interface { + ListInstanceProfiles(context.Context, *ListInstanceProfilesInput, ...func(*Options)) (*ListInstanceProfilesOutput, error) +} + +var _ ListInstanceProfilesAPIClient = (*Client)(nil) + +// ListInstanceProfilesPaginatorOptions is the paginator options for +// ListInstanceProfiles +type ListInstanceProfilesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListInstanceProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListInstanceProfiles +type ListInstanceProfilesPaginator struct { + options ListInstanceProfilesPaginatorOptions + client ListInstanceProfilesAPIClient + params *ListInstanceProfilesInput + nextToken *string + firstPage bool +} + +// NewListInstanceProfilesPaginator returns a new ListInstanceProfilesPaginator +func NewListInstanceProfilesPaginator(client ListInstanceProfilesAPIClient, params *ListInstanceProfilesInput, optFns ...func(*ListInstanceProfilesPaginatorOptions)) *ListInstanceProfilesPaginator { + options := ListInstanceProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceProfilesInput{} + } + + return &ListInstanceProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstanceProfiles page. +func (p *ListInstanceProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListInstanceProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListInstanceProfilesForRole.go b/service/iam/api_op_ListInstanceProfilesForRole.go index 7a58b73cada..fdfaf0d32a7 100644 --- a/service/iam/api_op_ListInstanceProfilesForRole.go +++ b/service/iam/api_op_ListInstanceProfilesForRole.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -141,6 +142,95 @@ func addOperationListInstanceProfilesForRoleMiddlewares(stack *middleware.Stack, return nil } +// ListInstanceProfilesForRoleAPIClient is a client that implements the +// ListInstanceProfilesForRole operation. +type ListInstanceProfilesForRoleAPIClient interface { + ListInstanceProfilesForRole(context.Context, *ListInstanceProfilesForRoleInput, ...func(*Options)) (*ListInstanceProfilesForRoleOutput, error) +} + +var _ ListInstanceProfilesForRoleAPIClient = (*Client)(nil) + +// ListInstanceProfilesForRolePaginatorOptions is the paginator options for +// ListInstanceProfilesForRole +type ListInstanceProfilesForRolePaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListInstanceProfilesForRolePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListInstanceProfilesForRole +type ListInstanceProfilesForRolePaginator struct { + options ListInstanceProfilesForRolePaginatorOptions + client ListInstanceProfilesForRoleAPIClient + params *ListInstanceProfilesForRoleInput + nextToken *string + firstPage bool +} + +// NewListInstanceProfilesForRolePaginator returns a new +// ListInstanceProfilesForRolePaginator +func NewListInstanceProfilesForRolePaginator(client ListInstanceProfilesForRoleAPIClient, params *ListInstanceProfilesForRoleInput, optFns ...func(*ListInstanceProfilesForRolePaginatorOptions)) *ListInstanceProfilesForRolePaginator { + options := ListInstanceProfilesForRolePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstanceProfilesForRoleInput{} + } + + return &ListInstanceProfilesForRolePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstanceProfilesForRolePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstanceProfilesForRole page. +func (p *ListInstanceProfilesForRolePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstanceProfilesForRoleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListInstanceProfilesForRole(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstanceProfilesForRole(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListMFADevices.go b/service/iam/api_op_ListMFADevices.go index 2ef3b6d3a29..b56cf63fca4 100644 --- a/service/iam/api_op_ListMFADevices.go +++ b/service/iam/api_op_ListMFADevices.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -136,6 +137,93 @@ func addOperationListMFADevicesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListMFADevicesAPIClient is a client that implements the ListMFADevices +// operation. +type ListMFADevicesAPIClient interface { + ListMFADevices(context.Context, *ListMFADevicesInput, ...func(*Options)) (*ListMFADevicesOutput, error) +} + +var _ ListMFADevicesAPIClient = (*Client)(nil) + +// ListMFADevicesPaginatorOptions is the paginator options for ListMFADevices +type ListMFADevicesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListMFADevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListMFADevices +type ListMFADevicesPaginator struct { + options ListMFADevicesPaginatorOptions + client ListMFADevicesAPIClient + params *ListMFADevicesInput + nextToken *string + firstPage bool +} + +// NewListMFADevicesPaginator returns a new ListMFADevicesPaginator +func NewListMFADevicesPaginator(client ListMFADevicesAPIClient, params *ListMFADevicesInput, optFns ...func(*ListMFADevicesPaginatorOptions)) *ListMFADevicesPaginator { + options := ListMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMFADevicesInput{} + } + + return &ListMFADevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMFADevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMFADevices page. +func (p *ListMFADevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMFADevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListMFADevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMFADevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListPolicies.go b/service/iam/api_op_ListPolicies.go index d96f4cbd609..82d0360a177 100644 --- a/service/iam/api_op_ListPolicies.go +++ b/service/iam/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -161,6 +162,92 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListPolicyVersions.go b/service/iam/api_op_ListPolicyVersions.go index 808618503b7..a023d40b190 100644 --- a/service/iam/api_op_ListPolicyVersions.go +++ b/service/iam/api_op_ListPolicyVersions.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -143,6 +144,94 @@ func addOperationListPolicyVersionsMiddlewares(stack *middleware.Stack, options return nil } +// ListPolicyVersionsAPIClient is a client that implements the ListPolicyVersions +// operation. +type ListPolicyVersionsAPIClient interface { + ListPolicyVersions(context.Context, *ListPolicyVersionsInput, ...func(*Options)) (*ListPolicyVersionsOutput, error) +} + +var _ ListPolicyVersionsAPIClient = (*Client)(nil) + +// ListPolicyVersionsPaginatorOptions is the paginator options for +// ListPolicyVersions +type ListPolicyVersionsPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListPolicyVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListPolicyVersions +type ListPolicyVersionsPaginator struct { + options ListPolicyVersionsPaginatorOptions + client ListPolicyVersionsAPIClient + params *ListPolicyVersionsInput + nextToken *string + firstPage bool +} + +// NewListPolicyVersionsPaginator returns a new ListPolicyVersionsPaginator +func NewListPolicyVersionsPaginator(client ListPolicyVersionsAPIClient, params *ListPolicyVersionsInput, optFns ...func(*ListPolicyVersionsPaginatorOptions)) *ListPolicyVersionsPaginator { + options := ListPolicyVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyVersionsInput{} + } + + return &ListPolicyVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicyVersions page. +func (p *ListPolicyVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListPolicyVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListRolePolicies.go b/service/iam/api_op_ListRolePolicies.go index 3b88821fc43..2bed503dff9 100644 --- a/service/iam/api_op_ListRolePolicies.go +++ b/service/iam/api_op_ListRolePolicies.go @@ -4,6 +4,7 @@ package iam 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/awslabs/smithy-go/middleware" @@ -143,6 +144,93 @@ func addOperationListRolePoliciesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListRolePoliciesAPIClient is a client that implements the ListRolePolicies +// operation. +type ListRolePoliciesAPIClient interface { + ListRolePolicies(context.Context, *ListRolePoliciesInput, ...func(*Options)) (*ListRolePoliciesOutput, error) +} + +var _ ListRolePoliciesAPIClient = (*Client)(nil) + +// ListRolePoliciesPaginatorOptions is the paginator options for ListRolePolicies +type ListRolePoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListRolePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListRolePolicies +type ListRolePoliciesPaginator struct { + options ListRolePoliciesPaginatorOptions + client ListRolePoliciesAPIClient + params *ListRolePoliciesInput + nextToken *string + firstPage bool +} + +// NewListRolePoliciesPaginator returns a new ListRolePoliciesPaginator +func NewListRolePoliciesPaginator(client ListRolePoliciesAPIClient, params *ListRolePoliciesInput, optFns ...func(*ListRolePoliciesPaginatorOptions)) *ListRolePoliciesPaginator { + options := ListRolePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRolePoliciesInput{} + } + + return &ListRolePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRolePoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRolePolicies page. +func (p *ListRolePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRolePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListRolePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRolePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListRoles.go b/service/iam/api_op_ListRoles.go index dc1c964d132..d555f9dd922 100644 --- a/service/iam/api_op_ListRoles.go +++ b/service/iam/api_op_ListRoles.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -141,6 +142,92 @@ func addOperationListRolesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListRolesAPIClient is a client that implements the ListRoles operation. +type ListRolesAPIClient interface { + ListRoles(context.Context, *ListRolesInput, ...func(*Options)) (*ListRolesOutput, error) +} + +var _ ListRolesAPIClient = (*Client)(nil) + +// ListRolesPaginatorOptions is the paginator options for ListRoles +type ListRolesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListRolesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListRoles +type ListRolesPaginator struct { + options ListRolesPaginatorOptions + client ListRolesAPIClient + params *ListRolesInput + nextToken *string + firstPage bool +} + +// NewListRolesPaginator returns a new ListRolesPaginator +func NewListRolesPaginator(client ListRolesAPIClient, params *ListRolesInput, optFns ...func(*ListRolesPaginatorOptions)) *ListRolesPaginator { + options := ListRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRolesInput{} + } + + return &ListRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRolesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoles page. +func (p *ListRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListSSHPublicKeys.go b/service/iam/api_op_ListSSHPublicKeys.go index 988ecedc6c5..5164b712c5e 100644 --- a/service/iam/api_op_ListSSHPublicKeys.go +++ b/service/iam/api_op_ListSSHPublicKeys.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -141,6 +142,93 @@ func addOperationListSSHPublicKeysMiddlewares(stack *middleware.Stack, options O return nil } +// ListSSHPublicKeysAPIClient is a client that implements the ListSSHPublicKeys +// operation. +type ListSSHPublicKeysAPIClient interface { + ListSSHPublicKeys(context.Context, *ListSSHPublicKeysInput, ...func(*Options)) (*ListSSHPublicKeysOutput, error) +} + +var _ ListSSHPublicKeysAPIClient = (*Client)(nil) + +// ListSSHPublicKeysPaginatorOptions is the paginator options for ListSSHPublicKeys +type ListSSHPublicKeysPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListSSHPublicKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListSSHPublicKeys +type ListSSHPublicKeysPaginator struct { + options ListSSHPublicKeysPaginatorOptions + client ListSSHPublicKeysAPIClient + params *ListSSHPublicKeysInput + nextToken *string + firstPage bool +} + +// NewListSSHPublicKeysPaginator returns a new ListSSHPublicKeysPaginator +func NewListSSHPublicKeysPaginator(client ListSSHPublicKeysAPIClient, params *ListSSHPublicKeysInput, optFns ...func(*ListSSHPublicKeysPaginatorOptions)) *ListSSHPublicKeysPaginator { + options := ListSSHPublicKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSSHPublicKeysInput{} + } + + return &ListSSHPublicKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSSHPublicKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSSHPublicKeys page. +func (p *ListSSHPublicKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSSHPublicKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListSSHPublicKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSSHPublicKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListServerCertificates.go b/service/iam/api_op_ListServerCertificates.go index 55c7e935b00..fb9f6290676 100644 --- a/service/iam/api_op_ListServerCertificates.go +++ b/service/iam/api_op_ListServerCertificates.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -143,6 +144,94 @@ func addOperationListServerCertificatesMiddlewares(stack *middleware.Stack, opti return nil } +// ListServerCertificatesAPIClient is a client that implements the +// ListServerCertificates operation. +type ListServerCertificatesAPIClient interface { + ListServerCertificates(context.Context, *ListServerCertificatesInput, ...func(*Options)) (*ListServerCertificatesOutput, error) +} + +var _ ListServerCertificatesAPIClient = (*Client)(nil) + +// ListServerCertificatesPaginatorOptions is the paginator options for +// ListServerCertificates +type ListServerCertificatesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListServerCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListServerCertificates +type ListServerCertificatesPaginator struct { + options ListServerCertificatesPaginatorOptions + client ListServerCertificatesAPIClient + params *ListServerCertificatesInput + nextToken *string + firstPage bool +} + +// NewListServerCertificatesPaginator returns a new ListServerCertificatesPaginator +func NewListServerCertificatesPaginator(client ListServerCertificatesAPIClient, params *ListServerCertificatesInput, optFns ...func(*ListServerCertificatesPaginatorOptions)) *ListServerCertificatesPaginator { + options := ListServerCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServerCertificatesInput{} + } + + return &ListServerCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServerCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServerCertificates page. +func (p *ListServerCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServerCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListServerCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServerCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListSigningCertificates.go b/service/iam/api_op_ListSigningCertificates.go index 7488e0f552f..2e18ec2cc02 100644 --- a/service/iam/api_op_ListSigningCertificates.go +++ b/service/iam/api_op_ListSigningCertificates.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -140,6 +141,95 @@ func addOperationListSigningCertificatesMiddlewares(stack *middleware.Stack, opt return nil } +// ListSigningCertificatesAPIClient is a client that implements the +// ListSigningCertificates operation. +type ListSigningCertificatesAPIClient interface { + ListSigningCertificates(context.Context, *ListSigningCertificatesInput, ...func(*Options)) (*ListSigningCertificatesOutput, error) +} + +var _ ListSigningCertificatesAPIClient = (*Client)(nil) + +// ListSigningCertificatesPaginatorOptions is the paginator options for +// ListSigningCertificates +type ListSigningCertificatesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListSigningCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListSigningCertificates +type ListSigningCertificatesPaginator struct { + options ListSigningCertificatesPaginatorOptions + client ListSigningCertificatesAPIClient + params *ListSigningCertificatesInput + nextToken *string + firstPage bool +} + +// NewListSigningCertificatesPaginator returns a new +// ListSigningCertificatesPaginator +func NewListSigningCertificatesPaginator(client ListSigningCertificatesAPIClient, params *ListSigningCertificatesInput, optFns ...func(*ListSigningCertificatesPaginatorOptions)) *ListSigningCertificatesPaginator { + options := ListSigningCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningCertificatesInput{} + } + + return &ListSigningCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSigningCertificates page. +func (p *ListSigningCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListSigningCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListUserPolicies.go b/service/iam/api_op_ListUserPolicies.go index b7fad8fc9e9..3bfb1db1488 100644 --- a/service/iam/api_op_ListUserPolicies.go +++ b/service/iam/api_op_ListUserPolicies.go @@ -4,6 +4,7 @@ package iam 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/awslabs/smithy-go/middleware" @@ -143,6 +144,93 @@ func addOperationListUserPoliciesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListUserPoliciesAPIClient is a client that implements the ListUserPolicies +// operation. +type ListUserPoliciesAPIClient interface { + ListUserPolicies(context.Context, *ListUserPoliciesInput, ...func(*Options)) (*ListUserPoliciesOutput, error) +} + +var _ ListUserPoliciesAPIClient = (*Client)(nil) + +// ListUserPoliciesPaginatorOptions is the paginator options for ListUserPolicies +type ListUserPoliciesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListUserPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListUserPolicies +type ListUserPoliciesPaginator struct { + options ListUserPoliciesPaginatorOptions + client ListUserPoliciesAPIClient + params *ListUserPoliciesInput + nextToken *string + firstPage bool +} + +// NewListUserPoliciesPaginator returns a new ListUserPoliciesPaginator +func NewListUserPoliciesPaginator(client ListUserPoliciesAPIClient, params *ListUserPoliciesInput, optFns ...func(*ListUserPoliciesPaginatorOptions)) *ListUserPoliciesPaginator { + options := ListUserPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserPoliciesInput{} + } + + return &ListUserPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUserPolicies page. +func (p *ListUserPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListUserPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListUsers.go b/service/iam/api_op_ListUsers.go index a1b8e097464..a8fbe9eb9f7 100644 --- a/service/iam/api_op_ListUsers.go +++ b/service/iam/api_op_ListUsers.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -140,6 +141,92 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_ListVirtualMFADevices.go b/service/iam/api_op_ListVirtualMFADevices.go index c455b9ef536..92f46512e27 100644 --- a/service/iam/api_op_ListVirtualMFADevices.go +++ b/service/iam/api_op_ListVirtualMFADevices.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -135,6 +136,94 @@ func addOperationListVirtualMFADevicesMiddlewares(stack *middleware.Stack, optio return nil } +// ListVirtualMFADevicesAPIClient is a client that implements the +// ListVirtualMFADevices operation. +type ListVirtualMFADevicesAPIClient interface { + ListVirtualMFADevices(context.Context, *ListVirtualMFADevicesInput, ...func(*Options)) (*ListVirtualMFADevicesOutput, error) +} + +var _ ListVirtualMFADevicesAPIClient = (*Client)(nil) + +// ListVirtualMFADevicesPaginatorOptions is the paginator options for +// ListVirtualMFADevices +type ListVirtualMFADevicesPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// ListVirtualMFADevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.ListVirtualMFADevices +type ListVirtualMFADevicesPaginator struct { + options ListVirtualMFADevicesPaginatorOptions + client ListVirtualMFADevicesAPIClient + params *ListVirtualMFADevicesInput + nextToken *string + firstPage bool +} + +// NewListVirtualMFADevicesPaginator returns a new ListVirtualMFADevicesPaginator +func NewListVirtualMFADevicesPaginator(client ListVirtualMFADevicesAPIClient, params *ListVirtualMFADevicesInput, optFns ...func(*ListVirtualMFADevicesPaginatorOptions)) *ListVirtualMFADevicesPaginator { + options := ListVirtualMFADevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVirtualMFADevicesInput{} + } + + return &ListVirtualMFADevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVirtualMFADevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVirtualMFADevices page. +func (p *ListVirtualMFADevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVirtualMFADevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListVirtualMFADevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVirtualMFADevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_SimulateCustomPolicy.go b/service/iam/api_op_SimulateCustomPolicy.go index a83a54ea81e..e76e507759b 100644 --- a/service/iam/api_op_SimulateCustomPolicy.go +++ b/service/iam/api_op_SimulateCustomPolicy.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -289,6 +290,94 @@ func addOperationSimulateCustomPolicyMiddlewares(stack *middleware.Stack, option return nil } +// SimulateCustomPolicyAPIClient is a client that implements the +// SimulateCustomPolicy operation. +type SimulateCustomPolicyAPIClient interface { + SimulateCustomPolicy(context.Context, *SimulateCustomPolicyInput, ...func(*Options)) (*SimulateCustomPolicyOutput, error) +} + +var _ SimulateCustomPolicyAPIClient = (*Client)(nil) + +// SimulateCustomPolicyPaginatorOptions is the paginator options for +// SimulateCustomPolicy +type SimulateCustomPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// SimulateCustomPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.SimulateCustomPolicy +type SimulateCustomPolicyPaginator struct { + options SimulateCustomPolicyPaginatorOptions + client SimulateCustomPolicyAPIClient + params *SimulateCustomPolicyInput + nextToken *string + firstPage bool +} + +// NewSimulateCustomPolicyPaginator returns a new SimulateCustomPolicyPaginator +func NewSimulateCustomPolicyPaginator(client SimulateCustomPolicyAPIClient, params *SimulateCustomPolicyInput, optFns ...func(*SimulateCustomPolicyPaginatorOptions)) *SimulateCustomPolicyPaginator { + options := SimulateCustomPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SimulateCustomPolicyInput{} + } + + return &SimulateCustomPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SimulateCustomPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SimulateCustomPolicy page. +func (p *SimulateCustomPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SimulateCustomPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.SimulateCustomPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSimulateCustomPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/api_op_SimulatePrincipalPolicy.go b/service/iam/api_op_SimulatePrincipalPolicy.go index 5958b6e9681..d90d3290d48 100644 --- a/service/iam/api_op_SimulatePrincipalPolicy.go +++ b/service/iam/api_op_SimulatePrincipalPolicy.go @@ -4,6 +4,7 @@ package iam 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/iam/types" @@ -306,6 +307,95 @@ func addOperationSimulatePrincipalPolicyMiddlewares(stack *middleware.Stack, opt return nil } +// SimulatePrincipalPolicyAPIClient is a client that implements the +// SimulatePrincipalPolicy operation. +type SimulatePrincipalPolicyAPIClient interface { + SimulatePrincipalPolicy(context.Context, *SimulatePrincipalPolicyInput, ...func(*Options)) (*SimulatePrincipalPolicyOutput, error) +} + +var _ SimulatePrincipalPolicyAPIClient = (*Client)(nil) + +// SimulatePrincipalPolicyPaginatorOptions is the paginator options for +// SimulatePrincipalPolicy +type SimulatePrincipalPolicyPaginatorOptions struct { + // Use this only when paginating results to indicate the maximum number of items + // you want in the response. If additional items exist beyond the maximum you + // specify, the IsTruncated response element is true. If you do not include this + // parameter, the number of items defaults to 100. Note that IAM might return fewer + // results, even when there are more results available. In that case, the + // IsTruncated response element returns true, and Marker contains a value to + // include in the subsequent call that tells the service where to continue from. + 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 +} + +// SimulatePrincipalPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iam.SimulatePrincipalPolicy +type SimulatePrincipalPolicyPaginator struct { + options SimulatePrincipalPolicyPaginatorOptions + client SimulatePrincipalPolicyAPIClient + params *SimulatePrincipalPolicyInput + nextToken *string + firstPage bool +} + +// NewSimulatePrincipalPolicyPaginator returns a new +// SimulatePrincipalPolicyPaginator +func NewSimulatePrincipalPolicyPaginator(client SimulatePrincipalPolicyAPIClient, params *SimulatePrincipalPolicyInput, optFns ...func(*SimulatePrincipalPolicyPaginatorOptions)) *SimulatePrincipalPolicyPaginator { + options := SimulatePrincipalPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SimulatePrincipalPolicyInput{} + } + + return &SimulatePrincipalPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SimulatePrincipalPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SimulatePrincipalPolicy page. +func (p *SimulatePrincipalPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SimulatePrincipalPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.SimulatePrincipalPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSimulatePrincipalPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iam/endpoints.go b/service/iam/endpoints.go index 972d17b3a1d..0e5b036c76c 100644 --- a/service/iam/endpoints.go +++ b/service/iam/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/identitystore/api_op_ListGroups.go b/service/identitystore/api_op_ListGroups.go index 60f25808f6e..8112f09b5dd 100644 --- a/service/identitystore/api_op_ListGroups.go +++ b/service/identitystore/api_op_ListGroups.go @@ -4,6 +4,7 @@ package identitystore 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/identitystore/types" @@ -132,6 +133,88 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The maximum number of results to be returned per request, which is used in the + // ListUsers and ListGroups request to specify how many results to return in one + // page. The length limit is 50 characters. + 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 +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/identitystore.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/identitystore/api_op_ListUsers.go b/service/identitystore/api_op_ListUsers.go index 78a37bf618c..ff7aa9cb42c 100644 --- a/service/identitystore/api_op_ListUsers.go +++ b/service/identitystore/api_op_ListUsers.go @@ -4,6 +4,7 @@ package identitystore 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/identitystore/types" @@ -132,6 +133,88 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to be returned per request, which is used in the + // ListUsers and ListGroups request to specify how many results to return in one + // page. The length limit is 50 characters. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/identitystore.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/identitystore/endpoints.go b/service/identitystore/endpoints.go index bb0885bea14..b466c9ed4e5 100644 --- a/service/identitystore/endpoints.go +++ b/service/identitystore/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/imagebuilder/api_op_ListComponentBuildVersions.go b/service/imagebuilder/api_op_ListComponentBuildVersions.go index a6ddbd65272..90ca684da06 100644 --- a/service/imagebuilder/api_op_ListComponentBuildVersions.go +++ b/service/imagebuilder/api_op_ListComponentBuildVersions.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -120,6 +121,89 @@ func addOperationListComponentBuildVersionsMiddlewares(stack *middleware.Stack, return nil } +// ListComponentBuildVersionsAPIClient is a client that implements the +// ListComponentBuildVersions operation. +type ListComponentBuildVersionsAPIClient interface { + ListComponentBuildVersions(context.Context, *ListComponentBuildVersionsInput, ...func(*Options)) (*ListComponentBuildVersionsOutput, error) +} + +var _ ListComponentBuildVersionsAPIClient = (*Client)(nil) + +// ListComponentBuildVersionsPaginatorOptions is the paginator options for +// ListComponentBuildVersions +type ListComponentBuildVersionsPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListComponentBuildVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListComponentBuildVersions +type ListComponentBuildVersionsPaginator struct { + options ListComponentBuildVersionsPaginatorOptions + client ListComponentBuildVersionsAPIClient + params *ListComponentBuildVersionsInput + nextToken *string + firstPage bool +} + +// NewListComponentBuildVersionsPaginator returns a new +// ListComponentBuildVersionsPaginator +func NewListComponentBuildVersionsPaginator(client ListComponentBuildVersionsAPIClient, params *ListComponentBuildVersionsInput, optFns ...func(*ListComponentBuildVersionsPaginatorOptions)) *ListComponentBuildVersionsPaginator { + options := ListComponentBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentBuildVersionsInput{} + } + + return &ListComponentBuildVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentBuildVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComponentBuildVersions page. +func (p *ListComponentBuildVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentBuildVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListComponentBuildVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponentBuildVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListComponents.go b/service/imagebuilder/api_op_ListComponents.go index 00b63b14a19..a8f70ce50eb 100644 --- a/service/imagebuilder/api_op_ListComponents.go +++ b/service/imagebuilder/api_op_ListComponents.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -120,6 +121,87 @@ func addOperationListComponentsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentsInput{} + } + + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListDistributionConfigurations.go b/service/imagebuilder/api_op_ListDistributionConfigurations.go index 74c9a77b5e7..7f08d07b25a 100644 --- a/service/imagebuilder/api_op_ListDistributionConfigurations.go +++ b/service/imagebuilder/api_op_ListDistributionConfigurations.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -116,6 +117,89 @@ func addOperationListDistributionConfigurationsMiddlewares(stack *middleware.Sta return nil } +// ListDistributionConfigurationsAPIClient is a client that implements the +// ListDistributionConfigurations operation. +type ListDistributionConfigurationsAPIClient interface { + ListDistributionConfigurations(context.Context, *ListDistributionConfigurationsInput, ...func(*Options)) (*ListDistributionConfigurationsOutput, error) +} + +var _ ListDistributionConfigurationsAPIClient = (*Client)(nil) + +// ListDistributionConfigurationsPaginatorOptions is the paginator options for +// ListDistributionConfigurations +type ListDistributionConfigurationsPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListDistributionConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListDistributionConfigurations +type ListDistributionConfigurationsPaginator struct { + options ListDistributionConfigurationsPaginatorOptions + client ListDistributionConfigurationsAPIClient + params *ListDistributionConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListDistributionConfigurationsPaginator returns a new +// ListDistributionConfigurationsPaginator +func NewListDistributionConfigurationsPaginator(client ListDistributionConfigurationsAPIClient, params *ListDistributionConfigurationsInput, optFns ...func(*ListDistributionConfigurationsPaginatorOptions)) *ListDistributionConfigurationsPaginator { + options := ListDistributionConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDistributionConfigurationsInput{} + } + + return &ListDistributionConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDistributionConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDistributionConfigurations page. +func (p *ListDistributionConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDistributionConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDistributionConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDistributionConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImageBuildVersions.go b/service/imagebuilder/api_op_ListImageBuildVersions.go index 5b06c7791a9..e693be63645 100644 --- a/service/imagebuilder/api_op_ListImageBuildVersions.go +++ b/service/imagebuilder/api_op_ListImageBuildVersions.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -123,6 +124,88 @@ func addOperationListImageBuildVersionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListImageBuildVersionsAPIClient is a client that implements the +// ListImageBuildVersions operation. +type ListImageBuildVersionsAPIClient interface { + ListImageBuildVersions(context.Context, *ListImageBuildVersionsInput, ...func(*Options)) (*ListImageBuildVersionsOutput, error) +} + +var _ ListImageBuildVersionsAPIClient = (*Client)(nil) + +// ListImageBuildVersionsPaginatorOptions is the paginator options for +// ListImageBuildVersions +type ListImageBuildVersionsPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListImageBuildVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImageBuildVersions +type ListImageBuildVersionsPaginator struct { + options ListImageBuildVersionsPaginatorOptions + client ListImageBuildVersionsAPIClient + params *ListImageBuildVersionsInput + nextToken *string + firstPage bool +} + +// NewListImageBuildVersionsPaginator returns a new ListImageBuildVersionsPaginator +func NewListImageBuildVersionsPaginator(client ListImageBuildVersionsAPIClient, params *ListImageBuildVersionsInput, optFns ...func(*ListImageBuildVersionsPaginatorOptions)) *ListImageBuildVersionsPaginator { + options := ListImageBuildVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageBuildVersionsInput{} + } + + return &ListImageBuildVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageBuildVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImageBuildVersions page. +func (p *ListImageBuildVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageBuildVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListImageBuildVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageBuildVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImagePipelineImages.go b/service/imagebuilder/api_op_ListImagePipelineImages.go index bf2a0abc904..1b69bf7c65f 100644 --- a/service/imagebuilder/api_op_ListImagePipelineImages.go +++ b/service/imagebuilder/api_op_ListImagePipelineImages.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -123,6 +124,89 @@ func addOperationListImagePipelineImagesMiddlewares(stack *middleware.Stack, opt return nil } +// ListImagePipelineImagesAPIClient is a client that implements the +// ListImagePipelineImages operation. +type ListImagePipelineImagesAPIClient interface { + ListImagePipelineImages(context.Context, *ListImagePipelineImagesInput, ...func(*Options)) (*ListImagePipelineImagesOutput, error) +} + +var _ ListImagePipelineImagesAPIClient = (*Client)(nil) + +// ListImagePipelineImagesPaginatorOptions is the paginator options for +// ListImagePipelineImages +type ListImagePipelineImagesPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListImagePipelineImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImagePipelineImages +type ListImagePipelineImagesPaginator struct { + options ListImagePipelineImagesPaginatorOptions + client ListImagePipelineImagesAPIClient + params *ListImagePipelineImagesInput + nextToken *string + firstPage bool +} + +// NewListImagePipelineImagesPaginator returns a new +// ListImagePipelineImagesPaginator +func NewListImagePipelineImagesPaginator(client ListImagePipelineImagesAPIClient, params *ListImagePipelineImagesInput, optFns ...func(*ListImagePipelineImagesPaginatorOptions)) *ListImagePipelineImagesPaginator { + options := ListImagePipelineImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagePipelineImagesInput{} + } + + return &ListImagePipelineImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagePipelineImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImagePipelineImages page. +func (p *ListImagePipelineImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelineImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListImagePipelineImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImagePipelineImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImagePipelines.go b/service/imagebuilder/api_op_ListImagePipelines.go index a1621fe57aa..9aabf65a077 100644 --- a/service/imagebuilder/api_op_ListImagePipelines.go +++ b/service/imagebuilder/api_op_ListImagePipelines.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -114,6 +115,88 @@ func addOperationListImagePipelinesMiddlewares(stack *middleware.Stack, options return nil } +// ListImagePipelinesAPIClient is a client that implements the ListImagePipelines +// operation. +type ListImagePipelinesAPIClient interface { + ListImagePipelines(context.Context, *ListImagePipelinesInput, ...func(*Options)) (*ListImagePipelinesOutput, error) +} + +var _ ListImagePipelinesAPIClient = (*Client)(nil) + +// ListImagePipelinesPaginatorOptions is the paginator options for +// ListImagePipelines +type ListImagePipelinesPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListImagePipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImagePipelines +type ListImagePipelinesPaginator struct { + options ListImagePipelinesPaginatorOptions + client ListImagePipelinesAPIClient + params *ListImagePipelinesInput + nextToken *string + firstPage bool +} + +// NewListImagePipelinesPaginator returns a new ListImagePipelinesPaginator +func NewListImagePipelinesPaginator(client ListImagePipelinesAPIClient, params *ListImagePipelinesInput, optFns ...func(*ListImagePipelinesPaginatorOptions)) *ListImagePipelinesPaginator { + options := ListImagePipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagePipelinesInput{} + } + + return &ListImagePipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagePipelinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImagePipelines page. +func (p *ListImagePipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagePipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListImagePipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImagePipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImageRecipes.go b/service/imagebuilder/api_op_ListImageRecipes.go index 5c240536398..30d7661c6fc 100644 --- a/service/imagebuilder/api_op_ListImageRecipes.go +++ b/service/imagebuilder/api_op_ListImageRecipes.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -120,6 +121,87 @@ func addOperationListImageRecipesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListImageRecipesAPIClient is a client that implements the ListImageRecipes +// operation. +type ListImageRecipesAPIClient interface { + ListImageRecipes(context.Context, *ListImageRecipesInput, ...func(*Options)) (*ListImageRecipesOutput, error) +} + +var _ ListImageRecipesAPIClient = (*Client)(nil) + +// ListImageRecipesPaginatorOptions is the paginator options for ListImageRecipes +type ListImageRecipesPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListImageRecipesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImageRecipes +type ListImageRecipesPaginator struct { + options ListImageRecipesPaginatorOptions + client ListImageRecipesAPIClient + params *ListImageRecipesInput + nextToken *string + firstPage bool +} + +// NewListImageRecipesPaginator returns a new ListImageRecipesPaginator +func NewListImageRecipesPaginator(client ListImageRecipesAPIClient, params *ListImageRecipesInput, optFns ...func(*ListImageRecipesPaginatorOptions)) *ListImageRecipesPaginator { + options := ListImageRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageRecipesInput{} + } + + return &ListImageRecipesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageRecipesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImageRecipes page. +func (p *ListImageRecipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageRecipesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListImageRecipes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageRecipes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListImages.go b/service/imagebuilder/api_op_ListImages.go index ab998fc61c8..7e5caafc228 100644 --- a/service/imagebuilder/api_op_ListImages.go +++ b/service/imagebuilder/api_op_ListImages.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -120,6 +121,86 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go index f9e6544e7cd..e08eecd1929 100644 --- a/service/imagebuilder/api_op_ListInfrastructureConfigurations.go +++ b/service/imagebuilder/api_op_ListInfrastructureConfigurations.go @@ -4,6 +4,7 @@ package imagebuilder 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/imagebuilder/types" @@ -114,6 +115,89 @@ func addOperationListInfrastructureConfigurationsMiddlewares(stack *middleware.S return nil } +// ListInfrastructureConfigurationsAPIClient is a client that implements the +// ListInfrastructureConfigurations operation. +type ListInfrastructureConfigurationsAPIClient interface { + ListInfrastructureConfigurations(context.Context, *ListInfrastructureConfigurationsInput, ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error) +} + +var _ ListInfrastructureConfigurationsAPIClient = (*Client)(nil) + +// ListInfrastructureConfigurationsPaginatorOptions is the paginator options for +// ListInfrastructureConfigurations +type ListInfrastructureConfigurationsPaginatorOptions struct { + // The maximum items to return in a request. + 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 +} + +// ListInfrastructureConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/imagebuilder.ListInfrastructureConfigurations +type ListInfrastructureConfigurationsPaginator struct { + options ListInfrastructureConfigurationsPaginatorOptions + client ListInfrastructureConfigurationsAPIClient + params *ListInfrastructureConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListInfrastructureConfigurationsPaginator returns a new +// ListInfrastructureConfigurationsPaginator +func NewListInfrastructureConfigurationsPaginator(client ListInfrastructureConfigurationsAPIClient, params *ListInfrastructureConfigurationsInput, optFns ...func(*ListInfrastructureConfigurationsPaginatorOptions)) *ListInfrastructureConfigurationsPaginator { + options := ListInfrastructureConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInfrastructureConfigurationsInput{} + } + + return &ListInfrastructureConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInfrastructureConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInfrastructureConfigurations page. +func (p *ListInfrastructureConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInfrastructureConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInfrastructureConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInfrastructureConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/imagebuilder/endpoints.go b/service/imagebuilder/endpoints.go index 025d34dd56a..c17d872fdf2 100644 --- a/service/imagebuilder/endpoints.go +++ b/service/imagebuilder/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/inspector/api_op_GetExclusionsPreview.go b/service/inspector/api_op_GetExclusionsPreview.go index f47e67edc68..80dcd116391 100644 --- a/service/inspector/api_op_GetExclusionsPreview.go +++ b/service/inspector/api_op_GetExclusionsPreview.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -137,6 +138,89 @@ func addOperationGetExclusionsPreviewMiddlewares(stack *middleware.Stack, option return nil } +// GetExclusionsPreviewAPIClient is a client that implements the +// GetExclusionsPreview operation. +type GetExclusionsPreviewAPIClient interface { + GetExclusionsPreview(context.Context, *GetExclusionsPreviewInput, ...func(*Options)) (*GetExclusionsPreviewOutput, error) +} + +var _ GetExclusionsPreviewAPIClient = (*Client)(nil) + +// GetExclusionsPreviewPaginatorOptions is the paginator options for +// GetExclusionsPreview +type GetExclusionsPreviewPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 100. The maximum value is 500. + 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 +} + +// GetExclusionsPreviewPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.GetExclusionsPreview +type GetExclusionsPreviewPaginator struct { + options GetExclusionsPreviewPaginatorOptions + client GetExclusionsPreviewAPIClient + params *GetExclusionsPreviewInput + nextToken *string + firstPage bool +} + +// NewGetExclusionsPreviewPaginator returns a new GetExclusionsPreviewPaginator +func NewGetExclusionsPreviewPaginator(client GetExclusionsPreviewAPIClient, params *GetExclusionsPreviewInput, optFns ...func(*GetExclusionsPreviewPaginatorOptions)) *GetExclusionsPreviewPaginator { + options := GetExclusionsPreviewPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExclusionsPreviewInput{} + } + + return &GetExclusionsPreviewPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExclusionsPreviewPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetExclusionsPreview page. +func (p *GetExclusionsPreviewPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExclusionsPreviewOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetExclusionsPreview(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExclusionsPreview(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentRunAgents.go b/service/inspector/api_op_ListAssessmentRunAgents.go index 0d04e6af82a..8a0dbb18c4c 100644 --- a/service/inspector/api_op_ListAssessmentRunAgents.go +++ b/service/inspector/api_op_ListAssessmentRunAgents.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -129,6 +130,90 @@ func addOperationListAssessmentRunAgentsMiddlewares(stack *middleware.Stack, opt return nil } +// ListAssessmentRunAgentsAPIClient is a client that implements the +// ListAssessmentRunAgents operation. +type ListAssessmentRunAgentsAPIClient interface { + ListAssessmentRunAgents(context.Context, *ListAssessmentRunAgentsInput, ...func(*Options)) (*ListAssessmentRunAgentsOutput, error) +} + +var _ ListAssessmentRunAgentsAPIClient = (*Client)(nil) + +// ListAssessmentRunAgentsPaginatorOptions is the paginator options for +// ListAssessmentRunAgents +type ListAssessmentRunAgentsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListAssessmentRunAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentRunAgents +type ListAssessmentRunAgentsPaginator struct { + options ListAssessmentRunAgentsPaginatorOptions + client ListAssessmentRunAgentsAPIClient + params *ListAssessmentRunAgentsInput + nextToken *string + firstPage bool +} + +// NewListAssessmentRunAgentsPaginator returns a new +// ListAssessmentRunAgentsPaginator +func NewListAssessmentRunAgentsPaginator(client ListAssessmentRunAgentsAPIClient, params *ListAssessmentRunAgentsInput, optFns ...func(*ListAssessmentRunAgentsPaginatorOptions)) *ListAssessmentRunAgentsPaginator { + options := ListAssessmentRunAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentRunAgentsInput{} + } + + return &ListAssessmentRunAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentRunAgentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssessmentRunAgents page. +func (p *ListAssessmentRunAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssessmentRunAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentRunAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentRuns.go b/service/inspector/api_op_ListAssessmentRuns.go index 6db9d55aa02..37162e748f8 100644 --- a/service/inspector/api_op_ListAssessmentRuns.go +++ b/service/inspector/api_op_ListAssessmentRuns.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -126,6 +127,89 @@ func addOperationListAssessmentRunsMiddlewares(stack *middleware.Stack, options return nil } +// ListAssessmentRunsAPIClient is a client that implements the ListAssessmentRuns +// operation. +type ListAssessmentRunsAPIClient interface { + ListAssessmentRuns(context.Context, *ListAssessmentRunsInput, ...func(*Options)) (*ListAssessmentRunsOutput, error) +} + +var _ ListAssessmentRunsAPIClient = (*Client)(nil) + +// ListAssessmentRunsPaginatorOptions is the paginator options for +// ListAssessmentRuns +type ListAssessmentRunsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items that you want + // in the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListAssessmentRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentRuns +type ListAssessmentRunsPaginator struct { + options ListAssessmentRunsPaginatorOptions + client ListAssessmentRunsAPIClient + params *ListAssessmentRunsInput + nextToken *string + firstPage bool +} + +// NewListAssessmentRunsPaginator returns a new ListAssessmentRunsPaginator +func NewListAssessmentRunsPaginator(client ListAssessmentRunsAPIClient, params *ListAssessmentRunsInput, optFns ...func(*ListAssessmentRunsPaginatorOptions)) *ListAssessmentRunsPaginator { + options := ListAssessmentRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentRunsInput{} + } + + return &ListAssessmentRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssessmentRuns page. +func (p *ListAssessmentRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssessmentRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentTargets.go b/service/inspector/api_op_ListAssessmentTargets.go index bc1b4b42c38..35400ebb17e 100644 --- a/service/inspector/api_op_ListAssessmentTargets.go +++ b/service/inspector/api_op_ListAssessmentTargets.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -123,6 +124,89 @@ func addOperationListAssessmentTargetsMiddlewares(stack *middleware.Stack, optio return nil } +// ListAssessmentTargetsAPIClient is a client that implements the +// ListAssessmentTargets operation. +type ListAssessmentTargetsAPIClient interface { + ListAssessmentTargets(context.Context, *ListAssessmentTargetsInput, ...func(*Options)) (*ListAssessmentTargetsOutput, error) +} + +var _ ListAssessmentTargetsAPIClient = (*Client)(nil) + +// ListAssessmentTargetsPaginatorOptions is the paginator options for +// ListAssessmentTargets +type ListAssessmentTargetsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListAssessmentTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentTargets +type ListAssessmentTargetsPaginator struct { + options ListAssessmentTargetsPaginatorOptions + client ListAssessmentTargetsAPIClient + params *ListAssessmentTargetsInput + nextToken *string + firstPage bool +} + +// NewListAssessmentTargetsPaginator returns a new ListAssessmentTargetsPaginator +func NewListAssessmentTargetsPaginator(client ListAssessmentTargetsAPIClient, params *ListAssessmentTargetsInput, optFns ...func(*ListAssessmentTargetsPaginatorOptions)) *ListAssessmentTargetsPaginator { + options := ListAssessmentTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentTargetsInput{} + } + + return &ListAssessmentTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssessmentTargets page. +func (p *ListAssessmentTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssessmentTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListAssessmentTemplates.go b/service/inspector/api_op_ListAssessmentTemplates.go index 5b32bd24e98..124e7fafd73 100644 --- a/service/inspector/api_op_ListAssessmentTemplates.go +++ b/service/inspector/api_op_ListAssessmentTemplates.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -125,6 +126,90 @@ func addOperationListAssessmentTemplatesMiddlewares(stack *middleware.Stack, opt return nil } +// ListAssessmentTemplatesAPIClient is a client that implements the +// ListAssessmentTemplates operation. +type ListAssessmentTemplatesAPIClient interface { + ListAssessmentTemplates(context.Context, *ListAssessmentTemplatesInput, ...func(*Options)) (*ListAssessmentTemplatesOutput, error) +} + +var _ ListAssessmentTemplatesAPIClient = (*Client)(nil) + +// ListAssessmentTemplatesPaginatorOptions is the paginator options for +// ListAssessmentTemplates +type ListAssessmentTemplatesPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListAssessmentTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListAssessmentTemplates +type ListAssessmentTemplatesPaginator struct { + options ListAssessmentTemplatesPaginatorOptions + client ListAssessmentTemplatesAPIClient + params *ListAssessmentTemplatesInput + nextToken *string + firstPage bool +} + +// NewListAssessmentTemplatesPaginator returns a new +// ListAssessmentTemplatesPaginator +func NewListAssessmentTemplatesPaginator(client ListAssessmentTemplatesAPIClient, params *ListAssessmentTemplatesInput, optFns ...func(*ListAssessmentTemplatesPaginatorOptions)) *ListAssessmentTemplatesPaginator { + options := ListAssessmentTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssessmentTemplatesInput{} + } + + return &ListAssessmentTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssessmentTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssessmentTemplates page. +func (p *ListAssessmentTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssessmentTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssessmentTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssessmentTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListEventSubscriptions.go b/service/inspector/api_op_ListEventSubscriptions.go index 1dc6474de46..80b349f9232 100644 --- a/service/inspector/api_op_ListEventSubscriptions.go +++ b/service/inspector/api_op_ListEventSubscriptions.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -120,6 +121,89 @@ func addOperationListEventSubscriptionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListEventSubscriptionsAPIClient is a client that implements the +// ListEventSubscriptions operation. +type ListEventSubscriptionsAPIClient interface { + ListEventSubscriptions(context.Context, *ListEventSubscriptionsInput, ...func(*Options)) (*ListEventSubscriptionsOutput, error) +} + +var _ ListEventSubscriptionsAPIClient = (*Client)(nil) + +// ListEventSubscriptionsPaginatorOptions is the paginator options for +// ListEventSubscriptions +type ListEventSubscriptionsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListEventSubscriptions +type ListEventSubscriptionsPaginator struct { + options ListEventSubscriptionsPaginatorOptions + client ListEventSubscriptionsAPIClient + params *ListEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewListEventSubscriptionsPaginator returns a new ListEventSubscriptionsPaginator +func NewListEventSubscriptionsPaginator(client ListEventSubscriptionsAPIClient, params *ListEventSubscriptionsInput, optFns ...func(*ListEventSubscriptionsPaginatorOptions)) *ListEventSubscriptionsPaginator { + options := ListEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventSubscriptionsInput{} + } + + return &ListEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEventSubscriptions page. +func (p *ListEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListExclusions.go b/service/inspector/api_op_ListExclusions.go index e3ccd4bdab8..bfd2c8b343a 100644 --- a/service/inspector/api_op_ListExclusions.go +++ b/service/inspector/api_op_ListExclusions.go @@ -4,6 +4,7 @@ package inspector 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/awslabs/smithy-go/middleware" @@ -122,6 +123,88 @@ func addOperationListExclusionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListExclusionsAPIClient is a client that implements the ListExclusions +// operation. +type ListExclusionsAPIClient interface { + ListExclusions(context.Context, *ListExclusionsInput, ...func(*Options)) (*ListExclusionsOutput, error) +} + +var _ ListExclusionsAPIClient = (*Client)(nil) + +// ListExclusionsPaginatorOptions is the paginator options for ListExclusions +type ListExclusionsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 100. The maximum value is 500. + 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 +} + +// ListExclusionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListExclusions +type ListExclusionsPaginator struct { + options ListExclusionsPaginatorOptions + client ListExclusionsAPIClient + params *ListExclusionsInput + nextToken *string + firstPage bool +} + +// NewListExclusionsPaginator returns a new ListExclusionsPaginator +func NewListExclusionsPaginator(client ListExclusionsAPIClient, params *ListExclusionsInput, optFns ...func(*ListExclusionsPaginatorOptions)) *ListExclusionsPaginator { + options := ListExclusionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExclusionsInput{} + } + + return &ListExclusionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExclusionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListExclusions page. +func (p *ListExclusionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExclusionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListExclusions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExclusions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListFindings.go b/service/inspector/api_op_ListFindings.go index df1b58438d5..b390b0813f8 100644 --- a/service/inspector/api_op_ListFindings.go +++ b/service/inspector/api_op_ListFindings.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -128,6 +129,87 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_ListRulesPackages.go b/service/inspector/api_op_ListRulesPackages.go index 5d6516dbe0d..18f7985df24 100644 --- a/service/inspector/api_op_ListRulesPackages.go +++ b/service/inspector/api_op_ListRulesPackages.go @@ -4,6 +4,7 @@ package inspector 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/awslabs/smithy-go/middleware" @@ -113,6 +114,88 @@ func addOperationListRulesPackagesMiddlewares(stack *middleware.Stack, options O return nil } +// ListRulesPackagesAPIClient is a client that implements the ListRulesPackages +// operation. +type ListRulesPackagesAPIClient interface { + ListRulesPackages(context.Context, *ListRulesPackagesInput, ...func(*Options)) (*ListRulesPackagesOutput, error) +} + +var _ ListRulesPackagesAPIClient = (*Client)(nil) + +// ListRulesPackagesPaginatorOptions is the paginator options for ListRulesPackages +type ListRulesPackagesPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// ListRulesPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.ListRulesPackages +type ListRulesPackagesPaginator struct { + options ListRulesPackagesPaginatorOptions + client ListRulesPackagesAPIClient + params *ListRulesPackagesInput + nextToken *string + firstPage bool +} + +// NewListRulesPackagesPaginator returns a new ListRulesPackagesPaginator +func NewListRulesPackagesPaginator(client ListRulesPackagesAPIClient, params *ListRulesPackagesInput, optFns ...func(*ListRulesPackagesPaginatorOptions)) *ListRulesPackagesPaginator { + options := ListRulesPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRulesPackagesInput{} + } + + return &ListRulesPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRulesPackagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRulesPackages page. +func (p *ListRulesPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRulesPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRulesPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRulesPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/api_op_PreviewAgents.go b/service/inspector/api_op_PreviewAgents.go index f3de280cc44..3319bda8bcb 100644 --- a/service/inspector/api_op_PreviewAgents.go +++ b/service/inspector/api_op_PreviewAgents.go @@ -4,6 +4,7 @@ package inspector 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/inspector/types" @@ -123,6 +124,87 @@ func addOperationPreviewAgentsMiddlewares(stack *middleware.Stack, options Optio return nil } +// PreviewAgentsAPIClient is a client that implements the PreviewAgents operation. +type PreviewAgentsAPIClient interface { + PreviewAgents(context.Context, *PreviewAgentsInput, ...func(*Options)) (*PreviewAgentsOutput, error) +} + +var _ PreviewAgentsAPIClient = (*Client)(nil) + +// PreviewAgentsPaginatorOptions is the paginator options for PreviewAgents +type PreviewAgentsPaginatorOptions struct { + // You can use this parameter to indicate the maximum number of items you want in + // the response. The default value is 10. The maximum value is 500. + 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 +} + +// PreviewAgentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/inspector.PreviewAgents +type PreviewAgentsPaginator struct { + options PreviewAgentsPaginatorOptions + client PreviewAgentsAPIClient + params *PreviewAgentsInput + nextToken *string + firstPage bool +} + +// NewPreviewAgentsPaginator returns a new PreviewAgentsPaginator +func NewPreviewAgentsPaginator(client PreviewAgentsAPIClient, params *PreviewAgentsInput, optFns ...func(*PreviewAgentsPaginatorOptions)) *PreviewAgentsPaginator { + options := PreviewAgentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &PreviewAgentsInput{} + } + + return &PreviewAgentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *PreviewAgentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next PreviewAgents page. +func (p *PreviewAgentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PreviewAgentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.PreviewAgents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opPreviewAgents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/inspector/endpoints.go b/service/inspector/endpoints.go index 451f7b5aa07..e77f3762bf6 100644 --- a/service/inspector/endpoints.go +++ b/service/inspector/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iot/api_op_ListActiveViolations.go b/service/iot/api_op_ListActiveViolations.go index b8e440fd5a6..22f070319bd 100644 --- a/service/iot/api_op_ListActiveViolations.go +++ b/service/iot/api_op_ListActiveViolations.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -113,6 +114,88 @@ func addOperationListActiveViolationsMiddlewares(stack *middleware.Stack, option return nil } +// ListActiveViolationsAPIClient is a client that implements the +// ListActiveViolations operation. +type ListActiveViolationsAPIClient interface { + ListActiveViolations(context.Context, *ListActiveViolationsInput, ...func(*Options)) (*ListActiveViolationsOutput, error) +} + +var _ ListActiveViolationsAPIClient = (*Client)(nil) + +// ListActiveViolationsPaginatorOptions is the paginator options for +// ListActiveViolations +type ListActiveViolationsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListActiveViolationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListActiveViolations +type ListActiveViolationsPaginator struct { + options ListActiveViolationsPaginatorOptions + client ListActiveViolationsAPIClient + params *ListActiveViolationsInput + nextToken *string + firstPage bool +} + +// NewListActiveViolationsPaginator returns a new ListActiveViolationsPaginator +func NewListActiveViolationsPaginator(client ListActiveViolationsAPIClient, params *ListActiveViolationsInput, optFns ...func(*ListActiveViolationsPaginatorOptions)) *ListActiveViolationsPaginator { + options := ListActiveViolationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActiveViolationsInput{} + } + + return &ListActiveViolationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActiveViolationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListActiveViolations page. +func (p *ListActiveViolationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActiveViolationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListActiveViolations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActiveViolations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAttachedPolicies.go b/service/iot/api_op_ListAttachedPolicies.go index f266e72f987..4a4ad95b0db 100644 --- a/service/iot/api_op_ListAttachedPolicies.go +++ b/service/iot/api_op_ListAttachedPolicies.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -120,6 +121,88 @@ func addOperationListAttachedPoliciesMiddlewares(stack *middleware.Stack, option return nil } +// ListAttachedPoliciesAPIClient is a client that implements the +// ListAttachedPolicies operation. +type ListAttachedPoliciesAPIClient interface { + ListAttachedPolicies(context.Context, *ListAttachedPoliciesInput, ...func(*Options)) (*ListAttachedPoliciesOutput, error) +} + +var _ ListAttachedPoliciesAPIClient = (*Client)(nil) + +// ListAttachedPoliciesPaginatorOptions is the paginator options for +// ListAttachedPolicies +type ListAttachedPoliciesPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListAttachedPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAttachedPolicies +type ListAttachedPoliciesPaginator struct { + options ListAttachedPoliciesPaginatorOptions + client ListAttachedPoliciesAPIClient + params *ListAttachedPoliciesInput + nextToken *string + firstPage bool +} + +// NewListAttachedPoliciesPaginator returns a new ListAttachedPoliciesPaginator +func NewListAttachedPoliciesPaginator(client ListAttachedPoliciesAPIClient, params *ListAttachedPoliciesInput, optFns ...func(*ListAttachedPoliciesPaginatorOptions)) *ListAttachedPoliciesPaginator { + options := ListAttachedPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttachedPoliciesInput{} + } + + return &ListAttachedPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttachedPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttachedPolicies page. +func (p *ListAttachedPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttachedPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListAttachedPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttachedPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditFindings.go b/service/iot/api_op_ListAuditFindings.go index c5921271aa8..3c35a214f7e 100644 --- a/service/iot/api_op_ListAuditFindings.go +++ b/service/iot/api_op_ListAuditFindings.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -131,6 +132,87 @@ func addOperationListAuditFindingsMiddlewares(stack *middleware.Stack, options O return nil } +// ListAuditFindingsAPIClient is a client that implements the ListAuditFindings +// operation. +type ListAuditFindingsAPIClient interface { + ListAuditFindings(context.Context, *ListAuditFindingsInput, ...func(*Options)) (*ListAuditFindingsOutput, error) +} + +var _ ListAuditFindingsAPIClient = (*Client)(nil) + +// ListAuditFindingsPaginatorOptions is the paginator options for ListAuditFindings +type ListAuditFindingsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListAuditFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditFindings +type ListAuditFindingsPaginator struct { + options ListAuditFindingsPaginatorOptions + client ListAuditFindingsAPIClient + params *ListAuditFindingsInput + nextToken *string + firstPage bool +} + +// NewListAuditFindingsPaginator returns a new ListAuditFindingsPaginator +func NewListAuditFindingsPaginator(client ListAuditFindingsAPIClient, params *ListAuditFindingsInput, optFns ...func(*ListAuditFindingsPaginatorOptions)) *ListAuditFindingsPaginator { + options := ListAuditFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditFindingsInput{} + } + + return &ListAuditFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuditFindings page. +func (p *ListAuditFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAuditFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditMitigationActionsExecutions.go b/service/iot/api_op_ListAuditMitigationActionsExecutions.go index 08f1e0e21fb..58ca207c4fa 100644 --- a/service/iot/api_op_ListAuditMitigationActionsExecutions.go +++ b/service/iot/api_op_ListAuditMitigationActionsExecutions.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -124,6 +125,89 @@ func addOperationListAuditMitigationActionsExecutionsMiddlewares(stack *middlewa return nil } +// ListAuditMitigationActionsExecutionsAPIClient is a client that implements the +// ListAuditMitigationActionsExecutions operation. +type ListAuditMitigationActionsExecutionsAPIClient interface { + ListAuditMitigationActionsExecutions(context.Context, *ListAuditMitigationActionsExecutionsInput, ...func(*Options)) (*ListAuditMitigationActionsExecutionsOutput, error) +} + +var _ ListAuditMitigationActionsExecutionsAPIClient = (*Client)(nil) + +// ListAuditMitigationActionsExecutionsPaginatorOptions is the paginator options +// for ListAuditMitigationActionsExecutions +type ListAuditMitigationActionsExecutionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListAuditMitigationActionsExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditMitigationActionsExecutions +type ListAuditMitigationActionsExecutionsPaginator struct { + options ListAuditMitigationActionsExecutionsPaginatorOptions + client ListAuditMitigationActionsExecutionsAPIClient + params *ListAuditMitigationActionsExecutionsInput + nextToken *string + firstPage bool +} + +// NewListAuditMitigationActionsExecutionsPaginator returns a new +// ListAuditMitigationActionsExecutionsPaginator +func NewListAuditMitigationActionsExecutionsPaginator(client ListAuditMitigationActionsExecutionsAPIClient, params *ListAuditMitigationActionsExecutionsInput, optFns ...func(*ListAuditMitigationActionsExecutionsPaginatorOptions)) *ListAuditMitigationActionsExecutionsPaginator { + options := ListAuditMitigationActionsExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditMitigationActionsExecutionsInput{} + } + + return &ListAuditMitigationActionsExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditMitigationActionsExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuditMitigationActionsExecutions page. +func (p *ListAuditMitigationActionsExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditMitigationActionsExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAuditMitigationActionsExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditMitigationActionsExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditMitigationActionsTasks.go b/service/iot/api_op_ListAuditMitigationActionsTasks.go index fda63846a8b..84f1d5b2abf 100644 --- a/service/iot/api_op_ListAuditMitigationActionsTasks.go +++ b/service/iot/api_op_ListAuditMitigationActionsTasks.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -132,6 +133,89 @@ func addOperationListAuditMitigationActionsTasksMiddlewares(stack *middleware.St return nil } +// ListAuditMitigationActionsTasksAPIClient is a client that implements the +// ListAuditMitigationActionsTasks operation. +type ListAuditMitigationActionsTasksAPIClient interface { + ListAuditMitigationActionsTasks(context.Context, *ListAuditMitigationActionsTasksInput, ...func(*Options)) (*ListAuditMitigationActionsTasksOutput, error) +} + +var _ ListAuditMitigationActionsTasksAPIClient = (*Client)(nil) + +// ListAuditMitigationActionsTasksPaginatorOptions is the paginator options for +// ListAuditMitigationActionsTasks +type ListAuditMitigationActionsTasksPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListAuditMitigationActionsTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditMitigationActionsTasks +type ListAuditMitigationActionsTasksPaginator struct { + options ListAuditMitigationActionsTasksPaginatorOptions + client ListAuditMitigationActionsTasksAPIClient + params *ListAuditMitigationActionsTasksInput + nextToken *string + firstPage bool +} + +// NewListAuditMitigationActionsTasksPaginator returns a new +// ListAuditMitigationActionsTasksPaginator +func NewListAuditMitigationActionsTasksPaginator(client ListAuditMitigationActionsTasksAPIClient, params *ListAuditMitigationActionsTasksInput, optFns ...func(*ListAuditMitigationActionsTasksPaginatorOptions)) *ListAuditMitigationActionsTasksPaginator { + options := ListAuditMitigationActionsTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditMitigationActionsTasksInput{} + } + + return &ListAuditMitigationActionsTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditMitigationActionsTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuditMitigationActionsTasks page. +func (p *ListAuditMitigationActionsTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditMitigationActionsTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAuditMitigationActionsTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditMitigationActionsTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditSuppressions.go b/service/iot/api_op_ListAuditSuppressions.go index c38f5b79c9f..558b7643c61 100644 --- a/service/iot/api_op_ListAuditSuppressions.go +++ b/service/iot/api_op_ListAuditSuppressions.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -119,6 +120,88 @@ func addOperationListAuditSuppressionsMiddlewares(stack *middleware.Stack, optio return nil } +// ListAuditSuppressionsAPIClient is a client that implements the +// ListAuditSuppressions operation. +type ListAuditSuppressionsAPIClient interface { + ListAuditSuppressions(context.Context, *ListAuditSuppressionsInput, ...func(*Options)) (*ListAuditSuppressionsOutput, error) +} + +var _ ListAuditSuppressionsAPIClient = (*Client)(nil) + +// ListAuditSuppressionsPaginatorOptions is the paginator options for +// ListAuditSuppressions +type ListAuditSuppressionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListAuditSuppressionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditSuppressions +type ListAuditSuppressionsPaginator struct { + options ListAuditSuppressionsPaginatorOptions + client ListAuditSuppressionsAPIClient + params *ListAuditSuppressionsInput + nextToken *string + firstPage bool +} + +// NewListAuditSuppressionsPaginator returns a new ListAuditSuppressionsPaginator +func NewListAuditSuppressionsPaginator(client ListAuditSuppressionsAPIClient, params *ListAuditSuppressionsInput, optFns ...func(*ListAuditSuppressionsPaginatorOptions)) *ListAuditSuppressionsPaginator { + options := ListAuditSuppressionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditSuppressionsInput{} + } + + return &ListAuditSuppressionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditSuppressionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuditSuppressions page. +func (p *ListAuditSuppressionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditSuppressionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAuditSuppressions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditSuppressions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuditTasks.go b/service/iot/api_op_ListAuditTasks.go index 955b2a3b772..d1b0089828e 100644 --- a/service/iot/api_op_ListAuditTasks.go +++ b/service/iot/api_op_ListAuditTasks.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -131,6 +132,87 @@ func addOperationListAuditTasksMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListAuditTasksAPIClient is a client that implements the ListAuditTasks +// operation. +type ListAuditTasksAPIClient interface { + ListAuditTasks(context.Context, *ListAuditTasksInput, ...func(*Options)) (*ListAuditTasksOutput, error) +} + +var _ ListAuditTasksAPIClient = (*Client)(nil) + +// ListAuditTasksPaginatorOptions is the paginator options for ListAuditTasks +type ListAuditTasksPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListAuditTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuditTasks +type ListAuditTasksPaginator struct { + options ListAuditTasksPaginatorOptions + client ListAuditTasksAPIClient + params *ListAuditTasksInput + nextToken *string + firstPage bool +} + +// NewListAuditTasksPaginator returns a new ListAuditTasksPaginator +func NewListAuditTasksPaginator(client ListAuditTasksAPIClient, params *ListAuditTasksInput, optFns ...func(*ListAuditTasksPaginatorOptions)) *ListAuditTasksPaginator { + options := ListAuditTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuditTasksInput{} + } + + return &ListAuditTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuditTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuditTasks page. +func (p *ListAuditTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuditTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAuditTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuditTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListAuthorizers.go b/service/iot/api_op_ListAuthorizers.go index 1e34b6fca9a..10a47b76309 100644 --- a/service/iot/api_op_ListAuthorizers.go +++ b/service/iot/api_op_ListAuthorizers.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -111,6 +112,87 @@ func addOperationListAuthorizersMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListAuthorizersAPIClient is a client that implements the ListAuthorizers +// operation. +type ListAuthorizersAPIClient interface { + ListAuthorizers(context.Context, *ListAuthorizersInput, ...func(*Options)) (*ListAuthorizersOutput, error) +} + +var _ ListAuthorizersAPIClient = (*Client)(nil) + +// ListAuthorizersPaginatorOptions is the paginator options for ListAuthorizers +type ListAuthorizersPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListAuthorizersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListAuthorizers +type ListAuthorizersPaginator struct { + options ListAuthorizersPaginatorOptions + client ListAuthorizersAPIClient + params *ListAuthorizersInput + nextToken *string + firstPage bool +} + +// NewListAuthorizersPaginator returns a new ListAuthorizersPaginator +func NewListAuthorizersPaginator(client ListAuthorizersAPIClient, params *ListAuthorizersInput, optFns ...func(*ListAuthorizersPaginatorOptions)) *ListAuthorizersPaginator { + options := ListAuthorizersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAuthorizersInput{} + } + + return &ListAuthorizersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAuthorizersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAuthorizers page. +func (p *ListAuthorizersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAuthorizersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListAuthorizers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAuthorizers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListBillingGroups.go b/service/iot/api_op_ListBillingGroups.go index 7a2008928f9..61da2ec2754 100644 --- a/service/iot/api_op_ListBillingGroups.go +++ b/service/iot/api_op_ListBillingGroups.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -109,6 +110,87 @@ func addOperationListBillingGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// ListBillingGroupsAPIClient is a client that implements the ListBillingGroups +// operation. +type ListBillingGroupsAPIClient interface { + ListBillingGroups(context.Context, *ListBillingGroupsInput, ...func(*Options)) (*ListBillingGroupsOutput, error) +} + +var _ ListBillingGroupsAPIClient = (*Client)(nil) + +// ListBillingGroupsPaginatorOptions is the paginator options for ListBillingGroups +type ListBillingGroupsPaginatorOptions struct { + // The maximum number of results to return per request. + 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 +} + +// ListBillingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListBillingGroups +type ListBillingGroupsPaginator struct { + options ListBillingGroupsPaginatorOptions + client ListBillingGroupsAPIClient + params *ListBillingGroupsInput + nextToken *string + firstPage bool +} + +// NewListBillingGroupsPaginator returns a new ListBillingGroupsPaginator +func NewListBillingGroupsPaginator(client ListBillingGroupsAPIClient, params *ListBillingGroupsInput, optFns ...func(*ListBillingGroupsPaginatorOptions)) *ListBillingGroupsPaginator { + options := ListBillingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBillingGroupsInput{} + } + + return &ListBillingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBillingGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBillingGroups page. +func (p *ListBillingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBillingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBillingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBillingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCACertificates.go b/service/iot/api_op_ListCACertificates.go index de7c6ee75cb..e55a5577029 100644 --- a/service/iot/api_op_ListCACertificates.go +++ b/service/iot/api_op_ListCACertificates.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -112,6 +113,88 @@ func addOperationListCACertificatesMiddlewares(stack *middleware.Stack, options return nil } +// ListCACertificatesAPIClient is a client that implements the ListCACertificates +// operation. +type ListCACertificatesAPIClient interface { + ListCACertificates(context.Context, *ListCACertificatesInput, ...func(*Options)) (*ListCACertificatesOutput, error) +} + +var _ ListCACertificatesAPIClient = (*Client)(nil) + +// ListCACertificatesPaginatorOptions is the paginator options for +// ListCACertificates +type ListCACertificatesPaginatorOptions struct { + // The result page size. + 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 +} + +// ListCACertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCACertificates +type ListCACertificatesPaginator struct { + options ListCACertificatesPaginatorOptions + client ListCACertificatesAPIClient + params *ListCACertificatesInput + nextToken *string + firstPage bool +} + +// NewListCACertificatesPaginator returns a new ListCACertificatesPaginator +func NewListCACertificatesPaginator(client ListCACertificatesAPIClient, params *ListCACertificatesInput, optFns ...func(*ListCACertificatesPaginatorOptions)) *ListCACertificatesPaginator { + options := ListCACertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCACertificatesInput{} + } + + return &ListCACertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCACertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCACertificates page. +func (p *ListCACertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCACertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListCACertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCACertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCertificates.go b/service/iot/api_op_ListCertificates.go index 00896c7546e..7aebb5eb0af 100644 --- a/service/iot/api_op_ListCertificates.go +++ b/service/iot/api_op_ListCertificates.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -114,6 +115,87 @@ func addOperationListCertificatesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListCertificatesAPIClient is a client that implements the ListCertificates +// operation. +type ListCertificatesAPIClient interface { + ListCertificates(context.Context, *ListCertificatesInput, ...func(*Options)) (*ListCertificatesOutput, error) +} + +var _ ListCertificatesAPIClient = (*Client)(nil) + +// ListCertificatesPaginatorOptions is the paginator options for ListCertificates +type ListCertificatesPaginatorOptions struct { + // The result page size. + 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 +} + +// ListCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCertificates +type ListCertificatesPaginator struct { + options ListCertificatesPaginatorOptions + client ListCertificatesAPIClient + params *ListCertificatesInput + nextToken *string + firstPage bool +} + +// NewListCertificatesPaginator returns a new ListCertificatesPaginator +func NewListCertificatesPaginator(client ListCertificatesAPIClient, params *ListCertificatesInput, optFns ...func(*ListCertificatesPaginatorOptions)) *ListCertificatesPaginator { + options := ListCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesInput{} + } + + return &ListCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCertificates page. +func (p *ListCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListCertificatesByCA.go b/service/iot/api_op_ListCertificatesByCA.go index 40846266da2..1f260ca8709 100644 --- a/service/iot/api_op_ListCertificatesByCA.go +++ b/service/iot/api_op_ListCertificatesByCA.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -121,6 +122,88 @@ func addOperationListCertificatesByCAMiddlewares(stack *middleware.Stack, option return nil } +// ListCertificatesByCAAPIClient is a client that implements the +// ListCertificatesByCA operation. +type ListCertificatesByCAAPIClient interface { + ListCertificatesByCA(context.Context, *ListCertificatesByCAInput, ...func(*Options)) (*ListCertificatesByCAOutput, error) +} + +var _ ListCertificatesByCAAPIClient = (*Client)(nil) + +// ListCertificatesByCAPaginatorOptions is the paginator options for +// ListCertificatesByCA +type ListCertificatesByCAPaginatorOptions struct { + // The result page size. + 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 +} + +// ListCertificatesByCAPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListCertificatesByCA +type ListCertificatesByCAPaginator struct { + options ListCertificatesByCAPaginatorOptions + client ListCertificatesByCAAPIClient + params *ListCertificatesByCAInput + nextToken *string + firstPage bool +} + +// NewListCertificatesByCAPaginator returns a new ListCertificatesByCAPaginator +func NewListCertificatesByCAPaginator(client ListCertificatesByCAAPIClient, params *ListCertificatesByCAInput, optFns ...func(*ListCertificatesByCAPaginatorOptions)) *ListCertificatesByCAPaginator { + options := ListCertificatesByCAPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCertificatesByCAInput{} + } + + return &ListCertificatesByCAPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCertificatesByCAPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCertificatesByCA page. +func (p *ListCertificatesByCAPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCertificatesByCAOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListCertificatesByCA(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCertificatesByCA(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListDimensions.go b/service/iot/api_op_ListDimensions.go index b6337c83f1d..6371b87cfee 100644 --- a/service/iot/api_op_ListDimensions.go +++ b/service/iot/api_op_ListDimensions.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -106,6 +107,87 @@ func addOperationListDimensionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListDimensionsAPIClient is a client that implements the ListDimensions +// operation. +type ListDimensionsAPIClient interface { + ListDimensions(context.Context, *ListDimensionsInput, ...func(*Options)) (*ListDimensionsOutput, error) +} + +var _ ListDimensionsAPIClient = (*Client)(nil) + +// ListDimensionsPaginatorOptions is the paginator options for ListDimensions +type ListDimensionsPaginatorOptions struct { + // The maximum number of results to retrieve at one time. + 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 +} + +// ListDimensionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListDimensions +type ListDimensionsPaginator struct { + options ListDimensionsPaginatorOptions + client ListDimensionsAPIClient + params *ListDimensionsInput + nextToken *string + firstPage bool +} + +// NewListDimensionsPaginator returns a new ListDimensionsPaginator +func NewListDimensionsPaginator(client ListDimensionsAPIClient, params *ListDimensionsInput, optFns ...func(*ListDimensionsPaginatorOptions)) *ListDimensionsPaginator { + options := ListDimensionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDimensionsInput{} + } + + return &ListDimensionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDimensionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDimensions page. +func (p *ListDimensionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDimensionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDimensions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDimensions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListDomainConfigurations.go b/service/iot/api_op_ListDomainConfigurations.go index 2bb7189d849..81674ef1657 100644 --- a/service/iot/api_op_ListDomainConfigurations.go +++ b/service/iot/api_op_ListDomainConfigurations.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -111,6 +112,89 @@ func addOperationListDomainConfigurationsMiddlewares(stack *middleware.Stack, op return nil } +// ListDomainConfigurationsAPIClient is a client that implements the +// ListDomainConfigurations operation. +type ListDomainConfigurationsAPIClient interface { + ListDomainConfigurations(context.Context, *ListDomainConfigurationsInput, ...func(*Options)) (*ListDomainConfigurationsOutput, error) +} + +var _ ListDomainConfigurationsAPIClient = (*Client)(nil) + +// ListDomainConfigurationsPaginatorOptions is the paginator options for +// ListDomainConfigurations +type ListDomainConfigurationsPaginatorOptions struct { + // The result page size. + 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 +} + +// ListDomainConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListDomainConfigurations +type ListDomainConfigurationsPaginator struct { + options ListDomainConfigurationsPaginatorOptions + client ListDomainConfigurationsAPIClient + params *ListDomainConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListDomainConfigurationsPaginator returns a new +// ListDomainConfigurationsPaginator +func NewListDomainConfigurationsPaginator(client ListDomainConfigurationsAPIClient, params *ListDomainConfigurationsInput, optFns ...func(*ListDomainConfigurationsPaginatorOptions)) *ListDomainConfigurationsPaginator { + options := ListDomainConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainConfigurationsInput{} + } + + return &ListDomainConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomainConfigurations page. +func (p *ListDomainConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDomainConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListIndices.go b/service/iot/api_op_ListIndices.go index 59ff0a035dd..99e23a8f7bb 100644 --- a/service/iot/api_op_ListIndices.go +++ b/service/iot/api_op_ListIndices.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -106,6 +107,86 @@ func addOperationListIndicesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListIndicesAPIClient is a client that implements the ListIndices operation. +type ListIndicesAPIClient interface { + ListIndices(context.Context, *ListIndicesInput, ...func(*Options)) (*ListIndicesOutput, error) +} + +var _ ListIndicesAPIClient = (*Client)(nil) + +// ListIndicesPaginatorOptions is the paginator options for ListIndices +type ListIndicesPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListIndices +type ListIndicesPaginator struct { + options ListIndicesPaginatorOptions + client ListIndicesAPIClient + params *ListIndicesInput + nextToken *string + firstPage bool +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndicesInput{} + } + + return &ListIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIndices page. +func (p *ListIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobExecutionsForJob.go b/service/iot/api_op_ListJobExecutionsForJob.go index f86933daf20..420c62b31a4 100644 --- a/service/iot/api_op_ListJobExecutionsForJob.go +++ b/service/iot/api_op_ListJobExecutionsForJob.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -117,6 +118,89 @@ func addOperationListJobExecutionsForJobMiddlewares(stack *middleware.Stack, opt return nil } +// ListJobExecutionsForJobAPIClient is a client that implements the +// ListJobExecutionsForJob operation. +type ListJobExecutionsForJobAPIClient interface { + ListJobExecutionsForJob(context.Context, *ListJobExecutionsForJobInput, ...func(*Options)) (*ListJobExecutionsForJobOutput, error) +} + +var _ ListJobExecutionsForJobAPIClient = (*Client)(nil) + +// ListJobExecutionsForJobPaginatorOptions is the paginator options for +// ListJobExecutionsForJob +type ListJobExecutionsForJobPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListJobExecutionsForJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobExecutionsForJob +type ListJobExecutionsForJobPaginator struct { + options ListJobExecutionsForJobPaginatorOptions + client ListJobExecutionsForJobAPIClient + params *ListJobExecutionsForJobInput + nextToken *string + firstPage bool +} + +// NewListJobExecutionsForJobPaginator returns a new +// ListJobExecutionsForJobPaginator +func NewListJobExecutionsForJobPaginator(client ListJobExecutionsForJobAPIClient, params *ListJobExecutionsForJobInput, optFns ...func(*ListJobExecutionsForJobPaginatorOptions)) *ListJobExecutionsForJobPaginator { + options := ListJobExecutionsForJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobExecutionsForJobInput{} + } + + return &ListJobExecutionsForJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobExecutionsForJobPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobExecutionsForJob page. +func (p *ListJobExecutionsForJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobExecutionsForJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJobExecutionsForJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobExecutionsForJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobExecutionsForThing.go b/service/iot/api_op_ListJobExecutionsForThing.go index 8fca4935f7c..7631b482756 100644 --- a/service/iot/api_op_ListJobExecutionsForThing.go +++ b/service/iot/api_op_ListJobExecutionsForThing.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -124,6 +125,89 @@ func addOperationListJobExecutionsForThingMiddlewares(stack *middleware.Stack, o return nil } +// ListJobExecutionsForThingAPIClient is a client that implements the +// ListJobExecutionsForThing operation. +type ListJobExecutionsForThingAPIClient interface { + ListJobExecutionsForThing(context.Context, *ListJobExecutionsForThingInput, ...func(*Options)) (*ListJobExecutionsForThingOutput, error) +} + +var _ ListJobExecutionsForThingAPIClient = (*Client)(nil) + +// ListJobExecutionsForThingPaginatorOptions is the paginator options for +// ListJobExecutionsForThing +type ListJobExecutionsForThingPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListJobExecutionsForThingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobExecutionsForThing +type ListJobExecutionsForThingPaginator struct { + options ListJobExecutionsForThingPaginatorOptions + client ListJobExecutionsForThingAPIClient + params *ListJobExecutionsForThingInput + nextToken *string + firstPage bool +} + +// NewListJobExecutionsForThingPaginator returns a new +// ListJobExecutionsForThingPaginator +func NewListJobExecutionsForThingPaginator(client ListJobExecutionsForThingAPIClient, params *ListJobExecutionsForThingInput, optFns ...func(*ListJobExecutionsForThingPaginatorOptions)) *ListJobExecutionsForThingPaginator { + options := ListJobExecutionsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobExecutionsForThingInput{} + } + + return &ListJobExecutionsForThingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobExecutionsForThingPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobExecutionsForThing page. +func (p *ListJobExecutionsForThingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobExecutionsForThingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJobExecutionsForThing(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobExecutionsForThing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListJobs.go b/service/iot/api_op_ListJobs.go index 7a1ab9e9555..d04ac2c0e55 100644 --- a/service/iot/api_op_ListJobs.go +++ b/service/iot/api_op_ListJobs.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -130,6 +131,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of results to return per request. + 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListMitigationActions.go b/service/iot/api_op_ListMitigationActions.go index 25b8817f722..6aaeb39249c 100644 --- a/service/iot/api_op_ListMitigationActions.go +++ b/service/iot/api_op_ListMitigationActions.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -109,6 +110,88 @@ func addOperationListMitigationActionsMiddlewares(stack *middleware.Stack, optio return nil } +// ListMitigationActionsAPIClient is a client that implements the +// ListMitigationActions operation. +type ListMitigationActionsAPIClient interface { + ListMitigationActions(context.Context, *ListMitigationActionsInput, ...func(*Options)) (*ListMitigationActionsOutput, error) +} + +var _ ListMitigationActionsAPIClient = (*Client)(nil) + +// ListMitigationActionsPaginatorOptions is the paginator options for +// ListMitigationActions +type ListMitigationActionsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListMitigationActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListMitigationActions +type ListMitigationActionsPaginator struct { + options ListMitigationActionsPaginatorOptions + client ListMitigationActionsAPIClient + params *ListMitigationActionsInput + nextToken *string + firstPage bool +} + +// NewListMitigationActionsPaginator returns a new ListMitigationActionsPaginator +func NewListMitigationActionsPaginator(client ListMitigationActionsAPIClient, params *ListMitigationActionsInput, optFns ...func(*ListMitigationActionsPaginatorOptions)) *ListMitigationActionsPaginator { + options := ListMitigationActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMitigationActionsInput{} + } + + return &ListMitigationActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMitigationActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMitigationActions page. +func (p *ListMitigationActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMitigationActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMitigationActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMitigationActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListOTAUpdates.go b/service/iot/api_op_ListOTAUpdates.go index 0164fbee571..c27cfe52a2c 100644 --- a/service/iot/api_op_ListOTAUpdates.go +++ b/service/iot/api_op_ListOTAUpdates.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -108,6 +109,87 @@ func addOperationListOTAUpdatesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListOTAUpdatesAPIClient is a client that implements the ListOTAUpdates +// operation. +type ListOTAUpdatesAPIClient interface { + ListOTAUpdates(context.Context, *ListOTAUpdatesInput, ...func(*Options)) (*ListOTAUpdatesOutput, error) +} + +var _ ListOTAUpdatesAPIClient = (*Client)(nil) + +// ListOTAUpdatesPaginatorOptions is the paginator options for ListOTAUpdates +type ListOTAUpdatesPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListOTAUpdatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListOTAUpdates +type ListOTAUpdatesPaginator struct { + options ListOTAUpdatesPaginatorOptions + client ListOTAUpdatesAPIClient + params *ListOTAUpdatesInput + nextToken *string + firstPage bool +} + +// NewListOTAUpdatesPaginator returns a new ListOTAUpdatesPaginator +func NewListOTAUpdatesPaginator(client ListOTAUpdatesAPIClient, params *ListOTAUpdatesInput, optFns ...func(*ListOTAUpdatesPaginatorOptions)) *ListOTAUpdatesPaginator { + options := ListOTAUpdatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOTAUpdatesInput{} + } + + return &ListOTAUpdatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOTAUpdatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOTAUpdates page. +func (p *ListOTAUpdatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOTAUpdatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListOTAUpdates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOTAUpdates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListOutgoingCertificates.go b/service/iot/api_op_ListOutgoingCertificates.go index f0904fa5253..672131d79e8 100644 --- a/service/iot/api_op_ListOutgoingCertificates.go +++ b/service/iot/api_op_ListOutgoingCertificates.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -111,6 +112,89 @@ func addOperationListOutgoingCertificatesMiddlewares(stack *middleware.Stack, op return nil } +// ListOutgoingCertificatesAPIClient is a client that implements the +// ListOutgoingCertificates operation. +type ListOutgoingCertificatesAPIClient interface { + ListOutgoingCertificates(context.Context, *ListOutgoingCertificatesInput, ...func(*Options)) (*ListOutgoingCertificatesOutput, error) +} + +var _ ListOutgoingCertificatesAPIClient = (*Client)(nil) + +// ListOutgoingCertificatesPaginatorOptions is the paginator options for +// ListOutgoingCertificates +type ListOutgoingCertificatesPaginatorOptions struct { + // The result page size. + 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 +} + +// ListOutgoingCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListOutgoingCertificates +type ListOutgoingCertificatesPaginator struct { + options ListOutgoingCertificatesPaginatorOptions + client ListOutgoingCertificatesAPIClient + params *ListOutgoingCertificatesInput + nextToken *string + firstPage bool +} + +// NewListOutgoingCertificatesPaginator returns a new +// ListOutgoingCertificatesPaginator +func NewListOutgoingCertificatesPaginator(client ListOutgoingCertificatesAPIClient, params *ListOutgoingCertificatesInput, optFns ...func(*ListOutgoingCertificatesPaginatorOptions)) *ListOutgoingCertificatesPaginator { + options := ListOutgoingCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOutgoingCertificatesInput{} + } + + return &ListOutgoingCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOutgoingCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOutgoingCertificates page. +func (p *ListOutgoingCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOutgoingCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListOutgoingCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOutgoingCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPolicies.go b/service/iot/api_op_ListPolicies.go index 2565832c42f..db096edcfb2 100644 --- a/service/iot/api_op_ListPolicies.go +++ b/service/iot/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -112,6 +113,86 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // The result page size. + 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 +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPolicyPrincipals.go b/service/iot/api_op_ListPolicyPrincipals.go index f9d1c5ddbdd..40332a00dc6 100644 --- a/service/iot/api_op_ListPolicyPrincipals.go +++ b/service/iot/api_op_ListPolicyPrincipals.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -120,6 +121,88 @@ func addOperationListPolicyPrincipalsMiddlewares(stack *middleware.Stack, option return nil } +// ListPolicyPrincipalsAPIClient is a client that implements the +// ListPolicyPrincipals operation. +type ListPolicyPrincipalsAPIClient interface { + ListPolicyPrincipals(context.Context, *ListPolicyPrincipalsInput, ...func(*Options)) (*ListPolicyPrincipalsOutput, error) +} + +var _ ListPolicyPrincipalsAPIClient = (*Client)(nil) + +// ListPolicyPrincipalsPaginatorOptions is the paginator options for +// ListPolicyPrincipals +type ListPolicyPrincipalsPaginatorOptions struct { + // The result page size. + 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 +} + +// ListPolicyPrincipalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPolicyPrincipals +type ListPolicyPrincipalsPaginator struct { + options ListPolicyPrincipalsPaginatorOptions + client ListPolicyPrincipalsAPIClient + params *ListPolicyPrincipalsInput + nextToken *string + firstPage bool +} + +// NewListPolicyPrincipalsPaginator returns a new ListPolicyPrincipalsPaginator +func NewListPolicyPrincipalsPaginator(client ListPolicyPrincipalsAPIClient, params *ListPolicyPrincipalsInput, optFns ...func(*ListPolicyPrincipalsPaginatorOptions)) *ListPolicyPrincipalsPaginator { + options := ListPolicyPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPolicyPrincipalsInput{} + } + + return &ListPolicyPrincipalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPolicyPrincipalsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicyPrincipals page. +func (p *ListPolicyPrincipalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPolicyPrincipalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListPolicyPrincipals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicyPrincipals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPrincipalPolicies.go b/service/iot/api_op_ListPrincipalPolicies.go index a0b91cb71b1..8688e5a45bf 100644 --- a/service/iot/api_op_ListPrincipalPolicies.go +++ b/service/iot/api_op_ListPrincipalPolicies.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -125,6 +126,88 @@ func addOperationListPrincipalPoliciesMiddlewares(stack *middleware.Stack, optio return nil } +// ListPrincipalPoliciesAPIClient is a client that implements the +// ListPrincipalPolicies operation. +type ListPrincipalPoliciesAPIClient interface { + ListPrincipalPolicies(context.Context, *ListPrincipalPoliciesInput, ...func(*Options)) (*ListPrincipalPoliciesOutput, error) +} + +var _ ListPrincipalPoliciesAPIClient = (*Client)(nil) + +// ListPrincipalPoliciesPaginatorOptions is the paginator options for +// ListPrincipalPolicies +type ListPrincipalPoliciesPaginatorOptions struct { + // The result page size. + 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 +} + +// ListPrincipalPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPrincipalPolicies +type ListPrincipalPoliciesPaginator struct { + options ListPrincipalPoliciesPaginatorOptions + client ListPrincipalPoliciesAPIClient + params *ListPrincipalPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPrincipalPoliciesPaginator returns a new ListPrincipalPoliciesPaginator +func NewListPrincipalPoliciesPaginator(client ListPrincipalPoliciesAPIClient, params *ListPrincipalPoliciesInput, optFns ...func(*ListPrincipalPoliciesPaginatorOptions)) *ListPrincipalPoliciesPaginator { + options := ListPrincipalPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalPoliciesInput{} + } + + return &ListPrincipalPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPrincipalPolicies page. +func (p *ListPrincipalPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListPrincipalPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListPrincipalThings.go b/service/iot/api_op_ListPrincipalThings.go index b38e52f2cfb..32d3250588c 100644 --- a/service/iot/api_op_ListPrincipalThings.go +++ b/service/iot/api_op_ListPrincipalThings.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -117,6 +118,88 @@ func addOperationListPrincipalThingsMiddlewares(stack *middleware.Stack, options return nil } +// ListPrincipalThingsAPIClient is a client that implements the ListPrincipalThings +// operation. +type ListPrincipalThingsAPIClient interface { + ListPrincipalThings(context.Context, *ListPrincipalThingsInput, ...func(*Options)) (*ListPrincipalThingsOutput, error) +} + +var _ ListPrincipalThingsAPIClient = (*Client)(nil) + +// ListPrincipalThingsPaginatorOptions is the paginator options for +// ListPrincipalThings +type ListPrincipalThingsPaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListPrincipalThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListPrincipalThings +type ListPrincipalThingsPaginator struct { + options ListPrincipalThingsPaginatorOptions + client ListPrincipalThingsAPIClient + params *ListPrincipalThingsInput + nextToken *string + firstPage bool +} + +// NewListPrincipalThingsPaginator returns a new ListPrincipalThingsPaginator +func NewListPrincipalThingsPaginator(client ListPrincipalThingsAPIClient, params *ListPrincipalThingsInput, optFns ...func(*ListPrincipalThingsPaginatorOptions)) *ListPrincipalThingsPaginator { + options := ListPrincipalThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalThingsInput{} + } + + return &ListPrincipalThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalThingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPrincipalThings page. +func (p *ListPrincipalThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPrincipalThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListProvisioningTemplateVersions.go b/service/iot/api_op_ListProvisioningTemplateVersions.go index b6e2fbb8776..7af244ae6ea 100644 --- a/service/iot/api_op_ListProvisioningTemplateVersions.go +++ b/service/iot/api_op_ListProvisioningTemplateVersions.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -113,6 +114,89 @@ func addOperationListProvisioningTemplateVersionsMiddlewares(stack *middleware.S return nil } +// ListProvisioningTemplateVersionsAPIClient is a client that implements the +// ListProvisioningTemplateVersions operation. +type ListProvisioningTemplateVersionsAPIClient interface { + ListProvisioningTemplateVersions(context.Context, *ListProvisioningTemplateVersionsInput, ...func(*Options)) (*ListProvisioningTemplateVersionsOutput, error) +} + +var _ ListProvisioningTemplateVersionsAPIClient = (*Client)(nil) + +// ListProvisioningTemplateVersionsPaginatorOptions is the paginator options for +// ListProvisioningTemplateVersions +type ListProvisioningTemplateVersionsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListProvisioningTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListProvisioningTemplateVersions +type ListProvisioningTemplateVersionsPaginator struct { + options ListProvisioningTemplateVersionsPaginatorOptions + client ListProvisioningTemplateVersionsAPIClient + params *ListProvisioningTemplateVersionsInput + nextToken *string + firstPage bool +} + +// NewListProvisioningTemplateVersionsPaginator returns a new +// ListProvisioningTemplateVersionsPaginator +func NewListProvisioningTemplateVersionsPaginator(client ListProvisioningTemplateVersionsAPIClient, params *ListProvisioningTemplateVersionsInput, optFns ...func(*ListProvisioningTemplateVersionsPaginatorOptions)) *ListProvisioningTemplateVersionsPaginator { + options := ListProvisioningTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningTemplateVersionsInput{} + } + + return &ListProvisioningTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningTemplateVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProvisioningTemplateVersions page. +func (p *ListProvisioningTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProvisioningTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListProvisioningTemplates.go b/service/iot/api_op_ListProvisioningTemplates.go index 7d29fb8419d..9980ceacf08 100644 --- a/service/iot/api_op_ListProvisioningTemplates.go +++ b/service/iot/api_op_ListProvisioningTemplates.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -105,6 +106,89 @@ func addOperationListProvisioningTemplatesMiddlewares(stack *middleware.Stack, o return nil } +// ListProvisioningTemplatesAPIClient is a client that implements the +// ListProvisioningTemplates operation. +type ListProvisioningTemplatesAPIClient interface { + ListProvisioningTemplates(context.Context, *ListProvisioningTemplatesInput, ...func(*Options)) (*ListProvisioningTemplatesOutput, error) +} + +var _ ListProvisioningTemplatesAPIClient = (*Client)(nil) + +// ListProvisioningTemplatesPaginatorOptions is the paginator options for +// ListProvisioningTemplates +type ListProvisioningTemplatesPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListProvisioningTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListProvisioningTemplates +type ListProvisioningTemplatesPaginator struct { + options ListProvisioningTemplatesPaginatorOptions + client ListProvisioningTemplatesAPIClient + params *ListProvisioningTemplatesInput + nextToken *string + firstPage bool +} + +// NewListProvisioningTemplatesPaginator returns a new +// ListProvisioningTemplatesPaginator +func NewListProvisioningTemplatesPaginator(client ListProvisioningTemplatesAPIClient, params *ListProvisioningTemplatesInput, optFns ...func(*ListProvisioningTemplatesPaginatorOptions)) *ListProvisioningTemplatesPaginator { + options := ListProvisioningTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningTemplatesInput{} + } + + return &ListProvisioningTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProvisioningTemplates page. +func (p *ListProvisioningTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProvisioningTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListRoleAliases.go b/service/iot/api_op_ListRoleAliases.go index aefdf744abe..d07f1733269 100644 --- a/service/iot/api_op_ListRoleAliases.go +++ b/service/iot/api_op_ListRoleAliases.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -107,6 +108,87 @@ func addOperationListRoleAliasesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListRoleAliasesAPIClient is a client that implements the ListRoleAliases +// operation. +type ListRoleAliasesAPIClient interface { + ListRoleAliases(context.Context, *ListRoleAliasesInput, ...func(*Options)) (*ListRoleAliasesOutput, error) +} + +var _ ListRoleAliasesAPIClient = (*Client)(nil) + +// ListRoleAliasesPaginatorOptions is the paginator options for ListRoleAliases +type ListRoleAliasesPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListRoleAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListRoleAliases +type ListRoleAliasesPaginator struct { + options ListRoleAliasesPaginatorOptions + client ListRoleAliasesAPIClient + params *ListRoleAliasesInput + nextToken *string + firstPage bool +} + +// NewListRoleAliasesPaginator returns a new ListRoleAliasesPaginator +func NewListRoleAliasesPaginator(client ListRoleAliasesAPIClient, params *ListRoleAliasesInput, optFns ...func(*ListRoleAliasesPaginatorOptions)) *ListRoleAliasesPaginator { + options := ListRoleAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRoleAliasesInput{} + } + + return &ListRoleAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRoleAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoleAliases page. +func (p *ListRoleAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRoleAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListRoleAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoleAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListScheduledAudits.go b/service/iot/api_op_ListScheduledAudits.go index bf648baf3bb..3e7cff324a2 100644 --- a/service/iot/api_op_ListScheduledAudits.go +++ b/service/iot/api_op_ListScheduledAudits.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -106,6 +107,88 @@ func addOperationListScheduledAuditsMiddlewares(stack *middleware.Stack, options return nil } +// ListScheduledAuditsAPIClient is a client that implements the ListScheduledAudits +// operation. +type ListScheduledAuditsAPIClient interface { + ListScheduledAudits(context.Context, *ListScheduledAuditsInput, ...func(*Options)) (*ListScheduledAuditsOutput, error) +} + +var _ ListScheduledAuditsAPIClient = (*Client)(nil) + +// ListScheduledAuditsPaginatorOptions is the paginator options for +// ListScheduledAudits +type ListScheduledAuditsPaginatorOptions struct { + // The maximum number of results to return at one time. The default is 25. + 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 +} + +// ListScheduledAuditsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListScheduledAudits +type ListScheduledAuditsPaginator struct { + options ListScheduledAuditsPaginatorOptions + client ListScheduledAuditsAPIClient + params *ListScheduledAuditsInput + nextToken *string + firstPage bool +} + +// NewListScheduledAuditsPaginator returns a new ListScheduledAuditsPaginator +func NewListScheduledAuditsPaginator(client ListScheduledAuditsAPIClient, params *ListScheduledAuditsInput, optFns ...func(*ListScheduledAuditsPaginatorOptions)) *ListScheduledAuditsPaginator { + options := ListScheduledAuditsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScheduledAuditsInput{} + } + + return &ListScheduledAuditsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScheduledAuditsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListScheduledAudits page. +func (p *ListScheduledAuditsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScheduledAuditsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListScheduledAudits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScheduledAudits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListSecurityProfiles.go b/service/iot/api_op_ListSecurityProfiles.go index 677ca3ba21b..322895b5c03 100644 --- a/service/iot/api_op_ListSecurityProfiles.go +++ b/service/iot/api_op_ListSecurityProfiles.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -112,6 +113,88 @@ func addOperationListSecurityProfilesMiddlewares(stack *middleware.Stack, option return nil } +// ListSecurityProfilesAPIClient is a client that implements the +// ListSecurityProfiles operation. +type ListSecurityProfilesAPIClient interface { + ListSecurityProfiles(context.Context, *ListSecurityProfilesInput, ...func(*Options)) (*ListSecurityProfilesOutput, error) +} + +var _ ListSecurityProfilesAPIClient = (*Client)(nil) + +// ListSecurityProfilesPaginatorOptions is the paginator options for +// ListSecurityProfiles +type ListSecurityProfilesPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListSecurityProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListSecurityProfiles +type ListSecurityProfilesPaginator struct { + options ListSecurityProfilesPaginatorOptions + client ListSecurityProfilesAPIClient + params *ListSecurityProfilesInput + nextToken *string + firstPage bool +} + +// NewListSecurityProfilesPaginator returns a new ListSecurityProfilesPaginator +func NewListSecurityProfilesPaginator(client ListSecurityProfilesAPIClient, params *ListSecurityProfilesInput, optFns ...func(*ListSecurityProfilesPaginatorOptions)) *ListSecurityProfilesPaginator { + options := ListSecurityProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesInput{} + } + + return &ListSecurityProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecurityProfiles page. +func (p *ListSecurityProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSecurityProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListSecurityProfilesForTarget.go b/service/iot/api_op_ListSecurityProfilesForTarget.go index d3a457bc79d..0aea1671ea0 100644 --- a/service/iot/api_op_ListSecurityProfilesForTarget.go +++ b/service/iot/api_op_ListSecurityProfilesForTarget.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -118,6 +119,89 @@ func addOperationListSecurityProfilesForTargetMiddlewares(stack *middleware.Stac return nil } +// ListSecurityProfilesForTargetAPIClient is a client that implements the +// ListSecurityProfilesForTarget operation. +type ListSecurityProfilesForTargetAPIClient interface { + ListSecurityProfilesForTarget(context.Context, *ListSecurityProfilesForTargetInput, ...func(*Options)) (*ListSecurityProfilesForTargetOutput, error) +} + +var _ ListSecurityProfilesForTargetAPIClient = (*Client)(nil) + +// ListSecurityProfilesForTargetPaginatorOptions is the paginator options for +// ListSecurityProfilesForTarget +type ListSecurityProfilesForTargetPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListSecurityProfilesForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListSecurityProfilesForTarget +type ListSecurityProfilesForTargetPaginator struct { + options ListSecurityProfilesForTargetPaginatorOptions + client ListSecurityProfilesForTargetAPIClient + params *ListSecurityProfilesForTargetInput + nextToken *string + firstPage bool +} + +// NewListSecurityProfilesForTargetPaginator returns a new +// ListSecurityProfilesForTargetPaginator +func NewListSecurityProfilesForTargetPaginator(client ListSecurityProfilesForTargetAPIClient, params *ListSecurityProfilesForTargetInput, optFns ...func(*ListSecurityProfilesForTargetPaginatorOptions)) *ListSecurityProfilesForTargetPaginator { + options := ListSecurityProfilesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityProfilesForTargetInput{} + } + + return &ListSecurityProfilesForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityProfilesForTargetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecurityProfilesForTarget page. +func (p *ListSecurityProfilesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityProfilesForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSecurityProfilesForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityProfilesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListStreams.go b/service/iot/api_op_ListStreams.go index 50f11446a53..d8da372511b 100644 --- a/service/iot/api_op_ListStreams.go +++ b/service/iot/api_op_ListStreams.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -108,6 +109,86 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // The maximum number of results to return at a time. + 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 +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTagsForResource.go b/service/iot/api_op_ListTagsForResource.go index c9f03c6ea22..9a1f1549e2c 100644 --- a/service/iot/api_op_ListTagsForResource.go +++ b/service/iot/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -111,6 +112,81 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTargetsForPolicy.go b/service/iot/api_op_ListTargetsForPolicy.go index 1e12aa01d2d..4753e9d46d4 100644 --- a/service/iot/api_op_ListTargetsForPolicy.go +++ b/service/iot/api_op_ListTargetsForPolicy.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -112,6 +113,88 @@ func addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, option return nil } +// ListTargetsForPolicyAPIClient is a client that implements the +// ListTargetsForPolicy operation. +type ListTargetsForPolicyAPIClient interface { + ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) +} + +var _ ListTargetsForPolicyAPIClient = (*Client)(nil) + +// ListTargetsForPolicyPaginatorOptions is the paginator options for +// ListTargetsForPolicy +type ListTargetsForPolicyPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListTargetsForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTargetsForPolicy +type ListTargetsForPolicyPaginator struct { + options ListTargetsForPolicyPaginatorOptions + client ListTargetsForPolicyAPIClient + params *ListTargetsForPolicyInput + nextToken *string + firstPage bool +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForPolicyInput{} + } + + return &ListTargetsForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTargetsForPolicy page. +func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListTargetsForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTargetsForSecurityProfile.go b/service/iot/api_op_ListTargetsForSecurityProfile.go index 59ed7e15b72..6025945000b 100644 --- a/service/iot/api_op_ListTargetsForSecurityProfile.go +++ b/service/iot/api_op_ListTargetsForSecurityProfile.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -115,6 +116,89 @@ func addOperationListTargetsForSecurityProfileMiddlewares(stack *middleware.Stac return nil } +// ListTargetsForSecurityProfileAPIClient is a client that implements the +// ListTargetsForSecurityProfile operation. +type ListTargetsForSecurityProfileAPIClient interface { + ListTargetsForSecurityProfile(context.Context, *ListTargetsForSecurityProfileInput, ...func(*Options)) (*ListTargetsForSecurityProfileOutput, error) +} + +var _ ListTargetsForSecurityProfileAPIClient = (*Client)(nil) + +// ListTargetsForSecurityProfilePaginatorOptions is the paginator options for +// ListTargetsForSecurityProfile +type ListTargetsForSecurityProfilePaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListTargetsForSecurityProfilePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTargetsForSecurityProfile +type ListTargetsForSecurityProfilePaginator struct { + options ListTargetsForSecurityProfilePaginatorOptions + client ListTargetsForSecurityProfileAPIClient + params *ListTargetsForSecurityProfileInput + nextToken *string + firstPage bool +} + +// NewListTargetsForSecurityProfilePaginator returns a new +// ListTargetsForSecurityProfilePaginator +func NewListTargetsForSecurityProfilePaginator(client ListTargetsForSecurityProfileAPIClient, params *ListTargetsForSecurityProfileInput, optFns ...func(*ListTargetsForSecurityProfilePaginatorOptions)) *ListTargetsForSecurityProfilePaginator { + options := ListTargetsForSecurityProfilePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForSecurityProfileInput{} + } + + return &ListTargetsForSecurityProfilePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForSecurityProfilePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTargetsForSecurityProfile page. +func (p *ListTargetsForSecurityProfilePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForSecurityProfileOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTargetsForSecurityProfile(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForSecurityProfile(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingGroups.go b/service/iot/api_op_ListThingGroups.go index 267fd3ba406..9a13967bfcb 100644 --- a/service/iot/api_op_ListThingGroups.go +++ b/service/iot/api_op_ListThingGroups.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -115,6 +116,87 @@ func addOperationListThingGroupsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListThingGroupsAPIClient is a client that implements the ListThingGroups +// operation. +type ListThingGroupsAPIClient interface { + ListThingGroups(context.Context, *ListThingGroupsInput, ...func(*Options)) (*ListThingGroupsOutput, error) +} + +var _ ListThingGroupsAPIClient = (*Client)(nil) + +// ListThingGroupsPaginatorOptions is the paginator options for ListThingGroups +type ListThingGroupsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListThingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingGroups +type ListThingGroupsPaginator struct { + options ListThingGroupsPaginatorOptions + client ListThingGroupsAPIClient + params *ListThingGroupsInput + nextToken *string + firstPage bool +} + +// NewListThingGroupsPaginator returns a new ListThingGroupsPaginator +func NewListThingGroupsPaginator(client ListThingGroupsAPIClient, params *ListThingGroupsInput, optFns ...func(*ListThingGroupsPaginatorOptions)) *ListThingGroupsPaginator { + options := ListThingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingGroupsInput{} + } + + return &ListThingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingGroups page. +func (p *ListThingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingGroupsForThing.go b/service/iot/api_op_ListThingGroupsForThing.go index fcf4bd260ae..01fc4ff674e 100644 --- a/service/iot/api_op_ListThingGroupsForThing.go +++ b/service/iot/api_op_ListThingGroupsForThing.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -114,6 +115,89 @@ func addOperationListThingGroupsForThingMiddlewares(stack *middleware.Stack, opt return nil } +// ListThingGroupsForThingAPIClient is a client that implements the +// ListThingGroupsForThing operation. +type ListThingGroupsForThingAPIClient interface { + ListThingGroupsForThing(context.Context, *ListThingGroupsForThingInput, ...func(*Options)) (*ListThingGroupsForThingOutput, error) +} + +var _ ListThingGroupsForThingAPIClient = (*Client)(nil) + +// ListThingGroupsForThingPaginatorOptions is the paginator options for +// ListThingGroupsForThing +type ListThingGroupsForThingPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListThingGroupsForThingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingGroupsForThing +type ListThingGroupsForThingPaginator struct { + options ListThingGroupsForThingPaginatorOptions + client ListThingGroupsForThingAPIClient + params *ListThingGroupsForThingInput + nextToken *string + firstPage bool +} + +// NewListThingGroupsForThingPaginator returns a new +// ListThingGroupsForThingPaginator +func NewListThingGroupsForThingPaginator(client ListThingGroupsForThingAPIClient, params *ListThingGroupsForThingInput, optFns ...func(*ListThingGroupsForThingPaginatorOptions)) *ListThingGroupsForThingPaginator { + options := ListThingGroupsForThingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingGroupsForThingInput{} + } + + return &ListThingGroupsForThingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingGroupsForThingPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingGroupsForThing page. +func (p *ListThingGroupsForThingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingGroupsForThingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingGroupsForThing(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingGroupsForThing(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingRegistrationTaskReports.go b/service/iot/api_op_ListThingRegistrationTaskReports.go index e7418b7ea09..5bf023127b8 100644 --- a/service/iot/api_op_ListThingRegistrationTaskReports.go +++ b/service/iot/api_op_ListThingRegistrationTaskReports.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -122,6 +123,89 @@ func addOperationListThingRegistrationTaskReportsMiddlewares(stack *middleware.S return nil } +// ListThingRegistrationTaskReportsAPIClient is a client that implements the +// ListThingRegistrationTaskReports operation. +type ListThingRegistrationTaskReportsAPIClient interface { + ListThingRegistrationTaskReports(context.Context, *ListThingRegistrationTaskReportsInput, ...func(*Options)) (*ListThingRegistrationTaskReportsOutput, error) +} + +var _ ListThingRegistrationTaskReportsAPIClient = (*Client)(nil) + +// ListThingRegistrationTaskReportsPaginatorOptions is the paginator options for +// ListThingRegistrationTaskReports +type ListThingRegistrationTaskReportsPaginatorOptions struct { + // The maximum number of results to return per request. + 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 +} + +// ListThingRegistrationTaskReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingRegistrationTaskReports +type ListThingRegistrationTaskReportsPaginator struct { + options ListThingRegistrationTaskReportsPaginatorOptions + client ListThingRegistrationTaskReportsAPIClient + params *ListThingRegistrationTaskReportsInput + nextToken *string + firstPage bool +} + +// NewListThingRegistrationTaskReportsPaginator returns a new +// ListThingRegistrationTaskReportsPaginator +func NewListThingRegistrationTaskReportsPaginator(client ListThingRegistrationTaskReportsAPIClient, params *ListThingRegistrationTaskReportsInput, optFns ...func(*ListThingRegistrationTaskReportsPaginatorOptions)) *ListThingRegistrationTaskReportsPaginator { + options := ListThingRegistrationTaskReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingRegistrationTaskReportsInput{} + } + + return &ListThingRegistrationTaskReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingRegistrationTaskReportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingRegistrationTaskReports page. +func (p *ListThingRegistrationTaskReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingRegistrationTaskReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingRegistrationTaskReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingRegistrationTaskReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingRegistrationTasks.go b/service/iot/api_op_ListThingRegistrationTasks.go index 32bd5937e70..7e3d08f3b98 100644 --- a/service/iot/api_op_ListThingRegistrationTasks.go +++ b/service/iot/api_op_ListThingRegistrationTasks.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -109,6 +110,89 @@ func addOperationListThingRegistrationTasksMiddlewares(stack *middleware.Stack, return nil } +// ListThingRegistrationTasksAPIClient is a client that implements the +// ListThingRegistrationTasks operation. +type ListThingRegistrationTasksAPIClient interface { + ListThingRegistrationTasks(context.Context, *ListThingRegistrationTasksInput, ...func(*Options)) (*ListThingRegistrationTasksOutput, error) +} + +var _ ListThingRegistrationTasksAPIClient = (*Client)(nil) + +// ListThingRegistrationTasksPaginatorOptions is the paginator options for +// ListThingRegistrationTasks +type ListThingRegistrationTasksPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListThingRegistrationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingRegistrationTasks +type ListThingRegistrationTasksPaginator struct { + options ListThingRegistrationTasksPaginatorOptions + client ListThingRegistrationTasksAPIClient + params *ListThingRegistrationTasksInput + nextToken *string + firstPage bool +} + +// NewListThingRegistrationTasksPaginator returns a new +// ListThingRegistrationTasksPaginator +func NewListThingRegistrationTasksPaginator(client ListThingRegistrationTasksAPIClient, params *ListThingRegistrationTasksInput, optFns ...func(*ListThingRegistrationTasksPaginatorOptions)) *ListThingRegistrationTasksPaginator { + options := ListThingRegistrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingRegistrationTasksInput{} + } + + return &ListThingRegistrationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingRegistrationTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingRegistrationTasks page. +func (p *ListThingRegistrationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingRegistrationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingRegistrationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingRegistrationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingTypes.go b/service/iot/api_op_ListThingTypes.go index 7e6950c4f0b..486047035d7 100644 --- a/service/iot/api_op_ListThingTypes.go +++ b/service/iot/api_op_ListThingTypes.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -111,6 +112,87 @@ func addOperationListThingTypesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListThingTypesAPIClient is a client that implements the ListThingTypes +// operation. +type ListThingTypesAPIClient interface { + ListThingTypes(context.Context, *ListThingTypesInput, ...func(*Options)) (*ListThingTypesOutput, error) +} + +var _ ListThingTypesAPIClient = (*Client)(nil) + +// ListThingTypesPaginatorOptions is the paginator options for ListThingTypes +type ListThingTypesPaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListThingTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingTypes +type ListThingTypesPaginator struct { + options ListThingTypesPaginatorOptions + client ListThingTypesAPIClient + params *ListThingTypesInput + nextToken *string + firstPage bool +} + +// NewListThingTypesPaginator returns a new ListThingTypesPaginator +func NewListThingTypesPaginator(client ListThingTypesAPIClient, params *ListThingTypesInput, optFns ...func(*ListThingTypesPaginatorOptions)) *ListThingTypesPaginator { + options := ListThingTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingTypesInput{} + } + + return &ListThingTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingTypes page. +func (p *ListThingTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThings.go b/service/iot/api_op_ListThings.go index c4d42e2df7c..354cb0eb54e 100644 --- a/service/iot/api_op_ListThings.go +++ b/service/iot/api_op_ListThings.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -123,6 +124,86 @@ func addOperationListThingsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListThingsAPIClient is a client that implements the ListThings operation. +type ListThingsAPIClient interface { + ListThings(context.Context, *ListThingsInput, ...func(*Options)) (*ListThingsOutput, error) +} + +var _ ListThingsAPIClient = (*Client)(nil) + +// ListThingsPaginatorOptions is the paginator options for ListThings +type ListThingsPaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThings +type ListThingsPaginator struct { + options ListThingsPaginatorOptions + client ListThingsAPIClient + params *ListThingsInput + nextToken *string + firstPage bool +} + +// NewListThingsPaginator returns a new ListThingsPaginator +func NewListThingsPaginator(client ListThingsAPIClient, params *ListThingsInput, optFns ...func(*ListThingsPaginatorOptions)) *ListThingsPaginator { + options := ListThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInput{} + } + + return &ListThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThings page. +func (p *ListThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingsInBillingGroup.go b/service/iot/api_op_ListThingsInBillingGroup.go index a5c4fc7d16a..4f0f6fcfe46 100644 --- a/service/iot/api_op_ListThingsInBillingGroup.go +++ b/service/iot/api_op_ListThingsInBillingGroup.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -113,6 +114,89 @@ func addOperationListThingsInBillingGroupMiddlewares(stack *middleware.Stack, op return nil } +// ListThingsInBillingGroupAPIClient is a client that implements the +// ListThingsInBillingGroup operation. +type ListThingsInBillingGroupAPIClient interface { + ListThingsInBillingGroup(context.Context, *ListThingsInBillingGroupInput, ...func(*Options)) (*ListThingsInBillingGroupOutput, error) +} + +var _ ListThingsInBillingGroupAPIClient = (*Client)(nil) + +// ListThingsInBillingGroupPaginatorOptions is the paginator options for +// ListThingsInBillingGroup +type ListThingsInBillingGroupPaginatorOptions struct { + // The maximum number of results to return per request. + 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 +} + +// ListThingsInBillingGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingsInBillingGroup +type ListThingsInBillingGroupPaginator struct { + options ListThingsInBillingGroupPaginatorOptions + client ListThingsInBillingGroupAPIClient + params *ListThingsInBillingGroupInput + nextToken *string + firstPage bool +} + +// NewListThingsInBillingGroupPaginator returns a new +// ListThingsInBillingGroupPaginator +func NewListThingsInBillingGroupPaginator(client ListThingsInBillingGroupAPIClient, params *ListThingsInBillingGroupInput, optFns ...func(*ListThingsInBillingGroupPaginatorOptions)) *ListThingsInBillingGroupPaginator { + options := ListThingsInBillingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInBillingGroupInput{} + } + + return &ListThingsInBillingGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsInBillingGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingsInBillingGroup page. +func (p *ListThingsInBillingGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsInBillingGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingsInBillingGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingsInBillingGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListThingsInThingGroup.go b/service/iot/api_op_ListThingsInThingGroup.go index 7e517cf734d..4b84a237191 100644 --- a/service/iot/api_op_ListThingsInThingGroup.go +++ b/service/iot/api_op_ListThingsInThingGroup.go @@ -4,6 +4,7 @@ package iot 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/awslabs/smithy-go/middleware" @@ -116,6 +117,88 @@ func addOperationListThingsInThingGroupMiddlewares(stack *middleware.Stack, opti return nil } +// ListThingsInThingGroupAPIClient is a client that implements the +// ListThingsInThingGroup operation. +type ListThingsInThingGroupAPIClient interface { + ListThingsInThingGroup(context.Context, *ListThingsInThingGroupInput, ...func(*Options)) (*ListThingsInThingGroupOutput, error) +} + +var _ ListThingsInThingGroupAPIClient = (*Client)(nil) + +// ListThingsInThingGroupPaginatorOptions is the paginator options for +// ListThingsInThingGroup +type ListThingsInThingGroupPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListThingsInThingGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListThingsInThingGroup +type ListThingsInThingGroupPaginator struct { + options ListThingsInThingGroupPaginatorOptions + client ListThingsInThingGroupAPIClient + params *ListThingsInThingGroupInput + nextToken *string + firstPage bool +} + +// NewListThingsInThingGroupPaginator returns a new ListThingsInThingGroupPaginator +func NewListThingsInThingGroupPaginator(client ListThingsInThingGroupAPIClient, params *ListThingsInThingGroupInput, optFns ...func(*ListThingsInThingGroupPaginatorOptions)) *ListThingsInThingGroupPaginator { + options := ListThingsInThingGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListThingsInThingGroupInput{} + } + + return &ListThingsInThingGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListThingsInThingGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListThingsInThingGroup page. +func (p *ListThingsInThingGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListThingsInThingGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListThingsInThingGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListThingsInThingGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTopicRuleDestinations.go b/service/iot/api_op_ListTopicRuleDestinations.go index 4374298ab34..3fafca630ac 100644 --- a/service/iot/api_op_ListTopicRuleDestinations.go +++ b/service/iot/api_op_ListTopicRuleDestinations.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -105,6 +106,89 @@ func addOperationListTopicRuleDestinationsMiddlewares(stack *middleware.Stack, o return nil } +// ListTopicRuleDestinationsAPIClient is a client that implements the +// ListTopicRuleDestinations operation. +type ListTopicRuleDestinationsAPIClient interface { + ListTopicRuleDestinations(context.Context, *ListTopicRuleDestinationsInput, ...func(*Options)) (*ListTopicRuleDestinationsOutput, error) +} + +var _ ListTopicRuleDestinationsAPIClient = (*Client)(nil) + +// ListTopicRuleDestinationsPaginatorOptions is the paginator options for +// ListTopicRuleDestinations +type ListTopicRuleDestinationsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListTopicRuleDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTopicRuleDestinations +type ListTopicRuleDestinationsPaginator struct { + options ListTopicRuleDestinationsPaginatorOptions + client ListTopicRuleDestinationsAPIClient + params *ListTopicRuleDestinationsInput + nextToken *string + firstPage bool +} + +// NewListTopicRuleDestinationsPaginator returns a new +// ListTopicRuleDestinationsPaginator +func NewListTopicRuleDestinationsPaginator(client ListTopicRuleDestinationsAPIClient, params *ListTopicRuleDestinationsInput, optFns ...func(*ListTopicRuleDestinationsPaginatorOptions)) *ListTopicRuleDestinationsPaginator { + options := ListTopicRuleDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicRuleDestinationsInput{} + } + + return &ListTopicRuleDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicRuleDestinationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTopicRuleDestinations page. +func (p *ListTopicRuleDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicRuleDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTopicRuleDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicRuleDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListTopicRules.go b/service/iot/api_op_ListTopicRules.go index 193037298af..f8b359b06c3 100644 --- a/service/iot/api_op_ListTopicRules.go +++ b/service/iot/api_op_ListTopicRules.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -113,6 +114,87 @@ func addOperationListTopicRulesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListTopicRulesAPIClient is a client that implements the ListTopicRules +// operation. +type ListTopicRulesAPIClient interface { + ListTopicRules(context.Context, *ListTopicRulesInput, ...func(*Options)) (*ListTopicRulesOutput, error) +} + +var _ ListTopicRulesAPIClient = (*Client)(nil) + +// ListTopicRulesPaginatorOptions is the paginator options for ListTopicRules +type ListTopicRulesPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListTopicRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListTopicRules +type ListTopicRulesPaginator struct { + options ListTopicRulesPaginatorOptions + client ListTopicRulesAPIClient + params *ListTopicRulesInput + nextToken *string + firstPage bool +} + +// NewListTopicRulesPaginator returns a new ListTopicRulesPaginator +func NewListTopicRulesPaginator(client ListTopicRulesAPIClient, params *ListTopicRulesInput, optFns ...func(*ListTopicRulesPaginatorOptions)) *ListTopicRulesPaginator { + options := ListTopicRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicRulesInput{} + } + + return &ListTopicRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTopicRules page. +func (p *ListTopicRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTopicRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopicRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListV2LoggingLevels.go b/service/iot/api_op_ListV2LoggingLevels.go index 5ae37f2b146..9b4f019babf 100644 --- a/service/iot/api_op_ListV2LoggingLevels.go +++ b/service/iot/api_op_ListV2LoggingLevels.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -110,6 +111,88 @@ func addOperationListV2LoggingLevelsMiddlewares(stack *middleware.Stack, options return nil } +// ListV2LoggingLevelsAPIClient is a client that implements the ListV2LoggingLevels +// operation. +type ListV2LoggingLevelsAPIClient interface { + ListV2LoggingLevels(context.Context, *ListV2LoggingLevelsInput, ...func(*Options)) (*ListV2LoggingLevelsOutput, error) +} + +var _ ListV2LoggingLevelsAPIClient = (*Client)(nil) + +// ListV2LoggingLevelsPaginatorOptions is the paginator options for +// ListV2LoggingLevels +type ListV2LoggingLevelsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListV2LoggingLevelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListV2LoggingLevels +type ListV2LoggingLevelsPaginator struct { + options ListV2LoggingLevelsPaginatorOptions + client ListV2LoggingLevelsAPIClient + params *ListV2LoggingLevelsInput + nextToken *string + firstPage bool +} + +// NewListV2LoggingLevelsPaginator returns a new ListV2LoggingLevelsPaginator +func NewListV2LoggingLevelsPaginator(client ListV2LoggingLevelsAPIClient, params *ListV2LoggingLevelsInput, optFns ...func(*ListV2LoggingLevelsPaginatorOptions)) *ListV2LoggingLevelsPaginator { + options := ListV2LoggingLevelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListV2LoggingLevelsInput{} + } + + return &ListV2LoggingLevelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListV2LoggingLevelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListV2LoggingLevels page. +func (p *ListV2LoggingLevelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListV2LoggingLevelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListV2LoggingLevels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListV2LoggingLevels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/api_op_ListViolationEvents.go b/service/iot/api_op_ListViolationEvents.go index 11c537993e1..175bda9a2d8 100644 --- a/service/iot/api_op_ListViolationEvents.go +++ b/service/iot/api_op_ListViolationEvents.go @@ -4,6 +4,7 @@ package iot 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/iot/types" @@ -131,6 +132,88 @@ func addOperationListViolationEventsMiddlewares(stack *middleware.Stack, options return nil } +// ListViolationEventsAPIClient is a client that implements the ListViolationEvents +// operation. +type ListViolationEventsAPIClient interface { + ListViolationEvents(context.Context, *ListViolationEventsInput, ...func(*Options)) (*ListViolationEventsOutput, error) +} + +var _ ListViolationEventsAPIClient = (*Client)(nil) + +// ListViolationEventsPaginatorOptions is the paginator options for +// ListViolationEvents +type ListViolationEventsPaginatorOptions struct { + // The maximum number of results to return at one time. + 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 +} + +// ListViolationEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot.ListViolationEvents +type ListViolationEventsPaginator struct { + options ListViolationEventsPaginatorOptions + client ListViolationEventsAPIClient + params *ListViolationEventsInput + nextToken *string + firstPage bool +} + +// NewListViolationEventsPaginator returns a new ListViolationEventsPaginator +func NewListViolationEventsPaginator(client ListViolationEventsAPIClient, params *ListViolationEventsInput, optFns ...func(*ListViolationEventsPaginatorOptions)) *ListViolationEventsPaginator { + options := ListViolationEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListViolationEventsInput{} + } + + return &ListViolationEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListViolationEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListViolationEvents page. +func (p *ListViolationEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListViolationEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListViolationEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListViolationEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot/endpoints.go b/service/iot/endpoints.go index df0de9fabb9..2a126f697db 100644 --- a/service/iot/endpoints.go +++ b/service/iot/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iot1clickdevicesservice/endpoints.go b/service/iot1clickdevicesservice/endpoints.go index d21f2518a5a..00315d00ed7 100644 --- a/service/iot1clickdevicesservice/endpoints.go +++ b/service/iot1clickdevicesservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iot1clickprojects/api_op_ListPlacements.go b/service/iot1clickprojects/api_op_ListPlacements.go index 76b74f6f6bc..b5b93d908b3 100644 --- a/service/iot1clickprojects/api_op_ListPlacements.go +++ b/service/iot1clickprojects/api_op_ListPlacements.go @@ -4,6 +4,7 @@ package iot1clickprojects 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/iot1clickprojects/types" @@ -117,6 +118,88 @@ func addOperationListPlacementsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListPlacementsAPIClient is a client that implements the ListPlacements +// operation. +type ListPlacementsAPIClient interface { + ListPlacements(context.Context, *ListPlacementsInput, ...func(*Options)) (*ListPlacementsOutput, error) +} + +var _ ListPlacementsAPIClient = (*Client)(nil) + +// ListPlacementsPaginatorOptions is the paginator options for ListPlacements +type ListPlacementsPaginatorOptions struct { + // The maximum number of results to return per request. If not set, a default value + // of 100 is used. + 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 +} + +// ListPlacementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot1clickprojects.ListPlacements +type ListPlacementsPaginator struct { + options ListPlacementsPaginatorOptions + client ListPlacementsAPIClient + params *ListPlacementsInput + nextToken *string + firstPage bool +} + +// NewListPlacementsPaginator returns a new ListPlacementsPaginator +func NewListPlacementsPaginator(client ListPlacementsAPIClient, params *ListPlacementsInput, optFns ...func(*ListPlacementsPaginatorOptions)) *ListPlacementsPaginator { + options := ListPlacementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlacementsInput{} + } + + return &ListPlacementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlacementsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPlacements page. +func (p *ListPlacementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlacementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPlacements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlacements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot1clickprojects/api_op_ListProjects.go b/service/iot1clickprojects/api_op_ListProjects.go index 56be06ac081..3507dcf291b 100644 --- a/service/iot1clickprojects/api_op_ListProjects.go +++ b/service/iot1clickprojects/api_op_ListProjects.go @@ -4,6 +4,7 @@ package iot1clickprojects 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/iot1clickprojects/types" @@ -110,6 +111,87 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // The maximum number of results to return per request. If not set, a default value + // of 100 is used. + 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 +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iot1clickprojects.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iot1clickprojects/endpoints.go b/service/iot1clickprojects/endpoints.go index c2cbaeac046..641c98d11cf 100644 --- a/service/iot1clickprojects/endpoints.go +++ b/service/iot1clickprojects/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotanalytics/api_op_ListChannels.go b/service/iotanalytics/api_op_ListChannels.go index aff27e7194f..98627dd2c4e 100644 --- a/service/iotanalytics/api_op_ListChannels.go +++ b/service/iotanalytics/api_op_ListChannels.go @@ -4,6 +4,7 @@ package iotanalytics 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/iotanalytics/types" @@ -107,6 +108,87 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + 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 +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatasetContents.go b/service/iotanalytics/api_op_ListDatasetContents.go index 7e1ed552b83..d6496aa048c 100644 --- a/service/iotanalytics/api_op_ListDatasetContents.go +++ b/service/iotanalytics/api_op_ListDatasetContents.go @@ -4,6 +4,7 @@ package iotanalytics 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/iotanalytics/types" @@ -125,6 +126,88 @@ func addOperationListDatasetContentsMiddlewares(stack *middleware.Stack, options return nil } +// ListDatasetContentsAPIClient is a client that implements the ListDatasetContents +// operation. +type ListDatasetContentsAPIClient interface { + ListDatasetContents(context.Context, *ListDatasetContentsInput, ...func(*Options)) (*ListDatasetContentsOutput, error) +} + +var _ ListDatasetContentsAPIClient = (*Client)(nil) + +// ListDatasetContentsPaginatorOptions is the paginator options for +// ListDatasetContents +type ListDatasetContentsPaginatorOptions struct { + // The maximum number of results to return in this request. + 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 +} + +// ListDatasetContentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatasetContents +type ListDatasetContentsPaginator struct { + options ListDatasetContentsPaginatorOptions + client ListDatasetContentsAPIClient + params *ListDatasetContentsInput + nextToken *string + firstPage bool +} + +// NewListDatasetContentsPaginator returns a new ListDatasetContentsPaginator +func NewListDatasetContentsPaginator(client ListDatasetContentsAPIClient, params *ListDatasetContentsInput, optFns ...func(*ListDatasetContentsPaginatorOptions)) *ListDatasetContentsPaginator { + options := ListDatasetContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetContentsInput{} + } + + return &ListDatasetContentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetContentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasetContents page. +func (p *ListDatasetContentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetContentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasetContents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetContents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatasets.go b/service/iotanalytics/api_op_ListDatasets.go index 6f5d4c011fe..27cbcf1a991 100644 --- a/service/iotanalytics/api_op_ListDatasets.go +++ b/service/iotanalytics/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package iotanalytics 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/iotanalytics/types" @@ -107,6 +108,87 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + 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 +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListDatastores.go b/service/iotanalytics/api_op_ListDatastores.go index 04ca950cabf..07d9ffd7688 100644 --- a/service/iotanalytics/api_op_ListDatastores.go +++ b/service/iotanalytics/api_op_ListDatastores.go @@ -4,6 +4,7 @@ package iotanalytics 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/iotanalytics/types" @@ -107,6 +108,88 @@ func addOperationListDatastoresMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListDatastoresAPIClient is a client that implements the ListDatastores +// operation. +type ListDatastoresAPIClient interface { + ListDatastores(context.Context, *ListDatastoresInput, ...func(*Options)) (*ListDatastoresOutput, error) +} + +var _ ListDatastoresAPIClient = (*Client)(nil) + +// ListDatastoresPaginatorOptions is the paginator options for ListDatastores +type ListDatastoresPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + 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 +} + +// ListDatastoresPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListDatastores +type ListDatastoresPaginator struct { + options ListDatastoresPaginatorOptions + client ListDatastoresAPIClient + params *ListDatastoresInput + nextToken *string + firstPage bool +} + +// NewListDatastoresPaginator returns a new ListDatastoresPaginator +func NewListDatastoresPaginator(client ListDatastoresAPIClient, params *ListDatastoresInput, optFns ...func(*ListDatastoresPaginatorOptions)) *ListDatastoresPaginator { + options := ListDatastoresPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatastoresInput{} + } + + return &ListDatastoresPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatastoresPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatastores page. +func (p *ListDatastoresPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatastoresOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatastores(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatastores(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/api_op_ListPipelines.go b/service/iotanalytics/api_op_ListPipelines.go index 3b644515af2..dfd9eb9179e 100644 --- a/service/iotanalytics/api_op_ListPipelines.go +++ b/service/iotanalytics/api_op_ListPipelines.go @@ -4,6 +4,7 @@ package iotanalytics 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/iotanalytics/types" @@ -107,6 +108,87 @@ func addOperationListPipelinesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListPipelinesAPIClient is a client that implements the ListPipelines operation. +type ListPipelinesAPIClient interface { + ListPipelines(context.Context, *ListPipelinesInput, ...func(*Options)) (*ListPipelinesOutput, error) +} + +var _ ListPipelinesAPIClient = (*Client)(nil) + +// ListPipelinesPaginatorOptions is the paginator options for ListPipelines +type ListPipelinesPaginatorOptions struct { + // The maximum number of results to return in this request. The default value is + // 100. + 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 +} + +// ListPipelinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotanalytics.ListPipelines +type ListPipelinesPaginator struct { + options ListPipelinesPaginatorOptions + client ListPipelinesAPIClient + params *ListPipelinesInput + nextToken *string + firstPage bool +} + +// NewListPipelinesPaginator returns a new ListPipelinesPaginator +func NewListPipelinesPaginator(client ListPipelinesAPIClient, params *ListPipelinesInput, optFns ...func(*ListPipelinesPaginatorOptions)) *ListPipelinesPaginator { + options := ListPipelinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPipelinesInput{} + } + + return &ListPipelinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPipelinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPipelines page. +func (p *ListPipelinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPipelinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPipelines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPipelines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotanalytics/endpoints.go b/service/iotanalytics/endpoints.go index e6e50af6106..52b08602b79 100644 --- a/service/iotanalytics/endpoints.go +++ b/service/iotanalytics/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotdataplane/endpoints.go b/service/iotdataplane/endpoints.go index d0f7481304b..401fc7c4afb 100644 --- a/service/iotdataplane/endpoints.go +++ b/service/iotdataplane/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotevents/endpoints.go b/service/iotevents/endpoints.go index a4a64e0e3c5..d3ed4ecfcb0 100644 --- a/service/iotevents/endpoints.go +++ b/service/iotevents/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ioteventsdata/endpoints.go b/service/ioteventsdata/endpoints.go index f4b4e246ba7..64cf34a056b 100644 --- a/service/ioteventsdata/endpoints.go +++ b/service/ioteventsdata/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotjobsdataplane/endpoints.go b/service/iotjobsdataplane/endpoints.go index 40c61f9bc5b..a0ba0c59407 100644 --- a/service/iotjobsdataplane/endpoints.go +++ b/service/iotjobsdataplane/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotsecuretunneling/api_op_ListTunnels.go b/service/iotsecuretunneling/api_op_ListTunnels.go index 2002b682d36..9c994a5df64 100644 --- a/service/iotsecuretunneling/api_op_ListTunnels.go +++ b/service/iotsecuretunneling/api_op_ListTunnels.go @@ -4,6 +4,7 @@ package iotsecuretunneling 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/iotsecuretunneling/types" @@ -109,6 +110,86 @@ func addOperationListTunnelsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListTunnelsAPIClient is a client that implements the ListTunnels operation. +type ListTunnelsAPIClient interface { + ListTunnels(context.Context, *ListTunnelsInput, ...func(*Options)) (*ListTunnelsOutput, error) +} + +var _ ListTunnelsAPIClient = (*Client)(nil) + +// ListTunnelsPaginatorOptions is the paginator options for ListTunnels +type ListTunnelsPaginatorOptions struct { + // The maximum number of results to return at once. + 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 +} + +// ListTunnelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsecuretunneling.ListTunnels +type ListTunnelsPaginator struct { + options ListTunnelsPaginatorOptions + client ListTunnelsAPIClient + params *ListTunnelsInput + nextToken *string + firstPage bool +} + +// NewListTunnelsPaginator returns a new ListTunnelsPaginator +func NewListTunnelsPaginator(client ListTunnelsAPIClient, params *ListTunnelsInput, optFns ...func(*ListTunnelsPaginatorOptions)) *ListTunnelsPaginator { + options := ListTunnelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTunnelsInput{} + } + + return &ListTunnelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTunnelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTunnels page. +func (p *ListTunnelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTunnelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTunnels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTunnels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsecuretunneling/endpoints.go b/service/iotsecuretunneling/endpoints.go index 8c55a87b359..2cd71975e73 100644 --- a/service/iotsecuretunneling/endpoints.go +++ b/service/iotsecuretunneling/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go index 23921112ce5..3fe956ddbe5 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyAggregates.go +++ b/service/iotsitewise/api_op_GetAssetPropertyAggregates.go @@ -196,6 +196,89 @@ func addEndpointPrefix_opGetAssetPropertyAggregatesMiddleware(stack *middleware. return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyAggregatesMiddleware{}, `OperationSerializer`, middleware.After) } +// GetAssetPropertyAggregatesAPIClient is a client that implements the +// GetAssetPropertyAggregates operation. +type GetAssetPropertyAggregatesAPIClient interface { + GetAssetPropertyAggregates(context.Context, *GetAssetPropertyAggregatesInput, ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error) +} + +var _ GetAssetPropertyAggregatesAPIClient = (*Client)(nil) + +// GetAssetPropertyAggregatesPaginatorOptions is the paginator options for +// GetAssetPropertyAggregates +type GetAssetPropertyAggregatesPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 100 + 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 +} + +// GetAssetPropertyAggregatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.GetAssetPropertyAggregates +type GetAssetPropertyAggregatesPaginator struct { + options GetAssetPropertyAggregatesPaginatorOptions + client GetAssetPropertyAggregatesAPIClient + params *GetAssetPropertyAggregatesInput + nextToken *string + firstPage bool +} + +// NewGetAssetPropertyAggregatesPaginator returns a new +// GetAssetPropertyAggregatesPaginator +func NewGetAssetPropertyAggregatesPaginator(client GetAssetPropertyAggregatesAPIClient, params *GetAssetPropertyAggregatesInput, optFns ...func(*GetAssetPropertyAggregatesPaginatorOptions)) *GetAssetPropertyAggregatesPaginator { + options := GetAssetPropertyAggregatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssetPropertyAggregatesInput{} + } + + return &GetAssetPropertyAggregatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssetPropertyAggregatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetAssetPropertyAggregates page. +func (p *GetAssetPropertyAggregatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyAggregatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetAssetPropertyAggregates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAssetPropertyAggregates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go index fe9d73fe156..06f0a879a7b 100644 --- a/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go +++ b/service/iotsitewise/api_op_GetAssetPropertyValueHistory.go @@ -179,6 +179,89 @@ func addEndpointPrefix_opGetAssetPropertyValueHistoryMiddleware(stack *middlewar return stack.Serialize.Insert(&endpointPrefix_opGetAssetPropertyValueHistoryMiddleware{}, `OperationSerializer`, middleware.After) } +// GetAssetPropertyValueHistoryAPIClient is a client that implements the +// GetAssetPropertyValueHistory operation. +type GetAssetPropertyValueHistoryAPIClient interface { + GetAssetPropertyValueHistory(context.Context, *GetAssetPropertyValueHistoryInput, ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error) +} + +var _ GetAssetPropertyValueHistoryAPIClient = (*Client)(nil) + +// GetAssetPropertyValueHistoryPaginatorOptions is the paginator options for +// GetAssetPropertyValueHistory +type GetAssetPropertyValueHistoryPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 100 + 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 +} + +// GetAssetPropertyValueHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.GetAssetPropertyValueHistory +type GetAssetPropertyValueHistoryPaginator struct { + options GetAssetPropertyValueHistoryPaginatorOptions + client GetAssetPropertyValueHistoryAPIClient + params *GetAssetPropertyValueHistoryInput + nextToken *string + firstPage bool +} + +// NewGetAssetPropertyValueHistoryPaginator returns a new +// GetAssetPropertyValueHistoryPaginator +func NewGetAssetPropertyValueHistoryPaginator(client GetAssetPropertyValueHistoryAPIClient, params *GetAssetPropertyValueHistoryInput, optFns ...func(*GetAssetPropertyValueHistoryPaginatorOptions)) *GetAssetPropertyValueHistoryPaginator { + options := GetAssetPropertyValueHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAssetPropertyValueHistoryInput{} + } + + return &GetAssetPropertyValueHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAssetPropertyValueHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetAssetPropertyValueHistory page. +func (p *GetAssetPropertyValueHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAssetPropertyValueHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetAssetPropertyValueHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAssetPropertyValueHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListAccessPolicies.go b/service/iotsitewise/api_op_ListAccessPolicies.go index 38b79a9b478..deb9079541d 100644 --- a/service/iotsitewise/api_op_ListAccessPolicies.go +++ b/service/iotsitewise/api_op_ListAccessPolicies.go @@ -162,6 +162,88 @@ func addEndpointPrefix_opListAccessPoliciesMiddleware(stack *middleware.Stack) e return stack.Serialize.Insert(&endpointPrefix_opListAccessPoliciesMiddleware{}, `OperationSerializer`, middleware.After) } +// ListAccessPoliciesAPIClient is a client that implements the ListAccessPolicies +// operation. +type ListAccessPoliciesAPIClient interface { + ListAccessPolicies(context.Context, *ListAccessPoliciesInput, ...func(*Options)) (*ListAccessPoliciesOutput, error) +} + +var _ ListAccessPoliciesAPIClient = (*Client)(nil) + +// ListAccessPoliciesPaginatorOptions is the paginator options for +// ListAccessPolicies +type ListAccessPoliciesPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListAccessPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAccessPolicies +type ListAccessPoliciesPaginator struct { + options ListAccessPoliciesPaginatorOptions + client ListAccessPoliciesAPIClient + params *ListAccessPoliciesInput + nextToken *string + firstPage bool +} + +// NewListAccessPoliciesPaginator returns a new ListAccessPoliciesPaginator +func NewListAccessPoliciesPaginator(client ListAccessPoliciesAPIClient, params *ListAccessPoliciesInput, optFns ...func(*ListAccessPoliciesPaginatorOptions)) *ListAccessPoliciesPaginator { + options := ListAccessPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessPoliciesInput{} + } + + return &ListAccessPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccessPolicies page. +func (p *ListAccessPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccessPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccessPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListAssetModels.go b/service/iotsitewise/api_op_ListAssetModels.go index 6c998709869..e81b8e44ece 100644 --- a/service/iotsitewise/api_op_ListAssetModels.go +++ b/service/iotsitewise/api_op_ListAssetModels.go @@ -139,6 +139,87 @@ func addEndpointPrefix_opListAssetModelsMiddleware(stack *middleware.Stack) erro return stack.Serialize.Insert(&endpointPrefix_opListAssetModelsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListAssetModelsAPIClient is a client that implements the ListAssetModels +// operation. +type ListAssetModelsAPIClient interface { + ListAssetModels(context.Context, *ListAssetModelsInput, ...func(*Options)) (*ListAssetModelsOutput, error) +} + +var _ ListAssetModelsAPIClient = (*Client)(nil) + +// ListAssetModelsPaginatorOptions is the paginator options for ListAssetModels +type ListAssetModelsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListAssetModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssetModels +type ListAssetModelsPaginator struct { + options ListAssetModelsPaginatorOptions + client ListAssetModelsAPIClient + params *ListAssetModelsInput + nextToken *string + firstPage bool +} + +// NewListAssetModelsPaginator returns a new ListAssetModelsPaginator +func NewListAssetModelsPaginator(client ListAssetModelsAPIClient, params *ListAssetModelsInput, optFns ...func(*ListAssetModelsPaginatorOptions)) *ListAssetModelsPaginator { + options := ListAssetModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetModelsInput{} + } + + return &ListAssetModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssetModels page. +func (p *ListAssetModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssetModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssetModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListAssets.go b/service/iotsitewise/api_op_ListAssets.go index 65c2cdf97c7..1df3f211813 100644 --- a/service/iotsitewise/api_op_ListAssets.go +++ b/service/iotsitewise/api_op_ListAssets.go @@ -167,6 +167,86 @@ func addEndpointPrefix_opListAssetsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListAssetsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListAssetsAPIClient is a client that implements the ListAssets operation. +type ListAssetsAPIClient interface { + ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error) +} + +var _ ListAssetsAPIClient = (*Client)(nil) + +// ListAssetsPaginatorOptions is the paginator options for ListAssets +type ListAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssets +type ListAssetsPaginator struct { + options ListAssetsPaginatorOptions + client ListAssetsAPIClient + params *ListAssetsInput + nextToken *string + firstPage bool +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetsInput{} + } + + return &ListAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssets page. +func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListAssociatedAssets.go b/service/iotsitewise/api_op_ListAssociatedAssets.go index bed47a235f7..ef01820e47e 100644 --- a/service/iotsitewise/api_op_ListAssociatedAssets.go +++ b/service/iotsitewise/api_op_ListAssociatedAssets.go @@ -176,6 +176,88 @@ func addEndpointPrefix_opListAssociatedAssetsMiddleware(stack *middleware.Stack) return stack.Serialize.Insert(&endpointPrefix_opListAssociatedAssetsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListAssociatedAssetsAPIClient is a client that implements the +// ListAssociatedAssets operation. +type ListAssociatedAssetsAPIClient interface { + ListAssociatedAssets(context.Context, *ListAssociatedAssetsInput, ...func(*Options)) (*ListAssociatedAssetsOutput, error) +} + +var _ ListAssociatedAssetsAPIClient = (*Client)(nil) + +// ListAssociatedAssetsPaginatorOptions is the paginator options for +// ListAssociatedAssets +type ListAssociatedAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListAssociatedAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListAssociatedAssets +type ListAssociatedAssetsPaginator struct { + options ListAssociatedAssetsPaginatorOptions + client ListAssociatedAssetsAPIClient + params *ListAssociatedAssetsInput + nextToken *string + firstPage bool +} + +// NewListAssociatedAssetsPaginator returns a new ListAssociatedAssetsPaginator +func NewListAssociatedAssetsPaginator(client ListAssociatedAssetsAPIClient, params *ListAssociatedAssetsInput, optFns ...func(*ListAssociatedAssetsPaginatorOptions)) *ListAssociatedAssetsPaginator { + options := ListAssociatedAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociatedAssetsInput{} + } + + return &ListAssociatedAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociatedAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssociatedAssets page. +func (p *ListAssociatedAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociatedAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssociatedAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociatedAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListDashboards.go b/service/iotsitewise/api_op_ListDashboards.go index c827c256687..d7fbd6f57e3 100644 --- a/service/iotsitewise/api_op_ListDashboards.go +++ b/service/iotsitewise/api_op_ListDashboards.go @@ -148,6 +148,87 @@ func addEndpointPrefix_opListDashboardsMiddleware(stack *middleware.Stack) error return stack.Serialize.Insert(&endpointPrefix_opListDashboardsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListGateways.go b/service/iotsitewise/api_op_ListGateways.go index 4819efe24af..af3ba012051 100644 --- a/service/iotsitewise/api_op_ListGateways.go +++ b/service/iotsitewise/api_op_ListGateways.go @@ -139,6 +139,86 @@ func addEndpointPrefix_opListGatewaysMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListGatewaysMiddleware{}, `OperationSerializer`, middleware.After) } +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListPortals.go b/service/iotsitewise/api_op_ListPortals.go index 5ec4b9dbdee..4b8b0a1a77c 100644 --- a/service/iotsitewise/api_op_ListPortals.go +++ b/service/iotsitewise/api_op_ListPortals.go @@ -137,6 +137,86 @@ func addEndpointPrefix_opListPortalsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListPortalsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListPortalsAPIClient is a client that implements the ListPortals operation. +type ListPortalsAPIClient interface { + ListPortals(context.Context, *ListPortalsInput, ...func(*Options)) (*ListPortalsOutput, error) +} + +var _ ListPortalsAPIClient = (*Client)(nil) + +// ListPortalsPaginatorOptions is the paginator options for ListPortals +type ListPortalsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListPortalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListPortals +type ListPortalsPaginator struct { + options ListPortalsPaginatorOptions + client ListPortalsAPIClient + params *ListPortalsInput + nextToken *string + firstPage bool +} + +// NewListPortalsPaginator returns a new ListPortalsPaginator +func NewListPortalsPaginator(client ListPortalsAPIClient, params *ListPortalsInput, optFns ...func(*ListPortalsPaginatorOptions)) *ListPortalsPaginator { + options := ListPortalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortalsInput{} + } + + return &ListPortalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortalsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPortals page. +func (p *ListPortalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPortals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListProjectAssets.go b/service/iotsitewise/api_op_ListProjectAssets.go index 3e325683a76..9f824c00055 100644 --- a/service/iotsitewise/api_op_ListProjectAssets.go +++ b/service/iotsitewise/api_op_ListProjectAssets.go @@ -147,6 +147,87 @@ func addEndpointPrefix_opListProjectAssetsMiddleware(stack *middleware.Stack) er return stack.Serialize.Insert(&endpointPrefix_opListProjectAssetsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListProjectAssetsAPIClient is a client that implements the ListProjectAssets +// operation. +type ListProjectAssetsAPIClient interface { + ListProjectAssets(context.Context, *ListProjectAssetsInput, ...func(*Options)) (*ListProjectAssetsOutput, error) +} + +var _ ListProjectAssetsAPIClient = (*Client)(nil) + +// ListProjectAssetsPaginatorOptions is the paginator options for ListProjectAssets +type ListProjectAssetsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListProjectAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListProjectAssets +type ListProjectAssetsPaginator struct { + options ListProjectAssetsPaginatorOptions + client ListProjectAssetsAPIClient + params *ListProjectAssetsInput + nextToken *string + firstPage bool +} + +// NewListProjectAssetsPaginator returns a new ListProjectAssetsPaginator +func NewListProjectAssetsPaginator(client ListProjectAssetsAPIClient, params *ListProjectAssetsInput, optFns ...func(*ListProjectAssetsPaginatorOptions)) *ListProjectAssetsPaginator { + options := ListProjectAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectAssetsInput{} + } + + return &ListProjectAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjectAssets page. +func (p *ListProjectAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProjectAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjectAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/api_op_ListProjects.go b/service/iotsitewise/api_op_ListProjects.go index e9fc8ab5008..60cf670519b 100644 --- a/service/iotsitewise/api_op_ListProjects.go +++ b/service/iotsitewise/api_op_ListProjects.go @@ -147,6 +147,86 @@ func addEndpointPrefix_opListProjectsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListProjectsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. Default: 50 + 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 +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotsitewise.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotsitewise/endpoints.go b/service/iotsitewise/endpoints.go index 7ce0e4ead43..3be46748fa3 100644 --- a/service/iotsitewise/endpoints.go +++ b/service/iotsitewise/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go b/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go index 488c117691a..3fea92c7c03 100644 --- a/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go +++ b/service/iotthingsgraph/api_op_GetFlowTemplateRevisions.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -118,6 +119,89 @@ func addOperationGetFlowTemplateRevisionsMiddlewares(stack *middleware.Stack, op return nil } +// GetFlowTemplateRevisionsAPIClient is a client that implements the +// GetFlowTemplateRevisions operation. +type GetFlowTemplateRevisionsAPIClient interface { + GetFlowTemplateRevisions(context.Context, *GetFlowTemplateRevisionsInput, ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error) +} + +var _ GetFlowTemplateRevisionsAPIClient = (*Client)(nil) + +// GetFlowTemplateRevisionsPaginatorOptions is the paginator options for +// GetFlowTemplateRevisions +type GetFlowTemplateRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// GetFlowTemplateRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.GetFlowTemplateRevisions +type GetFlowTemplateRevisionsPaginator struct { + options GetFlowTemplateRevisionsPaginatorOptions + client GetFlowTemplateRevisionsAPIClient + params *GetFlowTemplateRevisionsInput + nextToken *string + firstPage bool +} + +// NewGetFlowTemplateRevisionsPaginator returns a new +// GetFlowTemplateRevisionsPaginator +func NewGetFlowTemplateRevisionsPaginator(client GetFlowTemplateRevisionsAPIClient, params *GetFlowTemplateRevisionsInput, optFns ...func(*GetFlowTemplateRevisionsPaginatorOptions)) *GetFlowTemplateRevisionsPaginator { + options := GetFlowTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFlowTemplateRevisionsInput{} + } + + return &GetFlowTemplateRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFlowTemplateRevisionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetFlowTemplateRevisions page. +func (p *GetFlowTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFlowTemplateRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetFlowTemplateRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFlowTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go b/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go index 80ec820d3bf..54faf0be28e 100644 --- a/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go +++ b/service/iotthingsgraph/api_op_GetSystemTemplateRevisions.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -119,6 +120,89 @@ func addOperationGetSystemTemplateRevisionsMiddlewares(stack *middleware.Stack, return nil } +// GetSystemTemplateRevisionsAPIClient is a client that implements the +// GetSystemTemplateRevisions operation. +type GetSystemTemplateRevisionsAPIClient interface { + GetSystemTemplateRevisions(context.Context, *GetSystemTemplateRevisionsInput, ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error) +} + +var _ GetSystemTemplateRevisionsAPIClient = (*Client)(nil) + +// GetSystemTemplateRevisionsPaginatorOptions is the paginator options for +// GetSystemTemplateRevisions +type GetSystemTemplateRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// GetSystemTemplateRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.GetSystemTemplateRevisions +type GetSystemTemplateRevisionsPaginator struct { + options GetSystemTemplateRevisionsPaginatorOptions + client GetSystemTemplateRevisionsAPIClient + params *GetSystemTemplateRevisionsInput + nextToken *string + firstPage bool +} + +// NewGetSystemTemplateRevisionsPaginator returns a new +// GetSystemTemplateRevisionsPaginator +func NewGetSystemTemplateRevisionsPaginator(client GetSystemTemplateRevisionsAPIClient, params *GetSystemTemplateRevisionsInput, optFns ...func(*GetSystemTemplateRevisionsPaginatorOptions)) *GetSystemTemplateRevisionsPaginator { + options := GetSystemTemplateRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSystemTemplateRevisionsInput{} + } + + return &GetSystemTemplateRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSystemTemplateRevisionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSystemTemplateRevisions page. +func (p *GetSystemTemplateRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSystemTemplateRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSystemTemplateRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSystemTemplateRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go b/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go index 819edbe3f96..0c503d84bc4 100644 --- a/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go +++ b/service/iotthingsgraph/api_op_ListFlowExecutionMessages.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -116,6 +117,89 @@ func addOperationListFlowExecutionMessagesMiddlewares(stack *middleware.Stack, o return nil } +// ListFlowExecutionMessagesAPIClient is a client that implements the +// ListFlowExecutionMessages operation. +type ListFlowExecutionMessagesAPIClient interface { + ListFlowExecutionMessages(context.Context, *ListFlowExecutionMessagesInput, ...func(*Options)) (*ListFlowExecutionMessagesOutput, error) +} + +var _ ListFlowExecutionMessagesAPIClient = (*Client)(nil) + +// ListFlowExecutionMessagesPaginatorOptions is the paginator options for +// ListFlowExecutionMessages +type ListFlowExecutionMessagesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// ListFlowExecutionMessagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.ListFlowExecutionMessages +type ListFlowExecutionMessagesPaginator struct { + options ListFlowExecutionMessagesPaginatorOptions + client ListFlowExecutionMessagesAPIClient + params *ListFlowExecutionMessagesInput + nextToken *string + firstPage bool +} + +// NewListFlowExecutionMessagesPaginator returns a new +// ListFlowExecutionMessagesPaginator +func NewListFlowExecutionMessagesPaginator(client ListFlowExecutionMessagesAPIClient, params *ListFlowExecutionMessagesInput, optFns ...func(*ListFlowExecutionMessagesPaginatorOptions)) *ListFlowExecutionMessagesPaginator { + options := ListFlowExecutionMessagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowExecutionMessagesInput{} + } + + return &ListFlowExecutionMessagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowExecutionMessagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFlowExecutionMessages page. +func (p *ListFlowExecutionMessagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowExecutionMessagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFlowExecutionMessages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlowExecutionMessages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_ListTagsForResource.go b/service/iotthingsgraph/api_op_ListTagsForResource.go index 0937fba93fb..82a16d04146 100644 --- a/service/iotthingsgraph/api_op_ListTagsForResource.go +++ b/service/iotthingsgraph/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -113,6 +114,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tags 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchEntities.go b/service/iotthingsgraph/api_op_SearchEntities.go index faf1f14500b..962e004bd4c 100644 --- a/service/iotthingsgraph/api_op_SearchEntities.go +++ b/service/iotthingsgraph/api_op_SearchEntities.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -127,6 +128,87 @@ func addOperationSearchEntitiesMiddlewares(stack *middleware.Stack, options Opti return nil } +// SearchEntitiesAPIClient is a client that implements the SearchEntities +// operation. +type SearchEntitiesAPIClient interface { + SearchEntities(context.Context, *SearchEntitiesInput, ...func(*Options)) (*SearchEntitiesOutput, error) +} + +var _ SearchEntitiesAPIClient = (*Client)(nil) + +// SearchEntitiesPaginatorOptions is the paginator options for SearchEntities +type SearchEntitiesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchEntities +type SearchEntitiesPaginator struct { + options SearchEntitiesPaginatorOptions + client SearchEntitiesAPIClient + params *SearchEntitiesInput + nextToken *string + firstPage bool +} + +// NewSearchEntitiesPaginator returns a new SearchEntitiesPaginator +func NewSearchEntitiesPaginator(client SearchEntitiesAPIClient, params *SearchEntitiesInput, optFns ...func(*SearchEntitiesPaginatorOptions)) *SearchEntitiesPaginator { + options := SearchEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchEntitiesInput{} + } + + return &SearchEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchEntitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchEntities page. +func (p *SearchEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchFlowExecutions.go b/service/iotthingsgraph/api_op_SearchFlowExecutions.go index 1882ee29176..50027379205 100644 --- a/service/iotthingsgraph/api_op_SearchFlowExecutions.go +++ b/service/iotthingsgraph/api_op_SearchFlowExecutions.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -125,6 +126,88 @@ func addOperationSearchFlowExecutionsMiddlewares(stack *middleware.Stack, option return nil } +// SearchFlowExecutionsAPIClient is a client that implements the +// SearchFlowExecutions operation. +type SearchFlowExecutionsAPIClient interface { + SearchFlowExecutions(context.Context, *SearchFlowExecutionsInput, ...func(*Options)) (*SearchFlowExecutionsOutput, error) +} + +var _ SearchFlowExecutionsAPIClient = (*Client)(nil) + +// SearchFlowExecutionsPaginatorOptions is the paginator options for +// SearchFlowExecutions +type SearchFlowExecutionsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchFlowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchFlowExecutions +type SearchFlowExecutionsPaginator struct { + options SearchFlowExecutionsPaginatorOptions + client SearchFlowExecutionsAPIClient + params *SearchFlowExecutionsInput + nextToken *string + firstPage bool +} + +// NewSearchFlowExecutionsPaginator returns a new SearchFlowExecutionsPaginator +func NewSearchFlowExecutionsPaginator(client SearchFlowExecutionsAPIClient, params *SearchFlowExecutionsInput, optFns ...func(*SearchFlowExecutionsPaginatorOptions)) *SearchFlowExecutionsPaginator { + options := SearchFlowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchFlowExecutionsInput{} + } + + return &SearchFlowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchFlowExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchFlowExecutions page. +func (p *SearchFlowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchFlowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchFlowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchFlowTemplates.go b/service/iotthingsgraph/api_op_SearchFlowTemplates.go index e1fa507f05e..a00503c42d9 100644 --- a/service/iotthingsgraph/api_op_SearchFlowTemplates.go +++ b/service/iotthingsgraph/api_op_SearchFlowTemplates.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -114,6 +115,88 @@ func addOperationSearchFlowTemplatesMiddlewares(stack *middleware.Stack, options return nil } +// SearchFlowTemplatesAPIClient is a client that implements the SearchFlowTemplates +// operation. +type SearchFlowTemplatesAPIClient interface { + SearchFlowTemplates(context.Context, *SearchFlowTemplatesInput, ...func(*Options)) (*SearchFlowTemplatesOutput, error) +} + +var _ SearchFlowTemplatesAPIClient = (*Client)(nil) + +// SearchFlowTemplatesPaginatorOptions is the paginator options for +// SearchFlowTemplates +type SearchFlowTemplatesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchFlowTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchFlowTemplates +type SearchFlowTemplatesPaginator struct { + options SearchFlowTemplatesPaginatorOptions + client SearchFlowTemplatesAPIClient + params *SearchFlowTemplatesInput + nextToken *string + firstPage bool +} + +// NewSearchFlowTemplatesPaginator returns a new SearchFlowTemplatesPaginator +func NewSearchFlowTemplatesPaginator(client SearchFlowTemplatesAPIClient, params *SearchFlowTemplatesInput, optFns ...func(*SearchFlowTemplatesPaginatorOptions)) *SearchFlowTemplatesPaginator { + options := SearchFlowTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchFlowTemplatesInput{} + } + + return &SearchFlowTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchFlowTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchFlowTemplates page. +func (p *SearchFlowTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchFlowTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchFlowTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchFlowTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchSystemInstances.go b/service/iotthingsgraph/api_op_SearchSystemInstances.go index 2b33d4de6a5..484f3385e44 100644 --- a/service/iotthingsgraph/api_op_SearchSystemInstances.go +++ b/service/iotthingsgraph/api_op_SearchSystemInstances.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -112,6 +113,88 @@ func addOperationSearchSystemInstancesMiddlewares(stack *middleware.Stack, optio return nil } +// SearchSystemInstancesAPIClient is a client that implements the +// SearchSystemInstances operation. +type SearchSystemInstancesAPIClient interface { + SearchSystemInstances(context.Context, *SearchSystemInstancesInput, ...func(*Options)) (*SearchSystemInstancesOutput, error) +} + +var _ SearchSystemInstancesAPIClient = (*Client)(nil) + +// SearchSystemInstancesPaginatorOptions is the paginator options for +// SearchSystemInstances +type SearchSystemInstancesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchSystemInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchSystemInstances +type SearchSystemInstancesPaginator struct { + options SearchSystemInstancesPaginatorOptions + client SearchSystemInstancesAPIClient + params *SearchSystemInstancesInput + nextToken *string + firstPage bool +} + +// NewSearchSystemInstancesPaginator returns a new SearchSystemInstancesPaginator +func NewSearchSystemInstancesPaginator(client SearchSystemInstancesAPIClient, params *SearchSystemInstancesInput, optFns ...func(*SearchSystemInstancesPaginatorOptions)) *SearchSystemInstancesPaginator { + options := SearchSystemInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSystemInstancesInput{} + } + + return &SearchSystemInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSystemInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchSystemInstances page. +func (p *SearchSystemInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchSystemInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSystemInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchSystemTemplates.go b/service/iotthingsgraph/api_op_SearchSystemTemplates.go index 5288eb8aabe..8540bff332d 100644 --- a/service/iotthingsgraph/api_op_SearchSystemTemplates.go +++ b/service/iotthingsgraph/api_op_SearchSystemTemplates.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -116,6 +117,88 @@ func addOperationSearchSystemTemplatesMiddlewares(stack *middleware.Stack, optio return nil } +// SearchSystemTemplatesAPIClient is a client that implements the +// SearchSystemTemplates operation. +type SearchSystemTemplatesAPIClient interface { + SearchSystemTemplates(context.Context, *SearchSystemTemplatesInput, ...func(*Options)) (*SearchSystemTemplatesOutput, error) +} + +var _ SearchSystemTemplatesAPIClient = (*Client)(nil) + +// SearchSystemTemplatesPaginatorOptions is the paginator options for +// SearchSystemTemplates +type SearchSystemTemplatesPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchSystemTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchSystemTemplates +type SearchSystemTemplatesPaginator struct { + options SearchSystemTemplatesPaginatorOptions + client SearchSystemTemplatesAPIClient + params *SearchSystemTemplatesInput + nextToken *string + firstPage bool +} + +// NewSearchSystemTemplatesPaginator returns a new SearchSystemTemplatesPaginator +func NewSearchSystemTemplatesPaginator(client SearchSystemTemplatesAPIClient, params *SearchSystemTemplatesInput, optFns ...func(*SearchSystemTemplatesPaginatorOptions)) *SearchSystemTemplatesPaginator { + options := SearchSystemTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSystemTemplatesInput{} + } + + return &SearchSystemTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSystemTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchSystemTemplates page. +func (p *SearchSystemTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSystemTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchSystemTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSystemTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/api_op_SearchThings.go b/service/iotthingsgraph/api_op_SearchThings.go index f319597f39e..253dc8b4a0f 100644 --- a/service/iotthingsgraph/api_op_SearchThings.go +++ b/service/iotthingsgraph/api_op_SearchThings.go @@ -4,6 +4,7 @@ package iotthingsgraph 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/iotthingsgraph/types" @@ -124,6 +125,86 @@ func addOperationSearchThingsMiddlewares(stack *middleware.Stack, options Option return nil } +// SearchThingsAPIClient is a client that implements the SearchThings operation. +type SearchThingsAPIClient interface { + SearchThings(context.Context, *SearchThingsInput, ...func(*Options)) (*SearchThingsOutput, error) +} + +var _ SearchThingsAPIClient = (*Client)(nil) + +// SearchThingsPaginatorOptions is the paginator options for SearchThings +type SearchThingsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// SearchThingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/iotthingsgraph.SearchThings +type SearchThingsPaginator struct { + options SearchThingsPaginatorOptions + client SearchThingsAPIClient + params *SearchThingsInput + nextToken *string + firstPage bool +} + +// NewSearchThingsPaginator returns a new SearchThingsPaginator +func NewSearchThingsPaginator(client SearchThingsAPIClient, params *SearchThingsInput, optFns ...func(*SearchThingsPaginatorOptions)) *SearchThingsPaginator { + options := SearchThingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchThingsInput{} + } + + return &SearchThingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchThingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchThings page. +func (p *SearchThingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchThingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchThings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchThings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/iotthingsgraph/endpoints.go b/service/iotthingsgraph/endpoints.go index d9f78c1e6fa..3a2cf05f662 100644 --- a/service/iotthingsgraph/endpoints.go +++ b/service/iotthingsgraph/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ivs/api_op_ListChannels.go b/service/ivs/api_op_ListChannels.go index a2a5b7fc637..372887a8e73 100644 --- a/service/ivs/api_op_ListChannels.go +++ b/service/ivs/api_op_ListChannels.go @@ -4,6 +4,7 @@ package ivs 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/ivs/types" @@ -114,6 +115,86 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Maximum number of channels 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 +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListPlaybackKeyPairs.go b/service/ivs/api_op_ListPlaybackKeyPairs.go index 6020c520e17..68a59171a3d 100644 --- a/service/ivs/api_op_ListPlaybackKeyPairs.go +++ b/service/ivs/api_op_ListPlaybackKeyPairs.go @@ -4,6 +4,7 @@ package ivs 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/ivs/types" @@ -109,6 +110,89 @@ func addOperationListPlaybackKeyPairsMiddlewares(stack *middleware.Stack, option return nil } +// ListPlaybackKeyPairsAPIClient is a client that implements the +// ListPlaybackKeyPairs operation. +type ListPlaybackKeyPairsAPIClient interface { + ListPlaybackKeyPairs(context.Context, *ListPlaybackKeyPairsInput, ...func(*Options)) (*ListPlaybackKeyPairsOutput, error) +} + +var _ ListPlaybackKeyPairsAPIClient = (*Client)(nil) + +// ListPlaybackKeyPairsPaginatorOptions is the paginator options for +// ListPlaybackKeyPairs +type ListPlaybackKeyPairsPaginatorOptions struct { + // The first key pair to retrieve. This is used for pagination; see the nextToken + // response field. + 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 +} + +// ListPlaybackKeyPairsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListPlaybackKeyPairs +type ListPlaybackKeyPairsPaginator struct { + options ListPlaybackKeyPairsPaginatorOptions + client ListPlaybackKeyPairsAPIClient + params *ListPlaybackKeyPairsInput + nextToken *string + firstPage bool +} + +// NewListPlaybackKeyPairsPaginator returns a new ListPlaybackKeyPairsPaginator +func NewListPlaybackKeyPairsPaginator(client ListPlaybackKeyPairsAPIClient, params *ListPlaybackKeyPairsInput, optFns ...func(*ListPlaybackKeyPairsPaginatorOptions)) *ListPlaybackKeyPairsPaginator { + options := ListPlaybackKeyPairsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlaybackKeyPairsInput{} + } + + return &ListPlaybackKeyPairsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlaybackKeyPairsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPlaybackKeyPairs page. +func (p *ListPlaybackKeyPairsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlaybackKeyPairsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPlaybackKeyPairs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlaybackKeyPairs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListStreamKeys.go b/service/ivs/api_op_ListStreamKeys.go index 0e9d1071b9b..a7cc997d7a3 100644 --- a/service/ivs/api_op_ListStreamKeys.go +++ b/service/ivs/api_op_ListStreamKeys.go @@ -4,6 +4,7 @@ package ivs 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/ivs/types" @@ -117,6 +118,87 @@ func addOperationListStreamKeysMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListStreamKeysAPIClient is a client that implements the ListStreamKeys +// operation. +type ListStreamKeysAPIClient interface { + ListStreamKeys(context.Context, *ListStreamKeysInput, ...func(*Options)) (*ListStreamKeysOutput, error) +} + +var _ ListStreamKeysAPIClient = (*Client)(nil) + +// ListStreamKeysPaginatorOptions is the paginator options for ListStreamKeys +type ListStreamKeysPaginatorOptions struct { + // Maximum number of streamKeys 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 +} + +// ListStreamKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListStreamKeys +type ListStreamKeysPaginator struct { + options ListStreamKeysPaginatorOptions + client ListStreamKeysAPIClient + params *ListStreamKeysInput + nextToken *string + firstPage bool +} + +// NewListStreamKeysPaginator returns a new ListStreamKeysPaginator +func NewListStreamKeysPaginator(client ListStreamKeysAPIClient, params *ListStreamKeysInput, optFns ...func(*ListStreamKeysPaginatorOptions)) *ListStreamKeysPaginator { + options := ListStreamKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamKeysInput{} + } + + return &ListStreamKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreamKeys page. +func (p *ListStreamKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListStreamKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListStreams.go b/service/ivs/api_op_ListStreams.go index 5e8c60b7377..e0d9812b2a7 100644 --- a/service/ivs/api_op_ListStreams.go +++ b/service/ivs/api_op_ListStreams.go @@ -4,6 +4,7 @@ package ivs 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/ivs/types" @@ -110,6 +111,86 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // Maximum number of streams 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 +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/api_op_ListTagsForResource.go b/service/ivs/api_op_ListTagsForResource.go index e1d37fb4c7e..27ecabf1ec7 100644 --- a/service/ivs/api_op_ListTagsForResource.go +++ b/service/ivs/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package ivs 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/awslabs/smithy-go/middleware" @@ -112,6 +113,88 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Maximum number of tags 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ivs.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ivs/endpoints.go b/service/ivs/endpoints.go index e34fc7e361e..fb3dbc91456 100644 --- a/service/ivs/endpoints.go +++ b/service/ivs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kafka/api_op_ListClusterOperations.go b/service/kafka/api_op_ListClusterOperations.go index 6a24dd62640..183352d2ad8 100644 --- a/service/kafka/api_op_ListClusterOperations.go +++ b/service/kafka/api_op_ListClusterOperations.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -119,6 +120,89 @@ func addOperationListClusterOperationsMiddlewares(stack *middleware.Stack, optio return nil } +// ListClusterOperationsAPIClient is a client that implements the +// ListClusterOperations operation. +type ListClusterOperationsAPIClient interface { + ListClusterOperations(context.Context, *ListClusterOperationsInput, ...func(*Options)) (*ListClusterOperationsOutput, error) +} + +var _ ListClusterOperationsAPIClient = (*Client)(nil) + +// ListClusterOperationsPaginatorOptions is the paginator options for +// ListClusterOperations +type ListClusterOperationsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +} + +// ListClusterOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListClusterOperations +type ListClusterOperationsPaginator struct { + options ListClusterOperationsPaginatorOptions + client ListClusterOperationsAPIClient + params *ListClusterOperationsInput + nextToken *string + firstPage bool +} + +// NewListClusterOperationsPaginator returns a new ListClusterOperationsPaginator +func NewListClusterOperationsPaginator(client ListClusterOperationsAPIClient, params *ListClusterOperationsInput, optFns ...func(*ListClusterOperationsPaginatorOptions)) *ListClusterOperationsPaginator { + options := ListClusterOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClusterOperationsInput{} + } + + return &ListClusterOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClusterOperationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListClusterOperations page. +func (p *ListClusterOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClusterOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListClusterOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClusterOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListClusters.go b/service/kafka/api_op_ListClusters.go index b7a2519d312..cdc2d3a66f1 100644 --- a/service/kafka/api_op_ListClusters.go +++ b/service/kafka/api_op_ListClusters.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -114,6 +115,87 @@ func addOperationListClustersMiddlewares(stack *middleware.Stack, options Option 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 maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +// github.com/aws/aws-sdk-go-v2/service/kafka.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 { + options := ListClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClustersInput{} + } + + return &ListClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// 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 + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + 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/kafka/api_op_ListConfigurationRevisions.go b/service/kafka/api_op_ListConfigurationRevisions.go index db1219b3ba5..872239dd260 100644 --- a/service/kafka/api_op_ListConfigurationRevisions.go +++ b/service/kafka/api_op_ListConfigurationRevisions.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -117,6 +118,90 @@ func addOperationListConfigurationRevisionsMiddlewares(stack *middleware.Stack, return nil } +// ListConfigurationRevisionsAPIClient is a client that implements the +// ListConfigurationRevisions operation. +type ListConfigurationRevisionsAPIClient interface { + ListConfigurationRevisions(context.Context, *ListConfigurationRevisionsInput, ...func(*Options)) (*ListConfigurationRevisionsOutput, error) +} + +var _ ListConfigurationRevisionsAPIClient = (*Client)(nil) + +// ListConfigurationRevisionsPaginatorOptions is the paginator options for +// ListConfigurationRevisions +type ListConfigurationRevisionsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +} + +// ListConfigurationRevisionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListConfigurationRevisions +type ListConfigurationRevisionsPaginator struct { + options ListConfigurationRevisionsPaginatorOptions + client ListConfigurationRevisionsAPIClient + params *ListConfigurationRevisionsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationRevisionsPaginator returns a new +// ListConfigurationRevisionsPaginator +func NewListConfigurationRevisionsPaginator(client ListConfigurationRevisionsAPIClient, params *ListConfigurationRevisionsInput, optFns ...func(*ListConfigurationRevisionsPaginatorOptions)) *ListConfigurationRevisionsPaginator { + options := ListConfigurationRevisionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationRevisionsInput{} + } + + return &ListConfigurationRevisionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationRevisionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurationRevisions page. +func (p *ListConfigurationRevisionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationRevisionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListConfigurationRevisions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationRevisions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListConfigurations.go b/service/kafka/api_op_ListConfigurations.go index fe416ff7453..8a556dbc3a5 100644 --- a/service/kafka/api_op_ListConfigurations.go +++ b/service/kafka/api_op_ListConfigurations.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -110,6 +111,89 @@ func addOperationListConfigurationsMiddlewares(stack *middleware.Stack, options return nil } +// ListConfigurationsAPIClient is a client that implements the ListConfigurations +// operation. +type ListConfigurationsAPIClient interface { + ListConfigurations(context.Context, *ListConfigurationsInput, ...func(*Options)) (*ListConfigurationsOutput, error) +} + +var _ ListConfigurationsAPIClient = (*Client)(nil) + +// ListConfigurationsPaginatorOptions is the paginator options for +// ListConfigurations +type ListConfigurationsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +} + +// ListConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListConfigurations +type ListConfigurationsPaginator struct { + options ListConfigurationsPaginatorOptions + client ListConfigurationsAPIClient + params *ListConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationsPaginator returns a new ListConfigurationsPaginator +func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { + options := ListConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationsInput{} + } + + return &ListConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurations page. +func (p *ListConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListKafkaVersions.go b/service/kafka/api_op_ListKafkaVersions.go index 2453efc1ef9..7b3d30654cb 100644 --- a/service/kafka/api_op_ListKafkaVersions.go +++ b/service/kafka/api_op_ListKafkaVersions.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -105,6 +106,88 @@ func addOperationListKafkaVersionsMiddlewares(stack *middleware.Stack, options O return nil } +// ListKafkaVersionsAPIClient is a client that implements the ListKafkaVersions +// operation. +type ListKafkaVersionsAPIClient interface { + ListKafkaVersions(context.Context, *ListKafkaVersionsInput, ...func(*Options)) (*ListKafkaVersionsOutput, error) +} + +var _ ListKafkaVersionsAPIClient = (*Client)(nil) + +// ListKafkaVersionsPaginatorOptions is the paginator options for ListKafkaVersions +type ListKafkaVersionsPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +} + +// ListKafkaVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListKafkaVersions +type ListKafkaVersionsPaginator struct { + options ListKafkaVersionsPaginatorOptions + client ListKafkaVersionsAPIClient + params *ListKafkaVersionsInput + nextToken *string + firstPage bool +} + +// NewListKafkaVersionsPaginator returns a new ListKafkaVersionsPaginator +func NewListKafkaVersionsPaginator(client ListKafkaVersionsAPIClient, params *ListKafkaVersionsInput, optFns ...func(*ListKafkaVersionsPaginatorOptions)) *ListKafkaVersionsPaginator { + options := ListKafkaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKafkaVersionsInput{} + } + + return &ListKafkaVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKafkaVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListKafkaVersions page. +func (p *ListKafkaVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKafkaVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListKafkaVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKafkaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListNodes.go b/service/kafka/api_op_ListNodes.go index b016c90607a..d2e41560db4 100644 --- a/service/kafka/api_op_ListNodes.go +++ b/service/kafka/api_op_ListNodes.go @@ -4,6 +4,7 @@ package kafka 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/kafka/types" @@ -118,6 +119,87 @@ func addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListNodesAPIClient is a client that implements the ListNodes operation. +type ListNodesAPIClient interface { + ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) +} + +var _ ListNodesAPIClient = (*Client)(nil) + +// ListNodesPaginatorOptions is the paginator options for ListNodes +type ListNodesPaginatorOptions struct { + // The maximum number of results to return in the response. If there are more + // results, the response includes a NextToken parameter. + 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 +} + +// ListNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListNodes +type ListNodesPaginator struct { + options ListNodesPaginatorOptions + client ListNodesAPIClient + params *ListNodesInput + nextToken *string + firstPage bool +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodesInput{} + } + + return &ListNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNodes page. +func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/api_op_ListScramSecrets.go b/service/kafka/api_op_ListScramSecrets.go index fec3c2a73b9..c5f94b64061 100644 --- a/service/kafka/api_op_ListScramSecrets.go +++ b/service/kafka/api_op_ListScramSecrets.go @@ -4,6 +4,7 @@ package kafka 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/awslabs/smithy-go/middleware" @@ -112,6 +113,87 @@ func addOperationListScramSecretsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListScramSecretsAPIClient is a client that implements the ListScramSecrets +// operation. +type ListScramSecretsAPIClient interface { + ListScramSecrets(context.Context, *ListScramSecretsInput, ...func(*Options)) (*ListScramSecretsOutput, error) +} + +var _ ListScramSecretsAPIClient = (*Client)(nil) + +// ListScramSecretsPaginatorOptions is the paginator options for ListScramSecrets +type ListScramSecretsPaginatorOptions struct { + // The maxResults of the query. + 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 +} + +// ListScramSecretsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kafka.ListScramSecrets +type ListScramSecretsPaginator struct { + options ListScramSecretsPaginatorOptions + client ListScramSecretsAPIClient + params *ListScramSecretsInput + nextToken *string + firstPage bool +} + +// NewListScramSecretsPaginator returns a new ListScramSecretsPaginator +func NewListScramSecretsPaginator(client ListScramSecretsAPIClient, params *ListScramSecretsInput, optFns ...func(*ListScramSecretsPaginatorOptions)) *ListScramSecretsPaginator { + options := ListScramSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListScramSecretsInput{} + } + + return &ListScramSecretsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListScramSecretsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListScramSecrets page. +func (p *ListScramSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListScramSecretsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListScramSecrets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListScramSecrets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kafka/endpoints.go b/service/kafka/endpoints.go index 55c88732b6e..0ccdaacd659 100644 --- a/service/kafka/endpoints.go +++ b/service/kafka/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kendra/api_op_ListDataSourceSyncJobs.go b/service/kendra/api_op_ListDataSourceSyncJobs.go index 80394bc9492..baa1f2c2dcd 100644 --- a/service/kendra/api_op_ListDataSourceSyncJobs.go +++ b/service/kendra/api_op_ListDataSourceSyncJobs.go @@ -4,6 +4,7 @@ package kendra 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/kendra/types" @@ -132,6 +133,89 @@ func addOperationListDataSourceSyncJobsMiddlewares(stack *middleware.Stack, opti return nil } +// ListDataSourceSyncJobsAPIClient is a client that implements the +// ListDataSourceSyncJobs operation. +type ListDataSourceSyncJobsAPIClient interface { + ListDataSourceSyncJobs(context.Context, *ListDataSourceSyncJobsInput, ...func(*Options)) (*ListDataSourceSyncJobsOutput, error) +} + +var _ ListDataSourceSyncJobsAPIClient = (*Client)(nil) + +// ListDataSourceSyncJobsPaginatorOptions is the paginator options for +// ListDataSourceSyncJobs +type ListDataSourceSyncJobsPaginatorOptions struct { + // The maximum number of synchronization jobs to return in the response. If there + // are fewer results in the list, this response contains only the actual results. + 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 +} + +// ListDataSourceSyncJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListDataSourceSyncJobs +type ListDataSourceSyncJobsPaginator struct { + options ListDataSourceSyncJobsPaginatorOptions + client ListDataSourceSyncJobsAPIClient + params *ListDataSourceSyncJobsInput + nextToken *string + firstPage bool +} + +// NewListDataSourceSyncJobsPaginator returns a new ListDataSourceSyncJobsPaginator +func NewListDataSourceSyncJobsPaginator(client ListDataSourceSyncJobsAPIClient, params *ListDataSourceSyncJobsInput, optFns ...func(*ListDataSourceSyncJobsPaginatorOptions)) *ListDataSourceSyncJobsPaginator { + options := ListDataSourceSyncJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourceSyncJobsInput{} + } + + return &ListDataSourceSyncJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourceSyncJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSourceSyncJobs page. +func (p *ListDataSourceSyncJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourceSyncJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDataSourceSyncJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSourceSyncJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/api_op_ListDataSources.go b/service/kendra/api_op_ListDataSources.go index 5326fed89ac..b2fc6cd61ff 100644 --- a/service/kendra/api_op_ListDataSources.go +++ b/service/kendra/api_op_ListDataSources.go @@ -4,6 +4,7 @@ package kendra 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/kendra/types" @@ -117,6 +118,87 @@ func addOperationListDataSourcesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDataSourcesAPIClient is a client that implements the ListDataSources +// operation. +type ListDataSourcesAPIClient interface { + ListDataSources(context.Context, *ListDataSourcesInput, ...func(*Options)) (*ListDataSourcesOutput, error) +} + +var _ ListDataSourcesAPIClient = (*Client)(nil) + +// ListDataSourcesPaginatorOptions is the paginator options for ListDataSources +type ListDataSourcesPaginatorOptions struct { + // The maximum number of data sources 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 +} + +// ListDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListDataSources +type ListDataSourcesPaginator struct { + options ListDataSourcesPaginatorOptions + client ListDataSourcesAPIClient + params *ListDataSourcesInput + nextToken *string + firstPage bool +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourcesInput{} + } + + return &ListDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSources page. +func (p *ListDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/api_op_ListIndices.go b/service/kendra/api_op_ListIndices.go index 37f1ce5564a..dc41c35f987 100644 --- a/service/kendra/api_op_ListIndices.go +++ b/service/kendra/api_op_ListIndices.go @@ -4,6 +4,7 @@ package kendra 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/kendra/types" @@ -109,6 +110,86 @@ func addOperationListIndicesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListIndicesAPIClient is a client that implements the ListIndices operation. +type ListIndicesAPIClient interface { + ListIndices(context.Context, *ListIndicesInput, ...func(*Options)) (*ListIndicesOutput, error) +} + +var _ ListIndicesAPIClient = (*Client)(nil) + +// ListIndicesPaginatorOptions is the paginator options for ListIndices +type ListIndicesPaginatorOptions struct { + // The maximum number of data sources 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 +} + +// ListIndicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kendra.ListIndices +type ListIndicesPaginator struct { + options ListIndicesPaginatorOptions + client ListIndicesAPIClient + params *ListIndicesInput + nextToken *string + firstPage bool +} + +// NewListIndicesPaginator returns a new ListIndicesPaginator +func NewListIndicesPaginator(client ListIndicesAPIClient, params *ListIndicesInput, optFns ...func(*ListIndicesPaginatorOptions)) *ListIndicesPaginator { + options := ListIndicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIndicesInput{} + } + + return &ListIndicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIndicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIndices page. +func (p *ListIndicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIndicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListIndices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIndices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kendra/endpoints.go b/service/kendra/endpoints.go index 12187cefac2..ba9c5fc9cd1 100644 --- a/service/kendra/endpoints.go +++ b/service/kendra/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesis/api_op_ListStreamConsumers.go b/service/kinesis/api_op_ListStreamConsumers.go index 39fc8479a30..db8507bf6e4 100644 --- a/service/kinesis/api_op_ListStreamConsumers.go +++ b/service/kinesis/api_op_ListStreamConsumers.go @@ -4,6 +4,7 @@ package kinesis 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/kinesis/types" @@ -153,6 +154,89 @@ func addOperationListStreamConsumersMiddlewares(stack *middleware.Stack, options return nil } +// ListStreamConsumersAPIClient is a client that implements the ListStreamConsumers +// operation. +type ListStreamConsumersAPIClient interface { + ListStreamConsumers(context.Context, *ListStreamConsumersInput, ...func(*Options)) (*ListStreamConsumersOutput, error) +} + +var _ ListStreamConsumersAPIClient = (*Client)(nil) + +// ListStreamConsumersPaginatorOptions is the paginator options for +// ListStreamConsumers +type ListStreamConsumersPaginatorOptions struct { + // The maximum number of consumers that you want a single call of + // ListStreamConsumers 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 +} + +// ListStreamConsumersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesis.ListStreamConsumers +type ListStreamConsumersPaginator struct { + options ListStreamConsumersPaginatorOptions + client ListStreamConsumersAPIClient + params *ListStreamConsumersInput + nextToken *string + firstPage bool +} + +// NewListStreamConsumersPaginator returns a new ListStreamConsumersPaginator +func NewListStreamConsumersPaginator(client ListStreamConsumersAPIClient, params *ListStreamConsumersInput, optFns ...func(*ListStreamConsumersPaginatorOptions)) *ListStreamConsumersPaginator { + options := ListStreamConsumersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamConsumersInput{} + } + + return &ListStreamConsumersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamConsumersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreamConsumers page. +func (p *ListStreamConsumersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamConsumersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStreamConsumers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamConsumers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesis/endpoints.go b/service/kinesis/endpoints.go index c9ee69086e3..af53f274009 100644 --- a/service/kinesis/endpoints.go +++ b/service/kinesis/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisanalytics/endpoints.go b/service/kinesisanalytics/endpoints.go index 941637aec40..acab496acef 100644 --- a/service/kinesisanalytics/endpoints.go +++ b/service/kinesisanalytics/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisanalyticsv2/endpoints.go b/service/kinesisanalyticsv2/endpoints.go index 8b4ae5a13c0..9475f6c101f 100644 --- a/service/kinesisanalyticsv2/endpoints.go +++ b/service/kinesisanalyticsv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisvideo/api_op_ListSignalingChannels.go b/service/kinesisvideo/api_op_ListSignalingChannels.go index 44f46d27d28..8fc7dcc543f 100644 --- a/service/kinesisvideo/api_op_ListSignalingChannels.go +++ b/service/kinesisvideo/api_op_ListSignalingChannels.go @@ -4,6 +4,7 @@ package kinesisvideo 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/kinesisvideo/types" @@ -113,6 +114,88 @@ func addOperationListSignalingChannelsMiddlewares(stack *middleware.Stack, optio return nil } +// ListSignalingChannelsAPIClient is a client that implements the +// ListSignalingChannels operation. +type ListSignalingChannelsAPIClient interface { + ListSignalingChannels(context.Context, *ListSignalingChannelsInput, ...func(*Options)) (*ListSignalingChannelsOutput, error) +} + +var _ ListSignalingChannelsAPIClient = (*Client)(nil) + +// ListSignalingChannelsPaginatorOptions is the paginator options for +// ListSignalingChannels +type ListSignalingChannelsPaginatorOptions struct { + // The maximum number of channels to return in the response. The default is 500. + 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 +} + +// ListSignalingChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesisvideo.ListSignalingChannels +type ListSignalingChannelsPaginator struct { + options ListSignalingChannelsPaginatorOptions + client ListSignalingChannelsAPIClient + params *ListSignalingChannelsInput + nextToken *string + firstPage bool +} + +// NewListSignalingChannelsPaginator returns a new ListSignalingChannelsPaginator +func NewListSignalingChannelsPaginator(client ListSignalingChannelsAPIClient, params *ListSignalingChannelsInput, optFns ...func(*ListSignalingChannelsPaginatorOptions)) *ListSignalingChannelsPaginator { + options := ListSignalingChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSignalingChannelsInput{} + } + + return &ListSignalingChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSignalingChannelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSignalingChannels page. +func (p *ListSignalingChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSignalingChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSignalingChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSignalingChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesisvideo/api_op_ListStreams.go b/service/kinesisvideo/api_op_ListStreams.go index 2c18453c193..f35b9fdd8e1 100644 --- a/service/kinesisvideo/api_op_ListStreams.go +++ b/service/kinesisvideo/api_op_ListStreams.go @@ -4,6 +4,7 @@ package kinesisvideo 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/kinesisvideo/types" @@ -114,6 +115,86 @@ func addOperationListStreamsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListStreamsAPIClient is a client that implements the ListStreams operation. +type ListStreamsAPIClient interface { + ListStreams(context.Context, *ListStreamsInput, ...func(*Options)) (*ListStreamsOutput, error) +} + +var _ ListStreamsAPIClient = (*Client)(nil) + +// ListStreamsPaginatorOptions is the paginator options for ListStreams +type ListStreamsPaginatorOptions struct { + // The maximum number of streams to return in the response. The default is 10,000. + 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 +} + +// ListStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kinesisvideo.ListStreams +type ListStreamsPaginator struct { + options ListStreamsPaginatorOptions + client ListStreamsAPIClient + params *ListStreamsInput + nextToken *string + firstPage bool +} + +// NewListStreamsPaginator returns a new ListStreamsPaginator +func NewListStreamsPaginator(client ListStreamsAPIClient, params *ListStreamsInput, optFns ...func(*ListStreamsPaginatorOptions)) *ListStreamsPaginator { + options := ListStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamsInput{} + } + + return &ListStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreams page. +func (p *ListStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kinesisvideo/endpoints.go b/service/kinesisvideo/endpoints.go index b5c9f785e02..524bd4c9e3d 100644 --- a/service/kinesisvideo/endpoints.go +++ b/service/kinesisvideo/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisvideoarchivedmedia/endpoints.go b/service/kinesisvideoarchivedmedia/endpoints.go index 6627435fce8..a52c363b102 100644 --- a/service/kinesisvideoarchivedmedia/endpoints.go +++ b/service/kinesisvideoarchivedmedia/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisvideomedia/endpoints.go b/service/kinesisvideomedia/endpoints.go index b06620cf7c1..ed06be82939 100644 --- a/service/kinesisvideomedia/endpoints.go +++ b/service/kinesisvideomedia/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kinesisvideosignaling/endpoints.go b/service/kinesisvideosignaling/endpoints.go index 2b26144f262..a8d650474d5 100644 --- a/service/kinesisvideosignaling/endpoints.go +++ b/service/kinesisvideosignaling/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/kms/api_op_ListAliases.go b/service/kms/api_op_ListAliases.go index a468b984e8c..bd088860911 100644 --- a/service/kms/api_op_ListAliases.go +++ b/service/kms/api_op_ListAliases.go @@ -4,6 +4,7 @@ package kms 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/kms/types" @@ -137,6 +138,90 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 100, inclusive. If you do not include a value, + // it defaults to 50. + 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 +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListGrants.go b/service/kms/api_op_ListGrants.go index af57f3e07fb..503b95fbb26 100644 --- a/service/kms/api_op_ListGrants.go +++ b/service/kms/api_op_ListGrants.go @@ -4,6 +4,7 @@ package kms 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/kms/types" @@ -144,6 +145,90 @@ func addOperationListGrantsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGrantsAPIClient is a client that implements the ListGrants operation. +type ListGrantsAPIClient interface { + ListGrants(context.Context, *ListGrantsInput, ...func(*Options)) (*ListGrantsOutput, error) +} + +var _ ListGrantsAPIClient = (*Client)(nil) + +// ListGrantsPaginatorOptions is the paginator options for ListGrants +type ListGrantsPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 100, inclusive. If you do not include a value, + // it defaults to 50. + 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 +} + +// ListGrantsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListGrants +type ListGrantsPaginator struct { + options ListGrantsPaginatorOptions + client ListGrantsAPIClient + params *ListGrantsInput + nextToken *string + firstPage bool +} + +// NewListGrantsPaginator returns a new ListGrantsPaginator +func NewListGrantsPaginator(client ListGrantsAPIClient, params *ListGrantsInput, optFns ...func(*ListGrantsPaginatorOptions)) *ListGrantsPaginator { + options := ListGrantsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGrantsInput{} + } + + return &ListGrantsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGrantsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGrants page. +func (p *ListGrantsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGrantsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGrants(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGrants(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListKeyPolicies.go b/service/kms/api_op_ListKeyPolicies.go index 503a47112be..fb2bf2cfec9 100644 --- a/service/kms/api_op_ListKeyPolicies.go +++ b/service/kms/api_op_ListKeyPolicies.go @@ -4,6 +4,7 @@ package kms 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/awslabs/smithy-go/middleware" @@ -138,6 +139,91 @@ func addOperationListKeyPoliciesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListKeyPoliciesAPIClient is a client that implements the ListKeyPolicies +// operation. +type ListKeyPoliciesAPIClient interface { + ListKeyPolicies(context.Context, *ListKeyPoliciesInput, ...func(*Options)) (*ListKeyPoliciesOutput, error) +} + +var _ ListKeyPoliciesAPIClient = (*Client)(nil) + +// ListKeyPoliciesPaginatorOptions is the paginator options for ListKeyPolicies +type ListKeyPoliciesPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 1000, inclusive. If you do not include a value, + // it defaults to 100. Only one policy can be attached to a key. + 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 +} + +// ListKeyPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListKeyPolicies +type ListKeyPoliciesPaginator struct { + options ListKeyPoliciesPaginatorOptions + client ListKeyPoliciesAPIClient + params *ListKeyPoliciesInput + nextToken *string + firstPage bool +} + +// NewListKeyPoliciesPaginator returns a new ListKeyPoliciesPaginator +func NewListKeyPoliciesPaginator(client ListKeyPoliciesAPIClient, params *ListKeyPoliciesInput, optFns ...func(*ListKeyPoliciesPaginatorOptions)) *ListKeyPoliciesPaginator { + options := ListKeyPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeyPoliciesInput{} + } + + return &ListKeyPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeyPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListKeyPolicies page. +func (p *ListKeyPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeyPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListKeyPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeyPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/api_op_ListKeys.go b/service/kms/api_op_ListKeys.go index 696a9f50bbf..65eb57f9bfb 100644 --- a/service/kms/api_op_ListKeys.go +++ b/service/kms/api_op_ListKeys.go @@ -4,6 +4,7 @@ package kms 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/kms/types" @@ -119,6 +120,90 @@ func addOperationListKeysMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListKeysAPIClient is a client that implements the ListKeys operation. +type ListKeysAPIClient interface { + ListKeys(context.Context, *ListKeysInput, ...func(*Options)) (*ListKeysOutput, error) +} + +var _ ListKeysAPIClient = (*Client)(nil) + +// ListKeysPaginatorOptions is the paginator options for ListKeys +type ListKeysPaginatorOptions struct { + // Use this parameter to specify the maximum number of items to return. When this + // value is present, AWS KMS does not return more than the specified number of + // items, but it might return fewer. This value is optional. If you include a + // value, it must be between 1 and 1000, inclusive. If you do not include a value, + // it defaults to 100. + 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 +} + +// ListKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/kms.ListKeys +type ListKeysPaginator struct { + options ListKeysPaginatorOptions + client ListKeysAPIClient + params *ListKeysInput + nextToken *string + firstPage bool +} + +// NewListKeysPaginator returns a new ListKeysPaginator +func NewListKeysPaginator(client ListKeysAPIClient, params *ListKeysInput, optFns ...func(*ListKeysPaginatorOptions)) *ListKeysPaginator { + options := ListKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListKeysInput{} + } + + return &ListKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListKeys page. +func (p *ListKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/kms/endpoints.go b/service/kms/endpoints.go index e132fc2169b..cb22b37fb0f 100644 --- a/service/kms/endpoints.go +++ b/service/kms/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/lakeformation/api_op_GetEffectivePermissionsForPath.go b/service/lakeformation/api_op_GetEffectivePermissionsForPath.go index b16a3ac5d06..d520789e3a7 100644 --- a/service/lakeformation/api_op_GetEffectivePermissionsForPath.go +++ b/service/lakeformation/api_op_GetEffectivePermissionsForPath.go @@ -4,6 +4,7 @@ package lakeformation 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/lakeformation/types" @@ -123,6 +124,89 @@ func addOperationGetEffectivePermissionsForPathMiddlewares(stack *middleware.Sta return nil } +// GetEffectivePermissionsForPathAPIClient is a client that implements the +// GetEffectivePermissionsForPath operation. +type GetEffectivePermissionsForPathAPIClient interface { + GetEffectivePermissionsForPath(context.Context, *GetEffectivePermissionsForPathInput, ...func(*Options)) (*GetEffectivePermissionsForPathOutput, error) +} + +var _ GetEffectivePermissionsForPathAPIClient = (*Client)(nil) + +// GetEffectivePermissionsForPathPaginatorOptions is the paginator options for +// GetEffectivePermissionsForPath +type GetEffectivePermissionsForPathPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetEffectivePermissionsForPathPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.GetEffectivePermissionsForPath +type GetEffectivePermissionsForPathPaginator struct { + options GetEffectivePermissionsForPathPaginatorOptions + client GetEffectivePermissionsForPathAPIClient + params *GetEffectivePermissionsForPathInput + nextToken *string + firstPage bool +} + +// NewGetEffectivePermissionsForPathPaginator returns a new +// GetEffectivePermissionsForPathPaginator +func NewGetEffectivePermissionsForPathPaginator(client GetEffectivePermissionsForPathAPIClient, params *GetEffectivePermissionsForPathInput, optFns ...func(*GetEffectivePermissionsForPathPaginatorOptions)) *GetEffectivePermissionsForPathPaginator { + options := GetEffectivePermissionsForPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEffectivePermissionsForPathInput{} + } + + return &GetEffectivePermissionsForPathPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEffectivePermissionsForPathPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetEffectivePermissionsForPath page. +func (p *GetEffectivePermissionsForPathPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEffectivePermissionsForPathOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetEffectivePermissionsForPath(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEffectivePermissionsForPath(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/api_op_ListPermissions.go b/service/lakeformation/api_op_ListPermissions.go index a2145a315ad..af9d28cbf5c 100644 --- a/service/lakeformation/api_op_ListPermissions.go +++ b/service/lakeformation/api_op_ListPermissions.go @@ -4,6 +4,7 @@ package lakeformation 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/lakeformation/types" @@ -133,6 +134,87 @@ func addOperationListPermissionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListPermissionsAPIClient is a client that implements the ListPermissions +// operation. +type ListPermissionsAPIClient interface { + ListPermissions(context.Context, *ListPermissionsInput, ...func(*Options)) (*ListPermissionsOutput, error) +} + +var _ ListPermissionsAPIClient = (*Client)(nil) + +// ListPermissionsPaginatorOptions is the paginator options for ListPermissions +type ListPermissionsPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.ListPermissions +type ListPermissionsPaginator struct { + options ListPermissionsPaginatorOptions + client ListPermissionsAPIClient + params *ListPermissionsInput + nextToken *string + firstPage bool +} + +// NewListPermissionsPaginator returns a new ListPermissionsPaginator +func NewListPermissionsPaginator(client ListPermissionsAPIClient, params *ListPermissionsInput, optFns ...func(*ListPermissionsPaginatorOptions)) *ListPermissionsPaginator { + options := ListPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionsInput{} + } + + return &ListPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPermissions page. +func (p *ListPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/api_op_ListResources.go b/service/lakeformation/api_op_ListResources.go index 75cd1c1332a..169406dd770 100644 --- a/service/lakeformation/api_op_ListResources.go +++ b/service/lakeformation/api_op_ListResources.go @@ -4,6 +4,7 @@ package lakeformation 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/lakeformation/types" @@ -109,6 +110,86 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of resource results. + 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 +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lakeformation.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lakeformation/endpoints.go b/service/lakeformation/endpoints.go index c1facae9d49..226eab1283d 100644 --- a/service/lakeformation/endpoints.go +++ b/service/lakeformation/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/lambda/api_op_ListAliases.go b/service/lambda/api_op_ListAliases.go index 08d582bfaad..4bf3781854b 100644 --- a/service/lambda/api_op_ListAliases.go +++ b/service/lambda/api_op_ListAliases.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -131,6 +132,86 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // Limit the number of aliases returned. + 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 +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListEventSourceMappings.go b/service/lambda/api_op_ListEventSourceMappings.go index 4f02cb70002..b57a084b3c8 100644 --- a/service/lambda/api_op_ListEventSourceMappings.go +++ b/service/lambda/api_op_ListEventSourceMappings.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -140,6 +141,89 @@ func addOperationListEventSourceMappingsMiddlewares(stack *middleware.Stack, opt return nil } +// ListEventSourceMappingsAPIClient is a client that implements the +// ListEventSourceMappings operation. +type ListEventSourceMappingsAPIClient interface { + ListEventSourceMappings(context.Context, *ListEventSourceMappingsInput, ...func(*Options)) (*ListEventSourceMappingsOutput, error) +} + +var _ ListEventSourceMappingsAPIClient = (*Client)(nil) + +// ListEventSourceMappingsPaginatorOptions is the paginator options for +// ListEventSourceMappings +type ListEventSourceMappingsPaginatorOptions struct { + // The maximum number of event source mappings 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 +} + +// ListEventSourceMappingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListEventSourceMappings +type ListEventSourceMappingsPaginator struct { + options ListEventSourceMappingsPaginatorOptions + client ListEventSourceMappingsAPIClient + params *ListEventSourceMappingsInput + nextToken *string + firstPage bool +} + +// NewListEventSourceMappingsPaginator returns a new +// ListEventSourceMappingsPaginator +func NewListEventSourceMappingsPaginator(client ListEventSourceMappingsAPIClient, params *ListEventSourceMappingsInput, optFns ...func(*ListEventSourceMappingsPaginatorOptions)) *ListEventSourceMappingsPaginator { + options := ListEventSourceMappingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventSourceMappingsInput{} + } + + return &ListEventSourceMappingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventSourceMappingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEventSourceMappings page. +func (p *ListEventSourceMappingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventSourceMappingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListEventSourceMappings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventSourceMappings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListFunctionEventInvokeConfigs.go b/service/lambda/api_op_ListFunctionEventInvokeConfigs.go index dcb2a4ad0e5..c5f622a6366 100644 --- a/service/lambda/api_op_ListFunctionEventInvokeConfigs.go +++ b/service/lambda/api_op_ListFunctionEventInvokeConfigs.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -128,6 +129,89 @@ func addOperationListFunctionEventInvokeConfigsMiddlewares(stack *middleware.Sta return nil } +// ListFunctionEventInvokeConfigsAPIClient is a client that implements the +// ListFunctionEventInvokeConfigs operation. +type ListFunctionEventInvokeConfigsAPIClient interface { + ListFunctionEventInvokeConfigs(context.Context, *ListFunctionEventInvokeConfigsInput, ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) +} + +var _ ListFunctionEventInvokeConfigsAPIClient = (*Client)(nil) + +// ListFunctionEventInvokeConfigsPaginatorOptions is the paginator options for +// ListFunctionEventInvokeConfigs +type ListFunctionEventInvokeConfigsPaginatorOptions struct { + // The maximum number of configurations 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 +} + +// ListFunctionEventInvokeConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListFunctionEventInvokeConfigs +type ListFunctionEventInvokeConfigsPaginator struct { + options ListFunctionEventInvokeConfigsPaginatorOptions + client ListFunctionEventInvokeConfigsAPIClient + params *ListFunctionEventInvokeConfigsInput + nextToken *string + firstPage bool +} + +// NewListFunctionEventInvokeConfigsPaginator returns a new +// ListFunctionEventInvokeConfigsPaginator +func NewListFunctionEventInvokeConfigsPaginator(client ListFunctionEventInvokeConfigsAPIClient, params *ListFunctionEventInvokeConfigsInput, optFns ...func(*ListFunctionEventInvokeConfigsPaginatorOptions)) *ListFunctionEventInvokeConfigsPaginator { + options := ListFunctionEventInvokeConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFunctionEventInvokeConfigsInput{} + } + + return &ListFunctionEventInvokeConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFunctionEventInvokeConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFunctionEventInvokeConfigs page. +func (p *ListFunctionEventInvokeConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionEventInvokeConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListFunctionEventInvokeConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFunctionEventInvokeConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListFunctions.go b/service/lambda/api_op_ListFunctions.go index 91a44e4fbcb..3d74dbc115b 100644 --- a/service/lambda/api_op_ListFunctions.go +++ b/service/lambda/api_op_ListFunctions.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -119,6 +120,86 @@ func addOperationListFunctionsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListFunctionsAPIClient is a client that implements the ListFunctions operation. +type ListFunctionsAPIClient interface { + ListFunctions(context.Context, *ListFunctionsInput, ...func(*Options)) (*ListFunctionsOutput, error) +} + +var _ ListFunctionsAPIClient = (*Client)(nil) + +// ListFunctionsPaginatorOptions is the paginator options for ListFunctions +type ListFunctionsPaginatorOptions struct { + // The maximum number of functions 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 +} + +// ListFunctionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListFunctions +type ListFunctionsPaginator struct { + options ListFunctionsPaginatorOptions + client ListFunctionsAPIClient + params *ListFunctionsInput + nextToken *string + firstPage bool +} + +// NewListFunctionsPaginator returns a new ListFunctionsPaginator +func NewListFunctionsPaginator(client ListFunctionsAPIClient, params *ListFunctionsInput, optFns ...func(*ListFunctionsPaginatorOptions)) *ListFunctionsPaginator { + options := ListFunctionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFunctionsInput{} + } + + return &ListFunctionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFunctionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFunctions page. +func (p *ListFunctionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFunctionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListFunctions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFunctions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListLayerVersions.go b/service/lambda/api_op_ListLayerVersions.go index 6d939505740..36baa233ca8 100644 --- a/service/lambda/api_op_ListLayerVersions.go +++ b/service/lambda/api_op_ListLayerVersions.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -120,6 +121,87 @@ func addOperationListLayerVersionsMiddlewares(stack *middleware.Stack, options O return nil } +// ListLayerVersionsAPIClient is a client that implements the ListLayerVersions +// operation. +type ListLayerVersionsAPIClient interface { + ListLayerVersions(context.Context, *ListLayerVersionsInput, ...func(*Options)) (*ListLayerVersionsOutput, error) +} + +var _ ListLayerVersionsAPIClient = (*Client)(nil) + +// ListLayerVersionsPaginatorOptions is the paginator options for ListLayerVersions +type ListLayerVersionsPaginatorOptions struct { + // The maximum number of versions 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 +} + +// ListLayerVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListLayerVersions +type ListLayerVersionsPaginator struct { + options ListLayerVersionsPaginatorOptions + client ListLayerVersionsAPIClient + params *ListLayerVersionsInput + nextToken *string + firstPage bool +} + +// NewListLayerVersionsPaginator returns a new ListLayerVersionsPaginator +func NewListLayerVersionsPaginator(client ListLayerVersionsAPIClient, params *ListLayerVersionsInput, optFns ...func(*ListLayerVersionsPaginatorOptions)) *ListLayerVersionsPaginator { + options := ListLayerVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLayerVersionsInput{} + } + + return &ListLayerVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLayerVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLayerVersions page. +func (p *ListLayerVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayerVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListLayerVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLayerVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListLayers.go b/service/lambda/api_op_ListLayers.go index 809dce92bad..5677fdc0d5f 100644 --- a/service/lambda/api_op_ListLayers.go +++ b/service/lambda/api_op_ListLayers.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -112,6 +113,86 @@ func addOperationListLayersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListLayersAPIClient is a client that implements the ListLayers operation. +type ListLayersAPIClient interface { + ListLayers(context.Context, *ListLayersInput, ...func(*Options)) (*ListLayersOutput, error) +} + +var _ ListLayersAPIClient = (*Client)(nil) + +// ListLayersPaginatorOptions is the paginator options for ListLayers +type ListLayersPaginatorOptions struct { + // The maximum number of layers 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 +} + +// ListLayersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListLayers +type ListLayersPaginator struct { + options ListLayersPaginatorOptions + client ListLayersAPIClient + params *ListLayersInput + nextToken *string + firstPage bool +} + +// NewListLayersPaginator returns a new ListLayersPaginator +func NewListLayersPaginator(client ListLayersAPIClient, params *ListLayersInput, optFns ...func(*ListLayersPaginatorOptions)) *ListLayersPaginator { + options := ListLayersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLayersInput{} + } + + return &ListLayersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLayersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLayers page. +func (p *ListLayersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLayersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListLayers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLayers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go b/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go index 19e888273f6..d89ec6f4b5b 100644 --- a/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go +++ b/service/lambda/api_op_ListProvisionedConcurrencyConfigs.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -126,6 +127,89 @@ func addOperationListProvisionedConcurrencyConfigsMiddlewares(stack *middleware. return nil } +// ListProvisionedConcurrencyConfigsAPIClient is a client that implements the +// ListProvisionedConcurrencyConfigs operation. +type ListProvisionedConcurrencyConfigsAPIClient interface { + ListProvisionedConcurrencyConfigs(context.Context, *ListProvisionedConcurrencyConfigsInput, ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) +} + +var _ ListProvisionedConcurrencyConfigsAPIClient = (*Client)(nil) + +// ListProvisionedConcurrencyConfigsPaginatorOptions is the paginator options for +// ListProvisionedConcurrencyConfigs +type ListProvisionedConcurrencyConfigsPaginatorOptions struct { + // Specify a number to limit the number of configurations returned. + 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 +} + +// ListProvisionedConcurrencyConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListProvisionedConcurrencyConfigs +type ListProvisionedConcurrencyConfigsPaginator struct { + options ListProvisionedConcurrencyConfigsPaginatorOptions + client ListProvisionedConcurrencyConfigsAPIClient + params *ListProvisionedConcurrencyConfigsInput + nextToken *string + firstPage bool +} + +// NewListProvisionedConcurrencyConfigsPaginator returns a new +// ListProvisionedConcurrencyConfigsPaginator +func NewListProvisionedConcurrencyConfigsPaginator(client ListProvisionedConcurrencyConfigsAPIClient, params *ListProvisionedConcurrencyConfigsInput, optFns ...func(*ListProvisionedConcurrencyConfigsPaginatorOptions)) *ListProvisionedConcurrencyConfigsPaginator { + options := ListProvisionedConcurrencyConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisionedConcurrencyConfigsInput{} + } + + return &ListProvisionedConcurrencyConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisionedConcurrencyConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProvisionedConcurrencyConfigs page. +func (p *ListProvisionedConcurrencyConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisionedConcurrencyConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListProvisionedConcurrencyConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisionedConcurrencyConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/api_op_ListVersionsByFunction.go b/service/lambda/api_op_ListVersionsByFunction.go index 39dbae300ce..257536d5fa1 100644 --- a/service/lambda/api_op_ListVersionsByFunction.go +++ b/service/lambda/api_op_ListVersionsByFunction.go @@ -4,6 +4,7 @@ package lambda 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/lambda/types" @@ -129,6 +130,88 @@ func addOperationListVersionsByFunctionMiddlewares(stack *middleware.Stack, opti return nil } +// ListVersionsByFunctionAPIClient is a client that implements the +// ListVersionsByFunction operation. +type ListVersionsByFunctionAPIClient interface { + ListVersionsByFunction(context.Context, *ListVersionsByFunctionInput, ...func(*Options)) (*ListVersionsByFunctionOutput, error) +} + +var _ ListVersionsByFunctionAPIClient = (*Client)(nil) + +// ListVersionsByFunctionPaginatorOptions is the paginator options for +// ListVersionsByFunction +type ListVersionsByFunctionPaginatorOptions struct { + // The maximum number of versions 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 +} + +// ListVersionsByFunctionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lambda.ListVersionsByFunction +type ListVersionsByFunctionPaginator struct { + options ListVersionsByFunctionPaginatorOptions + client ListVersionsByFunctionAPIClient + params *ListVersionsByFunctionInput + nextToken *string + firstPage bool +} + +// NewListVersionsByFunctionPaginator returns a new ListVersionsByFunctionPaginator +func NewListVersionsByFunctionPaginator(client ListVersionsByFunctionAPIClient, params *ListVersionsByFunctionInput, optFns ...func(*ListVersionsByFunctionPaginatorOptions)) *ListVersionsByFunctionPaginator { + options := ListVersionsByFunctionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVersionsByFunctionInput{} + } + + return &ListVersionsByFunctionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVersionsByFunctionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVersionsByFunction page. +func (p *ListVersionsByFunctionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVersionsByFunctionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListVersionsByFunction(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVersionsByFunction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lambda/endpoints.go b/service/lambda/endpoints.go index 48b6058163e..84275378a7d 100644 --- a/service/lambda/endpoints.go +++ b/service/lambda/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/lexmodelbuildingservice/api_op_GetBotAliases.go b/service/lexmodelbuildingservice/api_op_GetBotAliases.go index abc47c6dbc6..d09da31284f 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotAliases.go +++ b/service/lexmodelbuildingservice/api_op_GetBotAliases.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -125,6 +126,86 @@ func addOperationGetBotAliasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetBotAliasesAPIClient is a client that implements the GetBotAliases operation. +type GetBotAliasesAPIClient interface { + GetBotAliases(context.Context, *GetBotAliasesInput, ...func(*Options)) (*GetBotAliasesOutput, error) +} + +var _ GetBotAliasesAPIClient = (*Client)(nil) + +// GetBotAliasesPaginatorOptions is the paginator options for GetBotAliases +type GetBotAliasesPaginatorOptions struct { + // The maximum number of aliases to return in the response. The default is 50. . + 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 +} + +// GetBotAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotAliases +type GetBotAliasesPaginator struct { + options GetBotAliasesPaginatorOptions + client GetBotAliasesAPIClient + params *GetBotAliasesInput + nextToken *string + firstPage bool +} + +// NewGetBotAliasesPaginator returns a new GetBotAliasesPaginator +func NewGetBotAliasesPaginator(client GetBotAliasesAPIClient, params *GetBotAliasesInput, optFns ...func(*GetBotAliasesPaginatorOptions)) *GetBotAliasesPaginator { + options := GetBotAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotAliasesInput{} + } + + return &GetBotAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBotAliases page. +func (p *GetBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBotAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go b/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go index dd535c62093..ca6a0469454 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go +++ b/service/lexmodelbuildingservice/api_op_GetBotChannelAssociations.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -134,6 +135,89 @@ func addOperationGetBotChannelAssociationsMiddlewares(stack *middleware.Stack, o return nil } +// GetBotChannelAssociationsAPIClient is a client that implements the +// GetBotChannelAssociations operation. +type GetBotChannelAssociationsAPIClient interface { + GetBotChannelAssociations(context.Context, *GetBotChannelAssociationsInput, ...func(*Options)) (*GetBotChannelAssociationsOutput, error) +} + +var _ GetBotChannelAssociationsAPIClient = (*Client)(nil) + +// GetBotChannelAssociationsPaginatorOptions is the paginator options for +// GetBotChannelAssociations +type GetBotChannelAssociationsPaginatorOptions struct { + // The maximum number of associations to return in the response. The default is 50. + 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 +} + +// GetBotChannelAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotChannelAssociations +type GetBotChannelAssociationsPaginator struct { + options GetBotChannelAssociationsPaginatorOptions + client GetBotChannelAssociationsAPIClient + params *GetBotChannelAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetBotChannelAssociationsPaginator returns a new +// GetBotChannelAssociationsPaginator +func NewGetBotChannelAssociationsPaginator(client GetBotChannelAssociationsAPIClient, params *GetBotChannelAssociationsInput, optFns ...func(*GetBotChannelAssociationsPaginatorOptions)) *GetBotChannelAssociationsPaginator { + options := GetBotChannelAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotChannelAssociationsInput{} + } + + return &GetBotChannelAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotChannelAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBotChannelAssociations page. +func (p *GetBotChannelAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotChannelAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBotChannelAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotChannelAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBotVersions.go b/service/lexmodelbuildingservice/api_op_GetBotVersions.go index 8a24159342d..ef5c75656f1 100644 --- a/service/lexmodelbuildingservice/api_op_GetBotVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetBotVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -126,6 +127,87 @@ func addOperationGetBotVersionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// GetBotVersionsAPIClient is a client that implements the GetBotVersions +// operation. +type GetBotVersionsAPIClient interface { + GetBotVersions(context.Context, *GetBotVersionsInput, ...func(*Options)) (*GetBotVersionsOutput, error) +} + +var _ GetBotVersionsAPIClient = (*Client)(nil) + +// GetBotVersionsPaginatorOptions is the paginator options for GetBotVersions +type GetBotVersionsPaginatorOptions struct { + // The maximum number of bot versions to return in the response. The default is 10. + 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 +} + +// GetBotVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBotVersions +type GetBotVersionsPaginator struct { + options GetBotVersionsPaginatorOptions + client GetBotVersionsAPIClient + params *GetBotVersionsInput + nextToken *string + firstPage bool +} + +// NewGetBotVersionsPaginator returns a new GetBotVersionsPaginator +func NewGetBotVersionsPaginator(client GetBotVersionsAPIClient, params *GetBotVersionsInput, optFns ...func(*GetBotVersionsPaginatorOptions)) *GetBotVersionsPaginator { + options := GetBotVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotVersionsInput{} + } + + return &GetBotVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBotVersions page. +func (p *GetBotVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBotVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBotVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBots.go b/service/lexmodelbuildingservice/api_op_GetBots.go index a77fe27ed05..cacdf99231c 100644 --- a/service/lexmodelbuildingservice/api_op_GetBots.go +++ b/service/lexmodelbuildingservice/api_op_GetBots.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -123,6 +124,87 @@ func addOperationGetBotsMiddlewares(stack *middleware.Stack, options Options) (e return nil } +// GetBotsAPIClient is a client that implements the GetBots operation. +type GetBotsAPIClient interface { + GetBots(context.Context, *GetBotsInput, ...func(*Options)) (*GetBotsOutput, error) +} + +var _ GetBotsAPIClient = (*Client)(nil) + +// GetBotsPaginatorOptions is the paginator options for GetBots +type GetBotsPaginatorOptions struct { + // The maximum number of bots to return in the response that the request will + // return. The default is 10. + 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 +} + +// GetBotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBots +type GetBotsPaginator struct { + options GetBotsPaginatorOptions + client GetBotsAPIClient + params *GetBotsInput + nextToken *string + firstPage bool +} + +// NewGetBotsPaginator returns a new GetBotsPaginator +func NewGetBotsPaginator(client GetBotsAPIClient, params *GetBotsInput, optFns ...func(*GetBotsPaginatorOptions)) *GetBotsPaginator { + options := GetBotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBotsInput{} + } + + return &GetBotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBots page. +func (p *GetBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go b/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go index 4eb55d69310..87e2de9f91a 100644 --- a/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go +++ b/service/lexmodelbuildingservice/api_op_GetBuiltinIntents.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -122,6 +123,87 @@ func addOperationGetBuiltinIntentsMiddlewares(stack *middleware.Stack, options O return nil } +// GetBuiltinIntentsAPIClient is a client that implements the GetBuiltinIntents +// operation. +type GetBuiltinIntentsAPIClient interface { + GetBuiltinIntents(context.Context, *GetBuiltinIntentsInput, ...func(*Options)) (*GetBuiltinIntentsOutput, error) +} + +var _ GetBuiltinIntentsAPIClient = (*Client)(nil) + +// GetBuiltinIntentsPaginatorOptions is the paginator options for GetBuiltinIntents +type GetBuiltinIntentsPaginatorOptions struct { + // The maximum number of intents to return in the response. The default is 10. + 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 +} + +// GetBuiltinIntentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBuiltinIntents +type GetBuiltinIntentsPaginator struct { + options GetBuiltinIntentsPaginatorOptions + client GetBuiltinIntentsAPIClient + params *GetBuiltinIntentsInput + nextToken *string + firstPage bool +} + +// NewGetBuiltinIntentsPaginator returns a new GetBuiltinIntentsPaginator +func NewGetBuiltinIntentsPaginator(client GetBuiltinIntentsAPIClient, params *GetBuiltinIntentsInput, optFns ...func(*GetBuiltinIntentsPaginatorOptions)) *GetBuiltinIntentsPaginator { + options := GetBuiltinIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBuiltinIntentsInput{} + } + + return &GetBuiltinIntentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBuiltinIntentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBuiltinIntents page. +func (p *GetBuiltinIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinIntentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBuiltinIntents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBuiltinIntents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go b/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go index 591d6bf26f1..be8840bc3d6 100644 --- a/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go +++ b/service/lexmodelbuildingservice/api_op_GetBuiltinSlotTypes.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -122,6 +123,88 @@ func addOperationGetBuiltinSlotTypesMiddlewares(stack *middleware.Stack, options return nil } +// GetBuiltinSlotTypesAPIClient is a client that implements the GetBuiltinSlotTypes +// operation. +type GetBuiltinSlotTypesAPIClient interface { + GetBuiltinSlotTypes(context.Context, *GetBuiltinSlotTypesInput, ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) +} + +var _ GetBuiltinSlotTypesAPIClient = (*Client)(nil) + +// GetBuiltinSlotTypesPaginatorOptions is the paginator options for +// GetBuiltinSlotTypes +type GetBuiltinSlotTypesPaginatorOptions struct { + // The maximum number of slot types to return in the response. The default is 10. + 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 +} + +// GetBuiltinSlotTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetBuiltinSlotTypes +type GetBuiltinSlotTypesPaginator struct { + options GetBuiltinSlotTypesPaginatorOptions + client GetBuiltinSlotTypesAPIClient + params *GetBuiltinSlotTypesInput + nextToken *string + firstPage bool +} + +// NewGetBuiltinSlotTypesPaginator returns a new GetBuiltinSlotTypesPaginator +func NewGetBuiltinSlotTypesPaginator(client GetBuiltinSlotTypesAPIClient, params *GetBuiltinSlotTypesInput, optFns ...func(*GetBuiltinSlotTypesPaginatorOptions)) *GetBuiltinSlotTypesPaginator { + options := GetBuiltinSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetBuiltinSlotTypesInput{} + } + + return &GetBuiltinSlotTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetBuiltinSlotTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetBuiltinSlotTypes page. +func (p *GetBuiltinSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinSlotTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetBuiltinSlotTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetBuiltinSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetIntentVersions.go b/service/lexmodelbuildingservice/api_op_GetIntentVersions.go index 4d7811dfa71..b76994b429d 100644 --- a/service/lexmodelbuildingservice/api_op_GetIntentVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetIntentVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -127,6 +128,88 @@ func addOperationGetIntentVersionsMiddlewares(stack *middleware.Stack, options O return nil } +// GetIntentVersionsAPIClient is a client that implements the GetIntentVersions +// operation. +type GetIntentVersionsAPIClient interface { + GetIntentVersions(context.Context, *GetIntentVersionsInput, ...func(*Options)) (*GetIntentVersionsOutput, error) +} + +var _ GetIntentVersionsAPIClient = (*Client)(nil) + +// GetIntentVersionsPaginatorOptions is the paginator options for GetIntentVersions +type GetIntentVersionsPaginatorOptions struct { + // The maximum number of intent versions to return in the response. The default is + // 10. + 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 +} + +// GetIntentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetIntentVersions +type GetIntentVersionsPaginator struct { + options GetIntentVersionsPaginatorOptions + client GetIntentVersionsAPIClient + params *GetIntentVersionsInput + nextToken *string + firstPage bool +} + +// NewGetIntentVersionsPaginator returns a new GetIntentVersionsPaginator +func NewGetIntentVersionsPaginator(client GetIntentVersionsAPIClient, params *GetIntentVersionsInput, optFns ...func(*GetIntentVersionsPaginatorOptions)) *GetIntentVersionsPaginator { + options := GetIntentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetIntentVersionsInput{} + } + + return &GetIntentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetIntentVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetIntentVersions page. +func (p *GetIntentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetIntentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetIntentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetIntents.go b/service/lexmodelbuildingservice/api_op_GetIntents.go index 09287d3e1ea..c806b5aee06 100644 --- a/service/lexmodelbuildingservice/api_op_GetIntents.go +++ b/service/lexmodelbuildingservice/api_op_GetIntents.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -124,6 +125,86 @@ func addOperationGetIntentsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetIntentsAPIClient is a client that implements the GetIntents operation. +type GetIntentsAPIClient interface { + GetIntents(context.Context, *GetIntentsInput, ...func(*Options)) (*GetIntentsOutput, error) +} + +var _ GetIntentsAPIClient = (*Client)(nil) + +// GetIntentsPaginatorOptions is the paginator options for GetIntents +type GetIntentsPaginatorOptions struct { + // The maximum number of intents to return in the response. The default is 10. + 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 +} + +// GetIntentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetIntents +type GetIntentsPaginator struct { + options GetIntentsPaginatorOptions + client GetIntentsAPIClient + params *GetIntentsInput + nextToken *string + firstPage bool +} + +// NewGetIntentsPaginator returns a new GetIntentsPaginator +func NewGetIntentsPaginator(client GetIntentsAPIClient, params *GetIntentsInput, optFns ...func(*GetIntentsPaginatorOptions)) *GetIntentsPaginator { + options := GetIntentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetIntentsInput{} + } + + return &GetIntentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetIntentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetIntents page. +func (p *GetIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetIntentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetIntents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetIntents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go b/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go index 990e9f32570..93b77880896 100644 --- a/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go +++ b/service/lexmodelbuildingservice/api_op_GetSlotTypeVersions.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -127,6 +128,89 @@ func addOperationGetSlotTypeVersionsMiddlewares(stack *middleware.Stack, options return nil } +// GetSlotTypeVersionsAPIClient is a client that implements the GetSlotTypeVersions +// operation. +type GetSlotTypeVersionsAPIClient interface { + GetSlotTypeVersions(context.Context, *GetSlotTypeVersionsInput, ...func(*Options)) (*GetSlotTypeVersionsOutput, error) +} + +var _ GetSlotTypeVersionsAPIClient = (*Client)(nil) + +// GetSlotTypeVersionsPaginatorOptions is the paginator options for +// GetSlotTypeVersions +type GetSlotTypeVersionsPaginatorOptions struct { + // The maximum number of slot type versions to return in the response. The default + // is 10. + 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 +} + +// GetSlotTypeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetSlotTypeVersions +type GetSlotTypeVersionsPaginator struct { + options GetSlotTypeVersionsPaginatorOptions + client GetSlotTypeVersionsAPIClient + params *GetSlotTypeVersionsInput + nextToken *string + firstPage bool +} + +// NewGetSlotTypeVersionsPaginator returns a new GetSlotTypeVersionsPaginator +func NewGetSlotTypeVersionsPaginator(client GetSlotTypeVersionsAPIClient, params *GetSlotTypeVersionsInput, optFns ...func(*GetSlotTypeVersionsPaginatorOptions)) *GetSlotTypeVersionsPaginator { + options := GetSlotTypeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSlotTypeVersionsInput{} + } + + return &GetSlotTypeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSlotTypeVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSlotTypeVersions page. +func (p *GetSlotTypeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSlotTypeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSlotTypeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/api_op_GetSlotTypes.go b/service/lexmodelbuildingservice/api_op_GetSlotTypes.go index 8b64aa71f64..15b51c43274 100644 --- a/service/lexmodelbuildingservice/api_op_GetSlotTypes.go +++ b/service/lexmodelbuildingservice/api_op_GetSlotTypes.go @@ -4,6 +4,7 @@ package lexmodelbuildingservice 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/lexmodelbuildingservice/types" @@ -125,6 +126,86 @@ func addOperationGetSlotTypesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetSlotTypesAPIClient is a client that implements the GetSlotTypes operation. +type GetSlotTypesAPIClient interface { + GetSlotTypes(context.Context, *GetSlotTypesInput, ...func(*Options)) (*GetSlotTypesOutput, error) +} + +var _ GetSlotTypesAPIClient = (*Client)(nil) + +// GetSlotTypesPaginatorOptions is the paginator options for GetSlotTypes +type GetSlotTypesPaginatorOptions struct { + // The maximum number of slot types to return in the response. The default is 10. + 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 +} + +// GetSlotTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/lexmodelbuildingservice.GetSlotTypes +type GetSlotTypesPaginator struct { + options GetSlotTypesPaginatorOptions + client GetSlotTypesAPIClient + params *GetSlotTypesInput + nextToken *string + firstPage bool +} + +// NewGetSlotTypesPaginator returns a new GetSlotTypesPaginator +func NewGetSlotTypesPaginator(client GetSlotTypesAPIClient, params *GetSlotTypesInput, optFns ...func(*GetSlotTypesPaginatorOptions)) *GetSlotTypesPaginator { + options := GetSlotTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSlotTypesInput{} + } + + return &GetSlotTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSlotTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSlotTypes page. +func (p *GetSlotTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSlotTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSlotTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSlotTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/lexmodelbuildingservice/endpoints.go b/service/lexmodelbuildingservice/endpoints.go index 89874fc58b1..dadab2c7206 100644 --- a/service/lexmodelbuildingservice/endpoints.go +++ b/service/lexmodelbuildingservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/lexruntimeservice/endpoints.go b/service/lexruntimeservice/endpoints.go index dbc11a46e59..9eade30c787 100644 --- a/service/lexruntimeservice/endpoints.go +++ b/service/lexruntimeservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/licensemanager/endpoints.go b/service/licensemanager/endpoints.go index 8ee12bd6fdc..ef67c867048 100644 --- a/service/licensemanager/endpoints.go +++ b/service/licensemanager/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/lightsail/endpoints.go b/service/lightsail/endpoints.go index edb0e8de85c..b5562656e31 100644 --- a/service/lightsail/endpoints.go +++ b/service/lightsail/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/machinelearning/api_op_DescribeBatchPredictions.go b/service/machinelearning/api_op_DescribeBatchPredictions.go index 8884eee58bc..5378b066dcf 100644 --- a/service/machinelearning/api_op_DescribeBatchPredictions.go +++ b/service/machinelearning/api_op_DescribeBatchPredictions.go @@ -4,6 +4,7 @@ package machinelearning 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/machinelearning/types" @@ -187,6 +188,90 @@ func addOperationDescribeBatchPredictionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeBatchPredictionsAPIClient is a client that implements the +// DescribeBatchPredictions operation. +type DescribeBatchPredictionsAPIClient interface { + DescribeBatchPredictions(context.Context, *DescribeBatchPredictionsInput, ...func(*Options)) (*DescribeBatchPredictionsOutput, error) +} + +var _ DescribeBatchPredictionsAPIClient = (*Client)(nil) + +// DescribeBatchPredictionsPaginatorOptions is the paginator options for +// DescribeBatchPredictions +type DescribeBatchPredictionsPaginatorOptions struct { + // The number of pages of information to include in the result. The range of + // acceptable values is 1 through 100. The default value is 100. + 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 +} + +// DescribeBatchPredictionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeBatchPredictions +type DescribeBatchPredictionsPaginator struct { + options DescribeBatchPredictionsPaginatorOptions + client DescribeBatchPredictionsAPIClient + params *DescribeBatchPredictionsInput + nextToken *string + firstPage bool +} + +// NewDescribeBatchPredictionsPaginator returns a new +// DescribeBatchPredictionsPaginator +func NewDescribeBatchPredictionsPaginator(client DescribeBatchPredictionsAPIClient, params *DescribeBatchPredictionsInput, optFns ...func(*DescribeBatchPredictionsPaginatorOptions)) *DescribeBatchPredictionsPaginator { + options := DescribeBatchPredictionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBatchPredictionsInput{} + } + + return &DescribeBatchPredictionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBatchPredictionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBatchPredictions page. +func (p *DescribeBatchPredictionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBatchPredictionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeBatchPredictions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBatchPredictions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeDataSources.go b/service/machinelearning/api_op_DescribeDataSources.go index ee3f19f147e..b6f4926022d 100644 --- a/service/machinelearning/api_op_DescribeDataSources.go +++ b/service/machinelearning/api_op_DescribeDataSources.go @@ -4,6 +4,7 @@ package machinelearning 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/machinelearning/types" @@ -178,6 +179,88 @@ func addOperationDescribeDataSourcesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDataSourcesAPIClient is a client that implements the DescribeDataSources +// operation. +type DescribeDataSourcesAPIClient interface { + DescribeDataSources(context.Context, *DescribeDataSourcesInput, ...func(*Options)) (*DescribeDataSourcesOutput, error) +} + +var _ DescribeDataSourcesAPIClient = (*Client)(nil) + +// DescribeDataSourcesPaginatorOptions is the paginator options for +// DescribeDataSources +type DescribeDataSourcesPaginatorOptions struct { + // The maximum number of DataSource to include in the result. + 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 +} + +// DescribeDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeDataSources +type DescribeDataSourcesPaginator struct { + options DescribeDataSourcesPaginatorOptions + client DescribeDataSourcesAPIClient + params *DescribeDataSourcesInput + nextToken *string + firstPage bool +} + +// NewDescribeDataSourcesPaginator returns a new DescribeDataSourcesPaginator +func NewDescribeDataSourcesPaginator(client DescribeDataSourcesAPIClient, params *DescribeDataSourcesInput, optFns ...func(*DescribeDataSourcesPaginatorOptions)) *DescribeDataSourcesPaginator { + options := DescribeDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDataSourcesInput{} + } + + return &DescribeDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDataSourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDataSources page. +func (p *DescribeDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeEvaluations.go b/service/machinelearning/api_op_DescribeEvaluations.go index 5f08c421391..0bc9c5f8cd6 100644 --- a/service/machinelearning/api_op_DescribeEvaluations.go +++ b/service/machinelearning/api_op_DescribeEvaluations.go @@ -4,6 +4,7 @@ package machinelearning 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/machinelearning/types" @@ -185,6 +186,88 @@ func addOperationDescribeEvaluationsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeEvaluationsAPIClient is a client that implements the DescribeEvaluations +// operation. +type DescribeEvaluationsAPIClient interface { + DescribeEvaluations(context.Context, *DescribeEvaluationsInput, ...func(*Options)) (*DescribeEvaluationsOutput, error) +} + +var _ DescribeEvaluationsAPIClient = (*Client)(nil) + +// DescribeEvaluationsPaginatorOptions is the paginator options for +// DescribeEvaluations +type DescribeEvaluationsPaginatorOptions struct { + // The maximum number of Evaluation to include in the result. + 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 +} + +// DescribeEvaluationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeEvaluations +type DescribeEvaluationsPaginator struct { + options DescribeEvaluationsPaginatorOptions + client DescribeEvaluationsAPIClient + params *DescribeEvaluationsInput + nextToken *string + firstPage bool +} + +// NewDescribeEvaluationsPaginator returns a new DescribeEvaluationsPaginator +func NewDescribeEvaluationsPaginator(client DescribeEvaluationsAPIClient, params *DescribeEvaluationsInput, optFns ...func(*DescribeEvaluationsPaginatorOptions)) *DescribeEvaluationsPaginator { + options := DescribeEvaluationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEvaluationsInput{} + } + + return &DescribeEvaluationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEvaluationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvaluations page. +func (p *DescribeEvaluationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEvaluationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeEvaluations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvaluations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/api_op_DescribeMLModels.go b/service/machinelearning/api_op_DescribeMLModels.go index 49166c070a1..86658c2864b 100644 --- a/service/machinelearning/api_op_DescribeMLModels.go +++ b/service/machinelearning/api_op_DescribeMLModels.go @@ -4,6 +4,7 @@ package machinelearning 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/machinelearning/types" @@ -190,6 +191,88 @@ func addOperationDescribeMLModelsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeMLModelsAPIClient is a client that implements the DescribeMLModels +// operation. +type DescribeMLModelsAPIClient interface { + DescribeMLModels(context.Context, *DescribeMLModelsInput, ...func(*Options)) (*DescribeMLModelsOutput, error) +} + +var _ DescribeMLModelsAPIClient = (*Client)(nil) + +// DescribeMLModelsPaginatorOptions is the paginator options for DescribeMLModels +type DescribeMLModelsPaginatorOptions struct { + // The number of pages of information to include in the result. The range of + // acceptable values is 1 through 100. The default value is 100. + 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 +} + +// DescribeMLModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/machinelearning.DescribeMLModels +type DescribeMLModelsPaginator struct { + options DescribeMLModelsPaginatorOptions + client DescribeMLModelsAPIClient + params *DescribeMLModelsInput + nextToken *string + firstPage bool +} + +// NewDescribeMLModelsPaginator returns a new DescribeMLModelsPaginator +func NewDescribeMLModelsPaginator(client DescribeMLModelsAPIClient, params *DescribeMLModelsInput, optFns ...func(*DescribeMLModelsPaginatorOptions)) *DescribeMLModelsPaginator { + options := DescribeMLModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMLModelsInput{} + } + + return &DescribeMLModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMLModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMLModels page. +func (p *DescribeMLModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMLModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeMLModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMLModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/machinelearning/endpoints.go b/service/machinelearning/endpoints.go index 4f67146cbf3..c4829c5d9db 100644 --- a/service/machinelearning/endpoints.go +++ b/service/machinelearning/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/macie/api_op_ListMemberAccounts.go b/service/macie/api_op_ListMemberAccounts.go index b07fa3d51ab..db6f4e0a073 100644 --- a/service/macie/api_op_ListMemberAccounts.go +++ b/service/macie/api_op_ListMemberAccounts.go @@ -4,6 +4,7 @@ package macie 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/macie/types" @@ -114,6 +115,89 @@ func addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options return nil } +// ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts +// operation. +type ListMemberAccountsAPIClient interface { + ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) +} + +var _ ListMemberAccountsAPIClient = (*Client)(nil) + +// ListMemberAccountsPaginatorOptions is the paginator options for +// ListMemberAccounts +type ListMemberAccountsPaginatorOptions struct { + // Use this parameter to indicate the maximum number of items that you want in the + // response. The default value is 250. + 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 +} + +// ListMemberAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie.ListMemberAccounts +type ListMemberAccountsPaginator struct { + options ListMemberAccountsPaginatorOptions + client ListMemberAccountsAPIClient + params *ListMemberAccountsInput + nextToken *string + firstPage bool +} + +// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator +func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { + options := ListMemberAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMemberAccountsInput{} + } + + return &ListMemberAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMemberAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMemberAccounts page. +func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMemberAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie/api_op_ListS3Resources.go b/service/macie/api_op_ListS3Resources.go index 140aa0c880e..e0f794df5ea 100644 --- a/service/macie/api_op_ListS3Resources.go +++ b/service/macie/api_op_ListS3Resources.go @@ -4,6 +4,7 @@ package macie 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/macie/types" @@ -120,6 +121,88 @@ func addOperationListS3ResourcesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListS3ResourcesAPIClient is a client that implements the ListS3Resources +// operation. +type ListS3ResourcesAPIClient interface { + ListS3Resources(context.Context, *ListS3ResourcesInput, ...func(*Options)) (*ListS3ResourcesOutput, error) +} + +var _ ListS3ResourcesAPIClient = (*Client)(nil) + +// ListS3ResourcesPaginatorOptions is the paginator options for ListS3Resources +type ListS3ResourcesPaginatorOptions struct { + // Use this parameter to indicate the maximum number of items that you want in the + // response. The default value is 250. + 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 +} + +// ListS3ResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie.ListS3Resources +type ListS3ResourcesPaginator struct { + options ListS3ResourcesPaginatorOptions + client ListS3ResourcesAPIClient + params *ListS3ResourcesInput + nextToken *string + firstPage bool +} + +// NewListS3ResourcesPaginator returns a new ListS3ResourcesPaginator +func NewListS3ResourcesPaginator(client ListS3ResourcesAPIClient, params *ListS3ResourcesInput, optFns ...func(*ListS3ResourcesPaginatorOptions)) *ListS3ResourcesPaginator { + options := ListS3ResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListS3ResourcesInput{} + } + + return &ListS3ResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListS3ResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListS3Resources page. +func (p *ListS3ResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListS3ResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListS3Resources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie/endpoints.go b/service/macie/endpoints.go index 3d4883d81c3..56e8b7608da 100644 --- a/service/macie/endpoints.go +++ b/service/macie/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/macie2/api_op_DescribeBuckets.go b/service/macie2/api_op_DescribeBuckets.go index 59a008c2d9d..28093a03bd8 100644 --- a/service/macie2/api_op_DescribeBuckets.go +++ b/service/macie2/api_op_DescribeBuckets.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -116,6 +117,88 @@ func addOperationDescribeBucketsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeBucketsAPIClient is a client that implements the DescribeBuckets +// operation. +type DescribeBucketsAPIClient interface { + DescribeBuckets(context.Context, *DescribeBucketsInput, ...func(*Options)) (*DescribeBucketsOutput, error) +} + +var _ DescribeBucketsAPIClient = (*Client)(nil) + +// DescribeBucketsPaginatorOptions is the paginator options for DescribeBuckets +type DescribeBucketsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. The default + // value is 50. + 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 +} + +// DescribeBucketsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.DescribeBuckets +type DescribeBucketsPaginator struct { + options DescribeBucketsPaginatorOptions + client DescribeBucketsAPIClient + params *DescribeBucketsInput + nextToken *string + firstPage bool +} + +// NewDescribeBucketsPaginator returns a new DescribeBucketsPaginator +func NewDescribeBucketsPaginator(client DescribeBucketsAPIClient, params *DescribeBucketsInput, optFns ...func(*DescribeBucketsPaginatorOptions)) *DescribeBucketsPaginator { + options := DescribeBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBucketsInput{} + } + + return &DescribeBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBucketsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBuckets page. +func (p *DescribeBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeBuckets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBuckets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_GetUsageStatistics.go b/service/macie2/api_op_GetUsageStatistics.go index 95b967b5f6e..824403c9ed0 100644 --- a/service/macie2/api_op_GetUsageStatistics.go +++ b/service/macie2/api_op_GetUsageStatistics.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -116,6 +117,88 @@ func addOperationGetUsageStatisticsMiddlewares(stack *middleware.Stack, options return nil } +// GetUsageStatisticsAPIClient is a client that implements the GetUsageStatistics +// operation. +type GetUsageStatisticsAPIClient interface { + GetUsageStatistics(context.Context, *GetUsageStatisticsInput, ...func(*Options)) (*GetUsageStatisticsOutput, error) +} + +var _ GetUsageStatisticsAPIClient = (*Client)(nil) + +// GetUsageStatisticsPaginatorOptions is the paginator options for +// GetUsageStatistics +type GetUsageStatisticsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + 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 +} + +// GetUsageStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.GetUsageStatistics +type GetUsageStatisticsPaginator struct { + options GetUsageStatisticsPaginatorOptions + client GetUsageStatisticsAPIClient + params *GetUsageStatisticsInput + nextToken *string + firstPage bool +} + +// NewGetUsageStatisticsPaginator returns a new GetUsageStatisticsPaginator +func NewGetUsageStatisticsPaginator(client GetUsageStatisticsAPIClient, params *GetUsageStatisticsInput, optFns ...func(*GetUsageStatisticsPaginatorOptions)) *GetUsageStatisticsPaginator { + options := GetUsageStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetUsageStatisticsInput{} + } + + return &GetUsageStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetUsageStatisticsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetUsageStatistics page. +func (p *GetUsageStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetUsageStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetUsageStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetUsageStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListClassificationJobs.go b/service/macie2/api_op_ListClassificationJobs.go index 2d6fcfd22fc..f0731ce9d11 100644 --- a/service/macie2/api_op_ListClassificationJobs.go +++ b/service/macie2/api_op_ListClassificationJobs.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -114,6 +115,88 @@ func addOperationListClassificationJobsMiddlewares(stack *middleware.Stack, opti return nil } +// ListClassificationJobsAPIClient is a client that implements the +// ListClassificationJobs operation. +type ListClassificationJobsAPIClient interface { + ListClassificationJobs(context.Context, *ListClassificationJobsInput, ...func(*Options)) (*ListClassificationJobsOutput, error) +} + +var _ ListClassificationJobsAPIClient = (*Client)(nil) + +// ListClassificationJobsPaginatorOptions is the paginator options for +// ListClassificationJobs +type ListClassificationJobsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + 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 +} + +// ListClassificationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListClassificationJobs +type ListClassificationJobsPaginator struct { + options ListClassificationJobsPaginatorOptions + client ListClassificationJobsAPIClient + params *ListClassificationJobsInput + nextToken *string + firstPage bool +} + +// NewListClassificationJobsPaginator returns a new ListClassificationJobsPaginator +func NewListClassificationJobsPaginator(client ListClassificationJobsAPIClient, params *ListClassificationJobsInput, optFns ...func(*ListClassificationJobsPaginatorOptions)) *ListClassificationJobsPaginator { + options := ListClassificationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClassificationJobsInput{} + } + + return &ListClassificationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClassificationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListClassificationJobs page. +func (p *ListClassificationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClassificationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListClassificationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClassificationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListCustomDataIdentifiers.go b/service/macie2/api_op_ListCustomDataIdentifiers.go index f8ea652b24c..548bbc1cc57 100644 --- a/service/macie2/api_op_ListCustomDataIdentifiers.go +++ b/service/macie2/api_op_ListCustomDataIdentifiers.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -108,6 +109,89 @@ func addOperationListCustomDataIdentifiersMiddlewares(stack *middleware.Stack, o return nil } +// ListCustomDataIdentifiersAPIClient is a client that implements the +// ListCustomDataIdentifiers operation. +type ListCustomDataIdentifiersAPIClient interface { + ListCustomDataIdentifiers(context.Context, *ListCustomDataIdentifiersInput, ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) +} + +var _ ListCustomDataIdentifiersAPIClient = (*Client)(nil) + +// ListCustomDataIdentifiersPaginatorOptions is the paginator options for +// ListCustomDataIdentifiers +type ListCustomDataIdentifiersPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + 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 +} + +// ListCustomDataIdentifiersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListCustomDataIdentifiers +type ListCustomDataIdentifiersPaginator struct { + options ListCustomDataIdentifiersPaginatorOptions + client ListCustomDataIdentifiersAPIClient + params *ListCustomDataIdentifiersInput + nextToken *string + firstPage bool +} + +// NewListCustomDataIdentifiersPaginator returns a new +// ListCustomDataIdentifiersPaginator +func NewListCustomDataIdentifiersPaginator(client ListCustomDataIdentifiersAPIClient, params *ListCustomDataIdentifiersInput, optFns ...func(*ListCustomDataIdentifiersPaginatorOptions)) *ListCustomDataIdentifiersPaginator { + options := ListCustomDataIdentifiersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomDataIdentifiersInput{} + } + + return &ListCustomDataIdentifiersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomDataIdentifiersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCustomDataIdentifiers page. +func (p *ListCustomDataIdentifiersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomDataIdentifiersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListCustomDataIdentifiers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomDataIdentifiers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListFindings.go b/service/macie2/api_op_ListFindings.go index 7d45f8998ef..942e7bdc514 100644 --- a/service/macie2/api_op_ListFindings.go +++ b/service/macie2/api_op_ListFindings.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -114,6 +115,86 @@ func addOperationListFindingsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListFindingsAPIClient is a client that implements the ListFindings operation. +type ListFindingsAPIClient interface { + ListFindings(context.Context, *ListFindingsInput, ...func(*Options)) (*ListFindingsOutput, error) +} + +var _ ListFindingsAPIClient = (*Client)(nil) + +// ListFindingsPaginatorOptions is the paginator options for ListFindings +type ListFindingsPaginatorOptions struct { + // The maximum number of items to include in each page of the response. + 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 +} + +// ListFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListFindings +type ListFindingsPaginator struct { + options ListFindingsPaginatorOptions + client ListFindingsAPIClient + params *ListFindingsInput + nextToken *string + firstPage bool +} + +// NewListFindingsPaginator returns a new ListFindingsPaginator +func NewListFindingsPaginator(client ListFindingsAPIClient, params *ListFindingsInput, optFns ...func(*ListFindingsPaginatorOptions)) *ListFindingsPaginator { + options := ListFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsInput{} + } + + return &ListFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFindings page. +func (p *ListFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListFindingsFilters.go b/service/macie2/api_op_ListFindingsFilters.go index e9b6de394af..6b95618e168 100644 --- a/service/macie2/api_op_ListFindingsFilters.go +++ b/service/macie2/api_op_ListFindingsFilters.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -107,6 +108,88 @@ func addOperationListFindingsFiltersMiddlewares(stack *middleware.Stack, options return nil } +// ListFindingsFiltersAPIClient is a client that implements the ListFindingsFilters +// operation. +type ListFindingsFiltersAPIClient interface { + ListFindingsFilters(context.Context, *ListFindingsFiltersInput, ...func(*Options)) (*ListFindingsFiltersOutput, error) +} + +var _ ListFindingsFiltersAPIClient = (*Client)(nil) + +// ListFindingsFiltersPaginatorOptions is the paginator options for +// ListFindingsFilters +type ListFindingsFiltersPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + 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 +} + +// ListFindingsFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListFindingsFilters +type ListFindingsFiltersPaginator struct { + options ListFindingsFiltersPaginatorOptions + client ListFindingsFiltersAPIClient + params *ListFindingsFiltersInput + nextToken *string + firstPage bool +} + +// NewListFindingsFiltersPaginator returns a new ListFindingsFiltersPaginator +func NewListFindingsFiltersPaginator(client ListFindingsFiltersAPIClient, params *ListFindingsFiltersInput, optFns ...func(*ListFindingsFiltersPaginatorOptions)) *ListFindingsFiltersPaginator { + options := ListFindingsFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFindingsFiltersInput{} + } + + return &ListFindingsFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFindingsFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFindingsFilters page. +func (p *ListFindingsFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFindingsFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListFindingsFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFindingsFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListInvitations.go b/service/macie2/api_op_ListInvitations.go index 659724ca61a..ba159f0927d 100644 --- a/service/macie2/api_op_ListInvitations.go +++ b/service/macie2/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -108,6 +109,87 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + 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 +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListMembers.go b/service/macie2/api_op_ListMembers.go index 0ece89090f5..7e806e43b87 100644 --- a/service/macie2/api_op_ListMembers.go +++ b/service/macie2/api_op_ListMembers.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -116,6 +117,86 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + 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 +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/api_op_ListOrganizationAdminAccounts.go b/service/macie2/api_op_ListOrganizationAdminAccounts.go index ceaf09c61ef..33c36a8ae1f 100644 --- a/service/macie2/api_op_ListOrganizationAdminAccounts.go +++ b/service/macie2/api_op_ListOrganizationAdminAccounts.go @@ -4,6 +4,7 @@ package macie2 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/macie2/types" @@ -109,6 +110,89 @@ func addOperationListOrganizationAdminAccountsMiddlewares(stack *middleware.Stac return nil } +// ListOrganizationAdminAccountsAPIClient is a client that implements the +// ListOrganizationAdminAccounts operation. +type ListOrganizationAdminAccountsAPIClient interface { + ListOrganizationAdminAccounts(context.Context, *ListOrganizationAdminAccountsInput, ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) +} + +var _ ListOrganizationAdminAccountsAPIClient = (*Client)(nil) + +// ListOrganizationAdminAccountsPaginatorOptions is the paginator options for +// ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginatorOptions struct { + // The maximum number of items to include in each page of a paginated response. + 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 +} + +// ListOrganizationAdminAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/macie2.ListOrganizationAdminAccounts +type ListOrganizationAdminAccountsPaginator struct { + options ListOrganizationAdminAccountsPaginatorOptions + client ListOrganizationAdminAccountsAPIClient + params *ListOrganizationAdminAccountsInput + nextToken *string + firstPage bool +} + +// NewListOrganizationAdminAccountsPaginator returns a new +// ListOrganizationAdminAccountsPaginator +func NewListOrganizationAdminAccountsPaginator(client ListOrganizationAdminAccountsAPIClient, params *ListOrganizationAdminAccountsInput, optFns ...func(*ListOrganizationAdminAccountsPaginatorOptions)) *ListOrganizationAdminAccountsPaginator { + options := ListOrganizationAdminAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationAdminAccountsInput{} + } + + return &ListOrganizationAdminAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationAdminAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOrganizationAdminAccounts page. +func (p *ListOrganizationAdminAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationAdminAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListOrganizationAdminAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationAdminAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/macie2/endpoints.go b/service/macie2/endpoints.go index 46eb82aec84..f5d794aac76 100644 --- a/service/macie2/endpoints.go +++ b/service/macie2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/managedblockchain/api_op_ListInvitations.go b/service/managedblockchain/api_op_ListInvitations.go index 43f8dcb0600..28c69b0de52 100644 --- a/service/managedblockchain/api_op_ListInvitations.go +++ b/service/managedblockchain/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -105,6 +106,87 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of invitations 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 +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListMembers.go b/service/managedblockchain/api_op_ListMembers.go index 1925ff3885b..30febda5b52 100644 --- a/service/managedblockchain/api_op_ListMembers.go +++ b/service/managedblockchain/api_op_ListMembers.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -127,6 +128,86 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of members to return in the request. + 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 +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListNetworks.go b/service/managedblockchain/api_op_ListNetworks.go index 06c3f85b6fa..d943c99d9bb 100644 --- a/service/managedblockchain/api_op_ListNetworks.go +++ b/service/managedblockchain/api_op_ListNetworks.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -118,6 +119,86 @@ func addOperationListNetworksMiddlewares(stack *middleware.Stack, options Option return nil } +// ListNetworksAPIClient is a client that implements the ListNetworks operation. +type ListNetworksAPIClient interface { + ListNetworks(context.Context, *ListNetworksInput, ...func(*Options)) (*ListNetworksOutput, error) +} + +var _ ListNetworksAPIClient = (*Client)(nil) + +// ListNetworksPaginatorOptions is the paginator options for ListNetworks +type ListNetworksPaginatorOptions struct { + // The maximum number of networks to list. + 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 +} + +// ListNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListNetworks +type ListNetworksPaginator struct { + options ListNetworksPaginatorOptions + client ListNetworksAPIClient + params *ListNetworksInput + nextToken *string + firstPage bool +} + +// NewListNetworksPaginator returns a new ListNetworksPaginator +func NewListNetworksPaginator(client ListNetworksAPIClient, params *ListNetworksInput, optFns ...func(*ListNetworksPaginatorOptions)) *ListNetworksPaginator { + options := ListNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNetworksInput{} + } + + return &ListNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNetworksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNetworks page. +func (p *ListNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListNodes.go b/service/managedblockchain/api_op_ListNodes.go index 2bfac549144..464a92814e2 100644 --- a/service/managedblockchain/api_op_ListNodes.go +++ b/service/managedblockchain/api_op_ListNodes.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -123,6 +124,86 @@ func addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListNodesAPIClient is a client that implements the ListNodes operation. +type ListNodesAPIClient interface { + ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) +} + +var _ ListNodesAPIClient = (*Client)(nil) + +// ListNodesPaginatorOptions is the paginator options for ListNodes +type ListNodesPaginatorOptions struct { + // The maximum number of nodes to list. + 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 +} + +// ListNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListNodes +type ListNodesPaginator struct { + options ListNodesPaginatorOptions + client ListNodesAPIClient + params *ListNodesInput + nextToken *string + firstPage bool +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + options := ListNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNodesInput{} + } + + return &ListNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNodes page. +func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListProposalVotes.go b/service/managedblockchain/api_op_ListProposalVotes.go index 3edfec25ddf..0d82d527640 100644 --- a/service/managedblockchain/api_op_ListProposalVotes.go +++ b/service/managedblockchain/api_op_ListProposalVotes.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -119,6 +120,87 @@ func addOperationListProposalVotesMiddlewares(stack *middleware.Stack, options O return nil } +// ListProposalVotesAPIClient is a client that implements the ListProposalVotes +// operation. +type ListProposalVotesAPIClient interface { + ListProposalVotes(context.Context, *ListProposalVotesInput, ...func(*Options)) (*ListProposalVotesOutput, error) +} + +var _ ListProposalVotesAPIClient = (*Client)(nil) + +// ListProposalVotesPaginatorOptions is the paginator options for ListProposalVotes +type ListProposalVotesPaginatorOptions struct { + // The maximum number of votes 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 +} + +// ListProposalVotesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListProposalVotes +type ListProposalVotesPaginator struct { + options ListProposalVotesPaginatorOptions + client ListProposalVotesAPIClient + params *ListProposalVotesInput + nextToken *string + firstPage bool +} + +// NewListProposalVotesPaginator returns a new ListProposalVotesPaginator +func NewListProposalVotesPaginator(client ListProposalVotesAPIClient, params *ListProposalVotesInput, optFns ...func(*ListProposalVotesPaginatorOptions)) *ListProposalVotesPaginator { + options := ListProposalVotesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProposalVotesInput{} + } + + return &ListProposalVotesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProposalVotesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProposalVotes page. +func (p *ListProposalVotesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalVotesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProposalVotes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProposalVotes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/api_op_ListProposals.go b/service/managedblockchain/api_op_ListProposals.go index a5af9b21134..1c2189b1851 100644 --- a/service/managedblockchain/api_op_ListProposals.go +++ b/service/managedblockchain/api_op_ListProposals.go @@ -4,6 +4,7 @@ package managedblockchain 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/managedblockchain/types" @@ -113,6 +114,86 @@ func addOperationListProposalsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListProposalsAPIClient is a client that implements the ListProposals operation. +type ListProposalsAPIClient interface { + ListProposals(context.Context, *ListProposalsInput, ...func(*Options)) (*ListProposalsOutput, error) +} + +var _ ListProposalsAPIClient = (*Client)(nil) + +// ListProposalsPaginatorOptions is the paginator options for ListProposals +type ListProposalsPaginatorOptions struct { + // The maximum number of proposals 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 +} + +// ListProposalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/managedblockchain.ListProposals +type ListProposalsPaginator struct { + options ListProposalsPaginatorOptions + client ListProposalsAPIClient + params *ListProposalsInput + nextToken *string + firstPage bool +} + +// NewListProposalsPaginator returns a new ListProposalsPaginator +func NewListProposalsPaginator(client ListProposalsAPIClient, params *ListProposalsInput, optFns ...func(*ListProposalsPaginatorOptions)) *ListProposalsPaginator { + options := ListProposalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProposalsInput{} + } + + return &ListProposalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProposalsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProposals page. +func (p *ListProposalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProposalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProposals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProposals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/managedblockchain/endpoints.go b/service/managedblockchain/endpoints.go index 48d6dd619f9..8164096b952 100644 --- a/service/managedblockchain/endpoints.go +++ b/service/managedblockchain/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/marketplacecatalog/api_op_ListChangeSets.go b/service/marketplacecatalog/api_op_ListChangeSets.go index 0ea82c14163..f09ffc3bb7a 100644 --- a/service/marketplacecatalog/api_op_ListChangeSets.go +++ b/service/marketplacecatalog/api_op_ListChangeSets.go @@ -4,6 +4,7 @@ package marketplacecatalog 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/marketplacecatalog/types" @@ -126,6 +127,89 @@ func addOperationListChangeSetsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListChangeSetsAPIClient is a client that implements the ListChangeSets +// operation. +type ListChangeSetsAPIClient interface { + ListChangeSets(context.Context, *ListChangeSetsInput, ...func(*Options)) (*ListChangeSetsOutput, error) +} + +var _ ListChangeSetsAPIClient = (*Client)(nil) + +// ListChangeSetsPaginatorOptions is the paginator options for ListChangeSets +type ListChangeSetsPaginatorOptions struct { + // The maximum number of results returned by a single call. This value must be + // provided in the next call to retrieve the next set of results. By default, this + // value is 20. + 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 +} + +// ListChangeSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/marketplacecatalog.ListChangeSets +type ListChangeSetsPaginator struct { + options ListChangeSetsPaginatorOptions + client ListChangeSetsAPIClient + params *ListChangeSetsInput + nextToken *string + firstPage bool +} + +// NewListChangeSetsPaginator returns a new ListChangeSetsPaginator +func NewListChangeSetsPaginator(client ListChangeSetsAPIClient, params *ListChangeSetsInput, optFns ...func(*ListChangeSetsPaginatorOptions)) *ListChangeSetsPaginator { + options := ListChangeSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChangeSetsInput{} + } + + return &ListChangeSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChangeSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChangeSets page. +func (p *ListChangeSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChangeSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListChangeSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChangeSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/marketplacecatalog/api_op_ListEntities.go b/service/marketplacecatalog/api_op_ListEntities.go index 72f16216ff6..80f42d48004 100644 --- a/service/marketplacecatalog/api_op_ListEntities.go +++ b/service/marketplacecatalog/api_op_ListEntities.go @@ -4,6 +4,7 @@ package marketplacecatalog 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/marketplacecatalog/types" @@ -126,6 +127,87 @@ func addOperationListEntitiesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListEntitiesAPIClient is a client that implements the ListEntities operation. +type ListEntitiesAPIClient interface { + ListEntities(context.Context, *ListEntitiesInput, ...func(*Options)) (*ListEntitiesOutput, error) +} + +var _ ListEntitiesAPIClient = (*Client)(nil) + +// ListEntitiesPaginatorOptions is the paginator options for ListEntities +type ListEntitiesPaginatorOptions struct { + // Specifies the upper limit of the elements on a single page. If a value isn't + // provided, the default value is 20. + 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 +} + +// ListEntitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/marketplacecatalog.ListEntities +type ListEntitiesPaginator struct { + options ListEntitiesPaginatorOptions + client ListEntitiesAPIClient + params *ListEntitiesInput + nextToken *string + firstPage bool +} + +// NewListEntitiesPaginator returns a new ListEntitiesPaginator +func NewListEntitiesPaginator(client ListEntitiesAPIClient, params *ListEntitiesInput, optFns ...func(*ListEntitiesPaginatorOptions)) *ListEntitiesPaginator { + options := ListEntitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitiesInput{} + } + + return &ListEntitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEntities page. +func (p *ListEntitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEntities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/marketplacecatalog/endpoints.go b/service/marketplacecatalog/endpoints.go index 70e2c285863..dee92df9547 100644 --- a/service/marketplacecatalog/endpoints.go +++ b/service/marketplacecatalog/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/marketplacecommerceanalytics/endpoints.go b/service/marketplacecommerceanalytics/endpoints.go index 9ab375bc6d7..0796a20324b 100644 --- a/service/marketplacecommerceanalytics/endpoints.go +++ b/service/marketplacecommerceanalytics/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/marketplaceentitlementservice/endpoints.go b/service/marketplaceentitlementservice/endpoints.go index c2286a5309c..6fdcb676424 100644 --- a/service/marketplaceentitlementservice/endpoints.go +++ b/service/marketplaceentitlementservice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/marketplacemetering/endpoints.go b/service/marketplacemetering/endpoints.go index 804badae445..6aa13310057 100644 --- a/service/marketplacemetering/endpoints.go +++ b/service/marketplacemetering/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediaconnect/api_op_ListEntitlements.go b/service/mediaconnect/api_op_ListEntitlements.go index 25db13e2a4c..291da6fdcc2 100644 --- a/service/mediaconnect/api_op_ListEntitlements.go +++ b/service/mediaconnect/api_op_ListEntitlements.go @@ -4,6 +4,7 @@ package mediaconnect 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/mediaconnect/types" @@ -120,6 +121,93 @@ func addOperationListEntitlementsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListEntitlementsAPIClient is a client that implements the ListEntitlements +// operation. +type ListEntitlementsAPIClient interface { + ListEntitlements(context.Context, *ListEntitlementsInput, ...func(*Options)) (*ListEntitlementsOutput, error) +} + +var _ ListEntitlementsAPIClient = (*Client)(nil) + +// ListEntitlementsPaginatorOptions is the paginator options for ListEntitlements +type ListEntitlementsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListEntitlements request with MaxResults set at 5. Although 20 items match + // your request, the service returns no more than the first 5 items. (The service + // also returns a NextToken value that you can use to fetch the next batch of + // results.) The service might return fewer results than the MaxResults value. If + // MaxResults is not included in the request, the service defaults to pagination + // with a maximum of 20 results per page. + 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 +} + +// ListEntitlementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListEntitlements +type ListEntitlementsPaginator struct { + options ListEntitlementsPaginatorOptions + client ListEntitlementsAPIClient + params *ListEntitlementsInput + nextToken *string + firstPage bool +} + +// NewListEntitlementsPaginator returns a new ListEntitlementsPaginator +func NewListEntitlementsPaginator(client ListEntitlementsAPIClient, params *ListEntitlementsInput, optFns ...func(*ListEntitlementsPaginatorOptions)) *ListEntitlementsPaginator { + options := ListEntitlementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEntitlementsInput{} + } + + return &ListEntitlementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEntitlementsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEntitlements page. +func (p *ListEntitlementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEntitlementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListEntitlements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEntitlements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListFlows.go b/service/mediaconnect/api_op_ListFlows.go index c52d5fba579..525e2ea04a6 100644 --- a/service/mediaconnect/api_op_ListFlows.go +++ b/service/mediaconnect/api_op_ListFlows.go @@ -4,6 +4,7 @@ package mediaconnect 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/mediaconnect/types" @@ -120,6 +121,92 @@ func addOperationListFlowsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFlowsAPIClient is a client that implements the ListFlows operation. +type ListFlowsAPIClient interface { + ListFlows(context.Context, *ListFlowsInput, ...func(*Options)) (*ListFlowsOutput, error) +} + +var _ ListFlowsAPIClient = (*Client)(nil) + +// ListFlowsPaginatorOptions is the paginator options for ListFlows +type ListFlowsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListFlows request with MaxResults set at 5. Although 20 items match your + // request, the service returns no more than the first 5 items. (The service also + // returns a NextToken value that you can use to fetch the next batch of results.) + // The service might return fewer results than the MaxResults value. If MaxResults + // is not included in the request, the service defaults to pagination with a + // maximum of 10 results per page. + 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 +} + +// ListFlowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListFlows +type ListFlowsPaginator struct { + options ListFlowsPaginatorOptions + client ListFlowsAPIClient + params *ListFlowsInput + nextToken *string + firstPage bool +} + +// NewListFlowsPaginator returns a new ListFlowsPaginator +func NewListFlowsPaginator(client ListFlowsAPIClient, params *ListFlowsInput, optFns ...func(*ListFlowsPaginatorOptions)) *ListFlowsPaginator { + options := ListFlowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowsInput{} + } + + return &ListFlowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFlows page. +func (p *ListFlowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListFlows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListOfferings.go b/service/mediaconnect/api_op_ListOfferings.go index 538b3aa3b33..baba2067074 100644 --- a/service/mediaconnect/api_op_ListOfferings.go +++ b/service/mediaconnect/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package mediaconnect 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/mediaconnect/types" @@ -123,6 +124,92 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListOfferings request with MaxResults set at 5. Although 20 items match your + // request, the service returns no more than the first 5 items. (The service also + // returns a NextToken value that you can use to fetch the next batch of results.) + // The service might return fewer results than the MaxResults value. If MaxResults + // is not included in the request, the service defaults to pagination with a + // maximum of 10 results per page. + 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 +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/api_op_ListReservations.go b/service/mediaconnect/api_op_ListReservations.go index 9dd2d5a7435..3272c2ea752 100644 --- a/service/mediaconnect/api_op_ListReservations.go +++ b/service/mediaconnect/api_op_ListReservations.go @@ -4,6 +4,7 @@ package mediaconnect 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/mediaconnect/types" @@ -122,6 +123,93 @@ func addOperationListReservationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListReservationsAPIClient is a client that implements the ListReservations +// operation. +type ListReservationsAPIClient interface { + ListReservations(context.Context, *ListReservationsInput, ...func(*Options)) (*ListReservationsOutput, error) +} + +var _ ListReservationsAPIClient = (*Client)(nil) + +// ListReservationsPaginatorOptions is the paginator options for ListReservations +type ListReservationsPaginatorOptions struct { + // The maximum number of results to return per API request. For example, you submit + // a ListReservations request with MaxResults set at 5. Although 20 items match + // your request, the service returns no more than the first 5 items. (The service + // also returns a NextToken value that you can use to fetch the next batch of + // results.) The service might return fewer results than the MaxResults value. If + // MaxResults is not included in the request, the service defaults to pagination + // with a maximum of 10 results per page. + 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 +} + +// ListReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconnect.ListReservations +type ListReservationsPaginator struct { + options ListReservationsPaginatorOptions + client ListReservationsAPIClient + params *ListReservationsInput + nextToken *string + firstPage bool +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReservationsInput{} + } + + return &ListReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReservationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReservations page. +func (p *ListReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconnect/endpoints.go b/service/mediaconnect/endpoints.go index 1c8470c6228..3244d641591 100644 --- a/service/mediaconnect/endpoints.go +++ b/service/mediaconnect/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediaconvert/api_op_DescribeEndpoints.go b/service/mediaconvert/api_op_DescribeEndpoints.go index 59bb8bdf464..009b45f4570 100644 --- a/service/mediaconvert/api_op_DescribeEndpoints.go +++ b/service/mediaconvert/api_op_DescribeEndpoints.go @@ -4,6 +4,7 @@ package mediaconvert 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/mediaconvert/types" @@ -115,6 +116,88 @@ func addOperationDescribeEndpointsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeEndpointsAPIClient is a client that implements the DescribeEndpoints +// operation. +type DescribeEndpointsAPIClient interface { + DescribeEndpoints(context.Context, *DescribeEndpointsInput, ...func(*Options)) (*DescribeEndpointsOutput, error) +} + +var _ DescribeEndpointsAPIClient = (*Client)(nil) + +// DescribeEndpointsPaginatorOptions is the paginator options for DescribeEndpoints +type DescribeEndpointsPaginatorOptions struct { + // Optional. Max number of endpoints, up to twenty, that will be returned at one + // time. + 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 +} + +// DescribeEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.DescribeEndpoints +type DescribeEndpointsPaginator struct { + options DescribeEndpointsPaginatorOptions + client DescribeEndpointsAPIClient + params *DescribeEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeEndpointsPaginator returns a new DescribeEndpointsPaginator +func NewDescribeEndpointsPaginator(client DescribeEndpointsAPIClient, params *DescribeEndpointsInput, optFns ...func(*DescribeEndpointsPaginatorOptions)) *DescribeEndpointsPaginator { + options := DescribeEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEndpointsInput{} + } + + return &DescribeEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEndpoints page. +func (p *DescribeEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListJobTemplates.go b/service/mediaconvert/api_op_ListJobTemplates.go index 51851dcda0b..f806baef149 100644 --- a/service/mediaconvert/api_op_ListJobTemplates.go +++ b/service/mediaconvert/api_op_ListJobTemplates.go @@ -4,6 +4,7 @@ package mediaconvert 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/mediaconvert/types" @@ -122,6 +123,88 @@ func addOperationListJobTemplatesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListJobTemplatesAPIClient is a client that implements the ListJobTemplates +// operation. +type ListJobTemplatesAPIClient interface { + ListJobTemplates(context.Context, *ListJobTemplatesInput, ...func(*Options)) (*ListJobTemplatesOutput, error) +} + +var _ ListJobTemplatesAPIClient = (*Client)(nil) + +// ListJobTemplatesPaginatorOptions is the paginator options for ListJobTemplates +type ListJobTemplatesPaginatorOptions struct { + // Optional. Number of job templates, up to twenty, that will be returned at one + // time. + 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 +} + +// ListJobTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListJobTemplates +type ListJobTemplatesPaginator struct { + options ListJobTemplatesPaginatorOptions + client ListJobTemplatesAPIClient + params *ListJobTemplatesInput + nextToken *string + firstPage bool +} + +// NewListJobTemplatesPaginator returns a new ListJobTemplatesPaginator +func NewListJobTemplatesPaginator(client ListJobTemplatesAPIClient, params *ListJobTemplatesInput, optFns ...func(*ListJobTemplatesPaginatorOptions)) *ListJobTemplatesPaginator { + options := ListJobTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobTemplatesInput{} + } + + return &ListJobTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobTemplates page. +func (p *ListJobTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListJobTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListJobs.go b/service/mediaconvert/api_op_ListJobs.go index 20a712f8f45..25c786ba90a 100644 --- a/service/mediaconvert/api_op_ListJobs.go +++ b/service/mediaconvert/api_op_ListJobs.go @@ -4,6 +4,7 @@ package mediaconvert 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/mediaconvert/types" @@ -120,6 +121,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // Optional. Number of jobs, up to twenty, that will be returned at one time. + 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListPresets.go b/service/mediaconvert/api_op_ListPresets.go index 66783284f80..e387a8ceb3a 100644 --- a/service/mediaconvert/api_op_ListPresets.go +++ b/service/mediaconvert/api_op_ListPresets.go @@ -4,6 +4,7 @@ package mediaconvert 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/mediaconvert/types" @@ -121,6 +122,86 @@ func addOperationListPresetsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListPresetsAPIClient is a client that implements the ListPresets operation. +type ListPresetsAPIClient interface { + ListPresets(context.Context, *ListPresetsInput, ...func(*Options)) (*ListPresetsOutput, error) +} + +var _ ListPresetsAPIClient = (*Client)(nil) + +// ListPresetsPaginatorOptions is the paginator options for ListPresets +type ListPresetsPaginatorOptions struct { + // Optional. Number of presets, up to twenty, that will be returned at one time + 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 +} + +// ListPresetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListPresets +type ListPresetsPaginator struct { + options ListPresetsPaginatorOptions + client ListPresetsAPIClient + params *ListPresetsInput + nextToken *string + firstPage bool +} + +// NewListPresetsPaginator returns a new ListPresetsPaginator +func NewListPresetsPaginator(client ListPresetsAPIClient, params *ListPresetsInput, optFns ...func(*ListPresetsPaginatorOptions)) *ListPresetsPaginator { + options := ListPresetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPresetsInput{} + } + + return &ListPresetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPresetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPresets page. +func (p *ListPresetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPresetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPresets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPresets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/api_op_ListQueues.go b/service/mediaconvert/api_op_ListQueues.go index 9e36f9be45e..0f002765531 100644 --- a/service/mediaconvert/api_op_ListQueues.go +++ b/service/mediaconvert/api_op_ListQueues.go @@ -4,6 +4,7 @@ package mediaconvert 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/mediaconvert/types" @@ -117,6 +118,86 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // Optional. Number of queues, up to twenty, that will be returned at one time. + 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 +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediaconvert.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediaconvert/endpoints.go b/service/mediaconvert/endpoints.go index 1b6f3864f8d..378d83928d5 100644 --- a/service/mediaconvert/endpoints.go +++ b/service/mediaconvert/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/medialive/api_op_DescribeSchedule.go b/service/medialive/api_op_DescribeSchedule.go index 706d5e1747c..82517b29855 100644 --- a/service/medialive/api_op_DescribeSchedule.go +++ b/service/medialive/api_op_DescribeSchedule.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -115,6 +116,87 @@ func addOperationDescribeScheduleMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeScheduleAPIClient is a client that implements the DescribeSchedule +// operation. +type DescribeScheduleAPIClient interface { + DescribeSchedule(context.Context, *DescribeScheduleInput, ...func(*Options)) (*DescribeScheduleOutput, error) +} + +var _ DescribeScheduleAPIClient = (*Client)(nil) + +// DescribeSchedulePaginatorOptions is the paginator options for DescribeSchedule +type DescribeSchedulePaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// DescribeSchedulePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.DescribeSchedule +type DescribeSchedulePaginator struct { + options DescribeSchedulePaginatorOptions + client DescribeScheduleAPIClient + params *DescribeScheduleInput + nextToken *string + firstPage bool +} + +// NewDescribeSchedulePaginator returns a new DescribeSchedulePaginator +func NewDescribeSchedulePaginator(client DescribeScheduleAPIClient, params *DescribeScheduleInput, optFns ...func(*DescribeSchedulePaginatorOptions)) *DescribeSchedulePaginator { + options := DescribeSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduleInput{} + } + + return &DescribeSchedulePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSchedulePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSchedule page. +func (p *DescribeSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSchedule(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSchedule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListChannels.go b/service/medialive/api_op_ListChannels.go index 6a345a0a691..c102e1d6d6a 100644 --- a/service/medialive/api_op_ListChannels.go +++ b/service/medialive/api_op_ListChannels.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -107,6 +108,86 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputDeviceTransfers.go b/service/medialive/api_op_ListInputDeviceTransfers.go index f44f9bad33a..886d5c4b9da 100644 --- a/service/medialive/api_op_ListInputDeviceTransfers.go +++ b/service/medialive/api_op_ListInputDeviceTransfers.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -117,6 +118,89 @@ func addOperationListInputDeviceTransfersMiddlewares(stack *middleware.Stack, op return nil } +// ListInputDeviceTransfersAPIClient is a client that implements the +// ListInputDeviceTransfers operation. +type ListInputDeviceTransfersAPIClient interface { + ListInputDeviceTransfers(context.Context, *ListInputDeviceTransfersInput, ...func(*Options)) (*ListInputDeviceTransfersOutput, error) +} + +var _ ListInputDeviceTransfersAPIClient = (*Client)(nil) + +// ListInputDeviceTransfersPaginatorOptions is the paginator options for +// ListInputDeviceTransfers +type ListInputDeviceTransfersPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListInputDeviceTransfersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputDeviceTransfers +type ListInputDeviceTransfersPaginator struct { + options ListInputDeviceTransfersPaginatorOptions + client ListInputDeviceTransfersAPIClient + params *ListInputDeviceTransfersInput + nextToken *string + firstPage bool +} + +// NewListInputDeviceTransfersPaginator returns a new +// ListInputDeviceTransfersPaginator +func NewListInputDeviceTransfersPaginator(client ListInputDeviceTransfersAPIClient, params *ListInputDeviceTransfersInput, optFns ...func(*ListInputDeviceTransfersPaginatorOptions)) *ListInputDeviceTransfersPaginator { + options := ListInputDeviceTransfersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputDeviceTransfersInput{} + } + + return &ListInputDeviceTransfersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputDeviceTransfersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInputDeviceTransfers page. +func (p *ListInputDeviceTransfersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputDeviceTransfersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInputDeviceTransfers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputDeviceTransfers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputDevices.go b/service/medialive/api_op_ListInputDevices.go index b9278ab6a02..e0f5ec6e363 100644 --- a/service/medialive/api_op_ListInputDevices.go +++ b/service/medialive/api_op_ListInputDevices.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -107,6 +108,87 @@ func addOperationListInputDevicesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListInputDevicesAPIClient is a client that implements the ListInputDevices +// operation. +type ListInputDevicesAPIClient interface { + ListInputDevices(context.Context, *ListInputDevicesInput, ...func(*Options)) (*ListInputDevicesOutput, error) +} + +var _ ListInputDevicesAPIClient = (*Client)(nil) + +// ListInputDevicesPaginatorOptions is the paginator options for ListInputDevices +type ListInputDevicesPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListInputDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputDevices +type ListInputDevicesPaginator struct { + options ListInputDevicesPaginatorOptions + client ListInputDevicesAPIClient + params *ListInputDevicesInput + nextToken *string + firstPage bool +} + +// NewListInputDevicesPaginator returns a new ListInputDevicesPaginator +func NewListInputDevicesPaginator(client ListInputDevicesAPIClient, params *ListInputDevicesInput, optFns ...func(*ListInputDevicesPaginatorOptions)) *ListInputDevicesPaginator { + options := ListInputDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputDevicesInput{} + } + + return &ListInputDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInputDevices page. +func (p *ListInputDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInputDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputSecurityGroups.go b/service/medialive/api_op_ListInputSecurityGroups.go index 3b49bb5a418..b0cb6577735 100644 --- a/service/medialive/api_op_ListInputSecurityGroups.go +++ b/service/medialive/api_op_ListInputSecurityGroups.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -107,6 +108,89 @@ func addOperationListInputSecurityGroupsMiddlewares(stack *middleware.Stack, opt return nil } +// ListInputSecurityGroupsAPIClient is a client that implements the +// ListInputSecurityGroups operation. +type ListInputSecurityGroupsAPIClient interface { + ListInputSecurityGroups(context.Context, *ListInputSecurityGroupsInput, ...func(*Options)) (*ListInputSecurityGroupsOutput, error) +} + +var _ ListInputSecurityGroupsAPIClient = (*Client)(nil) + +// ListInputSecurityGroupsPaginatorOptions is the paginator options for +// ListInputSecurityGroups +type ListInputSecurityGroupsPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListInputSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputSecurityGroups +type ListInputSecurityGroupsPaginator struct { + options ListInputSecurityGroupsPaginatorOptions + client ListInputSecurityGroupsAPIClient + params *ListInputSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewListInputSecurityGroupsPaginator returns a new +// ListInputSecurityGroupsPaginator +func NewListInputSecurityGroupsPaginator(client ListInputSecurityGroupsAPIClient, params *ListInputSecurityGroupsInput, optFns ...func(*ListInputSecurityGroupsPaginatorOptions)) *ListInputSecurityGroupsPaginator { + options := ListInputSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputSecurityGroupsInput{} + } + + return &ListInputSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInputSecurityGroups page. +func (p *ListInputSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInputSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListInputs.go b/service/medialive/api_op_ListInputs.go index 199a1de579d..c2d79535a77 100644 --- a/service/medialive/api_op_ListInputs.go +++ b/service/medialive/api_op_ListInputs.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -107,6 +108,86 @@ func addOperationListInputsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListInputsAPIClient is a client that implements the ListInputs operation. +type ListInputsAPIClient interface { + ListInputs(context.Context, *ListInputsInput, ...func(*Options)) (*ListInputsOutput, error) +} + +var _ ListInputsAPIClient = (*Client)(nil) + +// ListInputsPaginatorOptions is the paginator options for ListInputs +type ListInputsPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListInputsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListInputs +type ListInputsPaginator struct { + options ListInputsPaginatorOptions + client ListInputsAPIClient + params *ListInputsInput + nextToken *string + firstPage bool +} + +// NewListInputsPaginator returns a new ListInputsPaginator +func NewListInputsPaginator(client ListInputsAPIClient, params *ListInputsInput, optFns ...func(*ListInputsPaginatorOptions)) *ListInputsPaginator { + options := ListInputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInputsInput{} + } + + return &ListInputsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInputsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInputs page. +func (p *ListInputsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInputsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInputs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInputs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListMultiplexPrograms.go b/service/medialive/api_op_ListMultiplexPrograms.go index 1b97588756e..a8461f3e7e3 100644 --- a/service/medialive/api_op_ListMultiplexPrograms.go +++ b/service/medialive/api_op_ListMultiplexPrograms.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -115,6 +116,88 @@ func addOperationListMultiplexProgramsMiddlewares(stack *middleware.Stack, optio return nil } +// ListMultiplexProgramsAPIClient is a client that implements the +// ListMultiplexPrograms operation. +type ListMultiplexProgramsAPIClient interface { + ListMultiplexPrograms(context.Context, *ListMultiplexProgramsInput, ...func(*Options)) (*ListMultiplexProgramsOutput, error) +} + +var _ ListMultiplexProgramsAPIClient = (*Client)(nil) + +// ListMultiplexProgramsPaginatorOptions is the paginator options for +// ListMultiplexPrograms +type ListMultiplexProgramsPaginatorOptions struct { + // The maximum number of items 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 +} + +// ListMultiplexProgramsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListMultiplexPrograms +type ListMultiplexProgramsPaginator struct { + options ListMultiplexProgramsPaginatorOptions + client ListMultiplexProgramsAPIClient + params *ListMultiplexProgramsInput + nextToken *string + firstPage bool +} + +// NewListMultiplexProgramsPaginator returns a new ListMultiplexProgramsPaginator +func NewListMultiplexProgramsPaginator(client ListMultiplexProgramsAPIClient, params *ListMultiplexProgramsInput, optFns ...func(*ListMultiplexProgramsPaginatorOptions)) *ListMultiplexProgramsPaginator { + options := ListMultiplexProgramsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMultiplexProgramsInput{} + } + + return &ListMultiplexProgramsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMultiplexProgramsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMultiplexPrograms page. +func (p *ListMultiplexProgramsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultiplexProgramsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListMultiplexPrograms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMultiplexPrograms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListMultiplexes.go b/service/medialive/api_op_ListMultiplexes.go index 7883575fb7e..da6cdbf9a73 100644 --- a/service/medialive/api_op_ListMultiplexes.go +++ b/service/medialive/api_op_ListMultiplexes.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -107,6 +108,87 @@ func addOperationListMultiplexesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListMultiplexesAPIClient is a client that implements the ListMultiplexes +// operation. +type ListMultiplexesAPIClient interface { + ListMultiplexes(context.Context, *ListMultiplexesInput, ...func(*Options)) (*ListMultiplexesOutput, error) +} + +var _ ListMultiplexesAPIClient = (*Client)(nil) + +// ListMultiplexesPaginatorOptions is the paginator options for ListMultiplexes +type ListMultiplexesPaginatorOptions struct { + // The maximum number of items 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 +} + +// ListMultiplexesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListMultiplexes +type ListMultiplexesPaginator struct { + options ListMultiplexesPaginatorOptions + client ListMultiplexesAPIClient + params *ListMultiplexesInput + nextToken *string + firstPage bool +} + +// NewListMultiplexesPaginator returns a new ListMultiplexesPaginator +func NewListMultiplexesPaginator(client ListMultiplexesAPIClient, params *ListMultiplexesInput, optFns ...func(*ListMultiplexesPaginatorOptions)) *ListMultiplexesPaginator { + options := ListMultiplexesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMultiplexesInput{} + } + + return &ListMultiplexesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMultiplexesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMultiplexes page. +func (p *ListMultiplexesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMultiplexesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListMultiplexes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMultiplexes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListOfferings.go b/service/medialive/api_op_ListOfferings.go index 458bf21dffa..0d24cbfbafb 100644 --- a/service/medialive/api_op_ListOfferings.go +++ b/service/medialive/api_op_ListOfferings.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -138,6 +139,86 @@ func addOperationListOfferingsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListOfferingsAPIClient is a client that implements the ListOfferings operation. +type ListOfferingsAPIClient interface { + ListOfferings(context.Context, *ListOfferingsInput, ...func(*Options)) (*ListOfferingsOutput, error) +} + +var _ ListOfferingsAPIClient = (*Client)(nil) + +// ListOfferingsPaginatorOptions is the paginator options for ListOfferings +type ListOfferingsPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListOfferings +type ListOfferingsPaginator struct { + options ListOfferingsPaginatorOptions + client ListOfferingsAPIClient + params *ListOfferingsInput + nextToken *string + firstPage bool +} + +// NewListOfferingsPaginator returns a new ListOfferingsPaginator +func NewListOfferingsPaginator(client ListOfferingsAPIClient, params *ListOfferingsInput, optFns ...func(*ListOfferingsPaginatorOptions)) *ListOfferingsPaginator { + options := ListOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOfferingsInput{} + } + + return &ListOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOfferings page. +func (p *ListOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/api_op_ListReservations.go b/service/medialive/api_op_ListReservations.go index 16d71480de8..b5d93491844 100644 --- a/service/medialive/api_op_ListReservations.go +++ b/service/medialive/api_op_ListReservations.go @@ -4,6 +4,7 @@ package medialive 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/medialive/types" @@ -131,6 +132,87 @@ func addOperationListReservationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListReservationsAPIClient is a client that implements the ListReservations +// operation. +type ListReservationsAPIClient interface { + ListReservations(context.Context, *ListReservationsInput, ...func(*Options)) (*ListReservationsOutput, error) +} + +var _ ListReservationsAPIClient = (*Client)(nil) + +// ListReservationsPaginatorOptions is the paginator options for ListReservations +type ListReservationsPaginatorOptions struct { + // Placeholder documentation for MaxResults + 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 +} + +// ListReservationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/medialive.ListReservations +type ListReservationsPaginator struct { + options ListReservationsPaginatorOptions + client ListReservationsAPIClient + params *ListReservationsInput + nextToken *string + firstPage bool +} + +// NewListReservationsPaginator returns a new ListReservationsPaginator +func NewListReservationsPaginator(client ListReservationsAPIClient, params *ListReservationsInput, optFns ...func(*ListReservationsPaginatorOptions)) *ListReservationsPaginator { + options := ListReservationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReservationsInput{} + } + + return &ListReservationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReservationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReservations page. +func (p *ListReservationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReservationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListReservations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReservations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/medialive/endpoints.go b/service/medialive/endpoints.go index 57305bf7004..facb60783b7 100644 --- a/service/medialive/endpoints.go +++ b/service/medialive/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediapackage/api_op_ListChannels.go b/service/mediapackage/api_op_ListChannels.go index 677c85868a2..3ebcb73462d 100644 --- a/service/mediapackage/api_op_ListChannels.go +++ b/service/mediapackage/api_op_ListChannels.go @@ -4,6 +4,7 @@ package mediapackage 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/mediapackage/types" @@ -105,6 +106,86 @@ func addOperationListChannelsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // Upper bound on number of records 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 +} + +// ListChannelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + options := ListChannelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChannelsInput{} + } + + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListChannels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/api_op_ListHarvestJobs.go b/service/mediapackage/api_op_ListHarvestJobs.go index 23ac278936c..51bb333a629 100644 --- a/service/mediapackage/api_op_ListHarvestJobs.go +++ b/service/mediapackage/api_op_ListHarvestJobs.go @@ -4,6 +4,7 @@ package mediapackage 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/mediapackage/types" @@ -112,6 +113,87 @@ func addOperationListHarvestJobsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListHarvestJobsAPIClient is a client that implements the ListHarvestJobs +// operation. +type ListHarvestJobsAPIClient interface { + ListHarvestJobs(context.Context, *ListHarvestJobsInput, ...func(*Options)) (*ListHarvestJobsOutput, error) +} + +var _ ListHarvestJobsAPIClient = (*Client)(nil) + +// ListHarvestJobsPaginatorOptions is the paginator options for ListHarvestJobs +type ListHarvestJobsPaginatorOptions struct { + // The upper bound on the number of records 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 +} + +// ListHarvestJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListHarvestJobs +type ListHarvestJobsPaginator struct { + options ListHarvestJobsPaginatorOptions + client ListHarvestJobsAPIClient + params *ListHarvestJobsInput + nextToken *string + firstPage bool +} + +// NewListHarvestJobsPaginator returns a new ListHarvestJobsPaginator +func NewListHarvestJobsPaginator(client ListHarvestJobsAPIClient, params *ListHarvestJobsInput, optFns ...func(*ListHarvestJobsPaginatorOptions)) *ListHarvestJobsPaginator { + options := ListHarvestJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHarvestJobsInput{} + } + + return &ListHarvestJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHarvestJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHarvestJobs page. +func (p *ListHarvestJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHarvestJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListHarvestJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHarvestJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/api_op_ListOriginEndpoints.go b/service/mediapackage/api_op_ListOriginEndpoints.go index f1d93cbb0e6..95f3d6bd488 100644 --- a/service/mediapackage/api_op_ListOriginEndpoints.go +++ b/service/mediapackage/api_op_ListOriginEndpoints.go @@ -4,6 +4,7 @@ package mediapackage 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/mediapackage/types" @@ -109,6 +110,88 @@ func addOperationListOriginEndpointsMiddlewares(stack *middleware.Stack, options return nil } +// ListOriginEndpointsAPIClient is a client that implements the ListOriginEndpoints +// operation. +type ListOriginEndpointsAPIClient interface { + ListOriginEndpoints(context.Context, *ListOriginEndpointsInput, ...func(*Options)) (*ListOriginEndpointsOutput, error) +} + +var _ ListOriginEndpointsAPIClient = (*Client)(nil) + +// ListOriginEndpointsPaginatorOptions is the paginator options for +// ListOriginEndpoints +type ListOriginEndpointsPaginatorOptions struct { + // The upper bound on the number of records 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 +} + +// ListOriginEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackage.ListOriginEndpoints +type ListOriginEndpointsPaginator struct { + options ListOriginEndpointsPaginatorOptions + client ListOriginEndpointsAPIClient + params *ListOriginEndpointsInput + nextToken *string + firstPage bool +} + +// NewListOriginEndpointsPaginator returns a new ListOriginEndpointsPaginator +func NewListOriginEndpointsPaginator(client ListOriginEndpointsAPIClient, params *ListOriginEndpointsInput, optFns ...func(*ListOriginEndpointsPaginatorOptions)) *ListOriginEndpointsPaginator { + options := ListOriginEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOriginEndpointsInput{} + } + + return &ListOriginEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOriginEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOriginEndpoints page. +func (p *ListOriginEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOriginEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListOriginEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOriginEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackage/endpoints.go b/service/mediapackage/endpoints.go index aa5b44fb0a3..84a020ccc79 100644 --- a/service/mediapackage/endpoints.go +++ b/service/mediapackage/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediapackagevod/api_op_ListAssets.go b/service/mediapackagevod/api_op_ListAssets.go index a4b2f244d0b..b528840aa8b 100644 --- a/service/mediapackagevod/api_op_ListAssets.go +++ b/service/mediapackagevod/api_op_ListAssets.go @@ -4,6 +4,7 @@ package mediapackagevod 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/mediapackagevod/types" @@ -108,6 +109,86 @@ func addOperationListAssetsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListAssetsAPIClient is a client that implements the ListAssets operation. +type ListAssetsAPIClient interface { + ListAssets(context.Context, *ListAssetsInput, ...func(*Options)) (*ListAssetsOutput, error) +} + +var _ ListAssetsAPIClient = (*Client)(nil) + +// ListAssetsPaginatorOptions is the paginator options for ListAssets +type ListAssetsPaginatorOptions struct { + // Upper bound on number of records 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 +} + +// ListAssetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListAssets +type ListAssetsPaginator struct { + options ListAssetsPaginatorOptions + client ListAssetsAPIClient + params *ListAssetsInput + nextToken *string + firstPage bool +} + +// NewListAssetsPaginator returns a new ListAssetsPaginator +func NewListAssetsPaginator(client ListAssetsAPIClient, params *ListAssetsInput, optFns ...func(*ListAssetsPaginatorOptions)) *ListAssetsPaginator { + options := ListAssetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssetsInput{} + } + + return &ListAssetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssets page. +func (p *ListAssetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAssets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/api_op_ListPackagingConfigurations.go b/service/mediapackagevod/api_op_ListPackagingConfigurations.go index 2e8d389c116..1a6e52c7d99 100644 --- a/service/mediapackagevod/api_op_ListPackagingConfigurations.go +++ b/service/mediapackagevod/api_op_ListPackagingConfigurations.go @@ -4,6 +4,7 @@ package mediapackagevod 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/mediapackagevod/types" @@ -109,6 +110,89 @@ func addOperationListPackagingConfigurationsMiddlewares(stack *middleware.Stack, return nil } +// ListPackagingConfigurationsAPIClient is a client that implements the +// ListPackagingConfigurations operation. +type ListPackagingConfigurationsAPIClient interface { + ListPackagingConfigurations(context.Context, *ListPackagingConfigurationsInput, ...func(*Options)) (*ListPackagingConfigurationsOutput, error) +} + +var _ ListPackagingConfigurationsAPIClient = (*Client)(nil) + +// ListPackagingConfigurationsPaginatorOptions is the paginator options for +// ListPackagingConfigurations +type ListPackagingConfigurationsPaginatorOptions struct { + // Upper bound on number of records 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 +} + +// ListPackagingConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListPackagingConfigurations +type ListPackagingConfigurationsPaginator struct { + options ListPackagingConfigurationsPaginatorOptions + client ListPackagingConfigurationsAPIClient + params *ListPackagingConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListPackagingConfigurationsPaginator returns a new +// ListPackagingConfigurationsPaginator +func NewListPackagingConfigurationsPaginator(client ListPackagingConfigurationsAPIClient, params *ListPackagingConfigurationsInput, optFns ...func(*ListPackagingConfigurationsPaginatorOptions)) *ListPackagingConfigurationsPaginator { + options := ListPackagingConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagingConfigurationsInput{} + } + + return &ListPackagingConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagingConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackagingConfigurations page. +func (p *ListPackagingConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagingConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPackagingConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagingConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/api_op_ListPackagingGroups.go b/service/mediapackagevod/api_op_ListPackagingGroups.go index 28a270c62e0..53628f4d64b 100644 --- a/service/mediapackagevod/api_op_ListPackagingGroups.go +++ b/service/mediapackagevod/api_op_ListPackagingGroups.go @@ -4,6 +4,7 @@ package mediapackagevod 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/mediapackagevod/types" @@ -105,6 +106,88 @@ func addOperationListPackagingGroupsMiddlewares(stack *middleware.Stack, options return nil } +// ListPackagingGroupsAPIClient is a client that implements the ListPackagingGroups +// operation. +type ListPackagingGroupsAPIClient interface { + ListPackagingGroups(context.Context, *ListPackagingGroupsInput, ...func(*Options)) (*ListPackagingGroupsOutput, error) +} + +var _ ListPackagingGroupsAPIClient = (*Client)(nil) + +// ListPackagingGroupsPaginatorOptions is the paginator options for +// ListPackagingGroups +type ListPackagingGroupsPaginatorOptions struct { + // Upper bound on number of records 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 +} + +// ListPackagingGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediapackagevod.ListPackagingGroups +type ListPackagingGroupsPaginator struct { + options ListPackagingGroupsPaginatorOptions + client ListPackagingGroupsAPIClient + params *ListPackagingGroupsInput + nextToken *string + firstPage bool +} + +// NewListPackagingGroupsPaginator returns a new ListPackagingGroupsPaginator +func NewListPackagingGroupsPaginator(client ListPackagingGroupsAPIClient, params *ListPackagingGroupsInput, optFns ...func(*ListPackagingGroupsPaginatorOptions)) *ListPackagingGroupsPaginator { + options := ListPackagingGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPackagingGroupsInput{} + } + + return &ListPackagingGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPackagingGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPackagingGroups page. +func (p *ListPackagingGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPackagingGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListPackagingGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPackagingGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediapackagevod/endpoints.go b/service/mediapackagevod/endpoints.go index d1dae7e20d7..6b67d791333 100644 --- a/service/mediapackagevod/endpoints.go +++ b/service/mediapackagevod/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediastore/api_op_ListContainers.go b/service/mediastore/api_op_ListContainers.go index 550f8b82e31..35dfa29fcd6 100644 --- a/service/mediastore/api_op_ListContainers.go +++ b/service/mediastore/api_op_ListContainers.go @@ -4,6 +4,7 @@ package mediastore 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/mediastore/types" @@ -120,6 +121,88 @@ func addOperationListContainersMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListContainersAPIClient is a client that implements the ListContainers +// operation. +type ListContainersAPIClient interface { + ListContainers(context.Context, *ListContainersInput, ...func(*Options)) (*ListContainersOutput, error) +} + +var _ ListContainersAPIClient = (*Client)(nil) + +// ListContainersPaginatorOptions is the paginator options for ListContainers +type ListContainersPaginatorOptions struct { + // Enter the maximum number of containers in the response. Use from 1 to 255 + // characters. + 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 +} + +// ListContainersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mediastore.ListContainers +type ListContainersPaginator struct { + options ListContainersPaginatorOptions + client ListContainersAPIClient + params *ListContainersInput + nextToken *string + firstPage bool +} + +// NewListContainersPaginator returns a new ListContainersPaginator +func NewListContainersPaginator(client ListContainersAPIClient, params *ListContainersInput, optFns ...func(*ListContainersPaginatorOptions)) *ListContainersPaginator { + options := ListContainersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContainersInput{} + } + + return &ListContainersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContainersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContainers page. +func (p *ListContainersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContainersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListContainers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContainers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mediastore/endpoints.go b/service/mediastore/endpoints.go index de73f0359de..0f8d19948bb 100644 --- a/service/mediastore/endpoints.go +++ b/service/mediastore/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediastoredata/endpoints.go b/service/mediastoredata/endpoints.go index a4f347859b9..0f5644d92f7 100644 --- a/service/mediastoredata/endpoints.go +++ b/service/mediastoredata/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mediatailor/endpoints.go b/service/mediatailor/endpoints.go index de973961d42..41e170176c5 100644 --- a/service/mediatailor/endpoints.go +++ b/service/mediatailor/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/migrationhub/api_op_ListApplicationStates.go b/service/migrationhub/api_op_ListApplicationStates.go index 574278a7384..afcaf197712 100644 --- a/service/migrationhub/api_op_ListApplicationStates.go +++ b/service/migrationhub/api_op_ListApplicationStates.go @@ -4,6 +4,7 @@ package migrationhub 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/migrationhub/types" @@ -115,6 +116,88 @@ func addOperationListApplicationStatesMiddlewares(stack *middleware.Stack, optio return nil } +// ListApplicationStatesAPIClient is a client that implements the +// ListApplicationStates operation. +type ListApplicationStatesAPIClient interface { + ListApplicationStates(context.Context, *ListApplicationStatesInput, ...func(*Options)) (*ListApplicationStatesOutput, error) +} + +var _ ListApplicationStatesAPIClient = (*Client)(nil) + +// ListApplicationStatesPaginatorOptions is the paginator options for +// ListApplicationStates +type ListApplicationStatesPaginatorOptions struct { + // Maximum number of results to be returned per page. + 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 +} + +// ListApplicationStatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListApplicationStates +type ListApplicationStatesPaginator struct { + options ListApplicationStatesPaginatorOptions + client ListApplicationStatesAPIClient + params *ListApplicationStatesInput + nextToken *string + firstPage bool +} + +// NewListApplicationStatesPaginator returns a new ListApplicationStatesPaginator +func NewListApplicationStatesPaginator(client ListApplicationStatesAPIClient, params *ListApplicationStatesInput, optFns ...func(*ListApplicationStatesPaginatorOptions)) *ListApplicationStatesPaginator { + options := ListApplicationStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationStatesInput{} + } + + return &ListApplicationStatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationStatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplicationStates page. +func (p *ListApplicationStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationStatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListApplicationStates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListCreatedArtifacts.go b/service/migrationhub/api_op_ListCreatedArtifacts.go index 89c49211784..a395226bd8a 100644 --- a/service/migrationhub/api_op_ListCreatedArtifacts.go +++ b/service/migrationhub/api_op_ListCreatedArtifacts.go @@ -4,6 +4,7 @@ package migrationhub 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/migrationhub/types" @@ -133,6 +134,88 @@ func addOperationListCreatedArtifactsMiddlewares(stack *middleware.Stack, option return nil } +// ListCreatedArtifactsAPIClient is a client that implements the +// ListCreatedArtifacts operation. +type ListCreatedArtifactsAPIClient interface { + ListCreatedArtifacts(context.Context, *ListCreatedArtifactsInput, ...func(*Options)) (*ListCreatedArtifactsOutput, error) +} + +var _ ListCreatedArtifactsAPIClient = (*Client)(nil) + +// ListCreatedArtifactsPaginatorOptions is the paginator options for +// ListCreatedArtifacts +type ListCreatedArtifactsPaginatorOptions struct { + // Maximum number of results to be returned per page. + 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 +} + +// ListCreatedArtifactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListCreatedArtifacts +type ListCreatedArtifactsPaginator struct { + options ListCreatedArtifactsPaginatorOptions + client ListCreatedArtifactsAPIClient + params *ListCreatedArtifactsInput + nextToken *string + firstPage bool +} + +// NewListCreatedArtifactsPaginator returns a new ListCreatedArtifactsPaginator +func NewListCreatedArtifactsPaginator(client ListCreatedArtifactsAPIClient, params *ListCreatedArtifactsInput, optFns ...func(*ListCreatedArtifactsPaginatorOptions)) *ListCreatedArtifactsPaginator { + options := ListCreatedArtifactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCreatedArtifactsInput{} + } + + return &ListCreatedArtifactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCreatedArtifactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCreatedArtifacts page. +func (p *ListCreatedArtifactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreatedArtifactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCreatedArtifacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCreatedArtifacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListDiscoveredResources.go b/service/migrationhub/api_op_ListDiscoveredResources.go index 3922ae290c9..14a2bb07246 100644 --- a/service/migrationhub/api_op_ListDiscoveredResources.go +++ b/service/migrationhub/api_op_ListDiscoveredResources.go @@ -4,6 +4,7 @@ package migrationhub 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/migrationhub/types" @@ -121,6 +122,89 @@ func addOperationListDiscoveredResourcesMiddlewares(stack *middleware.Stack, opt return nil } +// ListDiscoveredResourcesAPIClient is a client that implements the +// ListDiscoveredResources operation. +type ListDiscoveredResourcesAPIClient interface { + ListDiscoveredResources(context.Context, *ListDiscoveredResourcesInput, ...func(*Options)) (*ListDiscoveredResourcesOutput, error) +} + +var _ ListDiscoveredResourcesAPIClient = (*Client)(nil) + +// ListDiscoveredResourcesPaginatorOptions is the paginator options for +// ListDiscoveredResources +type ListDiscoveredResourcesPaginatorOptions struct { + // The maximum number of results returned per page. + 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 +} + +// ListDiscoveredResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListDiscoveredResources +type ListDiscoveredResourcesPaginator struct { + options ListDiscoveredResourcesPaginatorOptions + client ListDiscoveredResourcesAPIClient + params *ListDiscoveredResourcesInput + nextToken *string + firstPage bool +} + +// NewListDiscoveredResourcesPaginator returns a new +// ListDiscoveredResourcesPaginator +func NewListDiscoveredResourcesPaginator(client ListDiscoveredResourcesAPIClient, params *ListDiscoveredResourcesInput, optFns ...func(*ListDiscoveredResourcesPaginatorOptions)) *ListDiscoveredResourcesPaginator { + options := ListDiscoveredResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDiscoveredResourcesInput{} + } + + return &ListDiscoveredResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDiscoveredResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDiscoveredResources page. +func (p *ListDiscoveredResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoveredResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDiscoveredResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDiscoveredResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListMigrationTasks.go b/service/migrationhub/api_op_ListMigrationTasks.go index 2f60e52ba5c..0cb11a70d3f 100644 --- a/service/migrationhub/api_op_ListMigrationTasks.go +++ b/service/migrationhub/api_op_ListMigrationTasks.go @@ -4,6 +4,7 @@ package migrationhub 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/migrationhub/types" @@ -123,6 +124,88 @@ func addOperationListMigrationTasksMiddlewares(stack *middleware.Stack, options return nil } +// ListMigrationTasksAPIClient is a client that implements the ListMigrationTasks +// operation. +type ListMigrationTasksAPIClient interface { + ListMigrationTasks(context.Context, *ListMigrationTasksInput, ...func(*Options)) (*ListMigrationTasksOutput, error) +} + +var _ ListMigrationTasksAPIClient = (*Client)(nil) + +// ListMigrationTasksPaginatorOptions is the paginator options for +// ListMigrationTasks +type ListMigrationTasksPaginatorOptions struct { + // Value to specify how many results are returned per page. + 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 +} + +// ListMigrationTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListMigrationTasks +type ListMigrationTasksPaginator struct { + options ListMigrationTasksPaginatorOptions + client ListMigrationTasksAPIClient + params *ListMigrationTasksInput + nextToken *string + firstPage bool +} + +// NewListMigrationTasksPaginator returns a new ListMigrationTasksPaginator +func NewListMigrationTasksPaginator(client ListMigrationTasksAPIClient, params *ListMigrationTasksInput, optFns ...func(*ListMigrationTasksPaginatorOptions)) *ListMigrationTasksPaginator { + options := ListMigrationTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMigrationTasksInput{} + } + + return &ListMigrationTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMigrationTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMigrationTasks page. +func (p *ListMigrationTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMigrationTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMigrationTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMigrationTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/api_op_ListProgressUpdateStreams.go b/service/migrationhub/api_op_ListProgressUpdateStreams.go index 1b9f9cd5507..b1bfe7a3701 100644 --- a/service/migrationhub/api_op_ListProgressUpdateStreams.go +++ b/service/migrationhub/api_op_ListProgressUpdateStreams.go @@ -4,6 +4,7 @@ package migrationhub 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/migrationhub/types" @@ -109,6 +110,89 @@ func addOperationListProgressUpdateStreamsMiddlewares(stack *middleware.Stack, o return nil } +// ListProgressUpdateStreamsAPIClient is a client that implements the +// ListProgressUpdateStreams operation. +type ListProgressUpdateStreamsAPIClient interface { + ListProgressUpdateStreams(context.Context, *ListProgressUpdateStreamsInput, ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) +} + +var _ ListProgressUpdateStreamsAPIClient = (*Client)(nil) + +// ListProgressUpdateStreamsPaginatorOptions is the paginator options for +// ListProgressUpdateStreams +type ListProgressUpdateStreamsPaginatorOptions struct { + // Filter to limit the maximum number of results to list per page. + 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 +} + +// ListProgressUpdateStreamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhub.ListProgressUpdateStreams +type ListProgressUpdateStreamsPaginator struct { + options ListProgressUpdateStreamsPaginatorOptions + client ListProgressUpdateStreamsAPIClient + params *ListProgressUpdateStreamsInput + nextToken *string + firstPage bool +} + +// NewListProgressUpdateStreamsPaginator returns a new +// ListProgressUpdateStreamsPaginator +func NewListProgressUpdateStreamsPaginator(client ListProgressUpdateStreamsAPIClient, params *ListProgressUpdateStreamsInput, optFns ...func(*ListProgressUpdateStreamsPaginatorOptions)) *ListProgressUpdateStreamsPaginator { + options := ListProgressUpdateStreamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProgressUpdateStreamsInput{} + } + + return &ListProgressUpdateStreamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProgressUpdateStreamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProgressUpdateStreams page. +func (p *ListProgressUpdateStreamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProgressUpdateStreamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProgressUpdateStreams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProgressUpdateStreams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhub/endpoints.go b/service/migrationhub/endpoints.go index 0e2054952ad..79293fa4c30 100644 --- a/service/migrationhub/endpoints.go +++ b/service/migrationhub/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go b/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go index 2496eb6b2a8..0488a190527 100644 --- a/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go +++ b/service/migrationhubconfig/api_op_DescribeHomeRegionControls.go @@ -4,6 +4,7 @@ package migrationhubconfig 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/migrationhubconfig/types" @@ -123,6 +124,89 @@ func addOperationDescribeHomeRegionControlsMiddlewares(stack *middleware.Stack, return nil } +// DescribeHomeRegionControlsAPIClient is a client that implements the +// DescribeHomeRegionControls operation. +type DescribeHomeRegionControlsAPIClient interface { + DescribeHomeRegionControls(context.Context, *DescribeHomeRegionControlsInput, ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) +} + +var _ DescribeHomeRegionControlsAPIClient = (*Client)(nil) + +// DescribeHomeRegionControlsPaginatorOptions is the paginator options for +// DescribeHomeRegionControls +type DescribeHomeRegionControlsPaginatorOptions struct { + // The maximum number of filtering results to display per page. + 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 +} + +// DescribeHomeRegionControlsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/migrationhubconfig.DescribeHomeRegionControls +type DescribeHomeRegionControlsPaginator struct { + options DescribeHomeRegionControlsPaginatorOptions + client DescribeHomeRegionControlsAPIClient + params *DescribeHomeRegionControlsInput + nextToken *string + firstPage bool +} + +// NewDescribeHomeRegionControlsPaginator returns a new +// DescribeHomeRegionControlsPaginator +func NewDescribeHomeRegionControlsPaginator(client DescribeHomeRegionControlsAPIClient, params *DescribeHomeRegionControlsInput, optFns ...func(*DescribeHomeRegionControlsPaginatorOptions)) *DescribeHomeRegionControlsPaginator { + options := DescribeHomeRegionControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHomeRegionControlsInput{} + } + + return &DescribeHomeRegionControlsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHomeRegionControlsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHomeRegionControls page. +func (p *DescribeHomeRegionControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHomeRegionControlsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeHomeRegionControls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHomeRegionControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/migrationhubconfig/endpoints.go b/service/migrationhubconfig/endpoints.go index ef7213a1e3c..49e18231c51 100644 --- a/service/migrationhubconfig/endpoints.go +++ b/service/migrationhubconfig/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mobile/api_op_ListBundles.go b/service/mobile/api_op_ListBundles.go index 1f458543595..33c0c213b4e 100644 --- a/service/mobile/api_op_ListBundles.go +++ b/service/mobile/api_op_ListBundles.go @@ -4,6 +4,7 @@ package mobile 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/mobile/types" @@ -110,6 +111,86 @@ func addOperationListBundlesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListBundlesAPIClient is a client that implements the ListBundles operation. +type ListBundlesAPIClient interface { + ListBundles(context.Context, *ListBundlesInput, ...func(*Options)) (*ListBundlesOutput, error) +} + +var _ ListBundlesAPIClient = (*Client)(nil) + +// ListBundlesPaginatorOptions is the paginator options for ListBundles +type ListBundlesPaginatorOptions struct { + // Maximum number of records to list in a single response. + 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 +} + +// ListBundlesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mobile.ListBundles +type ListBundlesPaginator struct { + options ListBundlesPaginatorOptions + client ListBundlesAPIClient + params *ListBundlesInput + nextToken *string + firstPage bool +} + +// NewListBundlesPaginator returns a new ListBundlesPaginator +func NewListBundlesPaginator(client ListBundlesAPIClient, params *ListBundlesInput, optFns ...func(*ListBundlesPaginatorOptions)) *ListBundlesPaginator { + options := ListBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBundlesInput{} + } + + return &ListBundlesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBundlesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBundles page. +func (p *ListBundlesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBundlesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListBundles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBundles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mobile/api_op_ListProjects.go b/service/mobile/api_op_ListProjects.go index 4ffdcf1c9b9..0ba6ce196ad 100644 --- a/service/mobile/api_op_ListProjects.go +++ b/service/mobile/api_op_ListProjects.go @@ -4,6 +4,7 @@ package mobile 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/mobile/types" @@ -111,6 +112,86 @@ func addOperationListProjectsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListProjectsAPIClient is a client that implements the ListProjects operation. +type ListProjectsAPIClient interface { + ListProjects(context.Context, *ListProjectsInput, ...func(*Options)) (*ListProjectsOutput, error) +} + +var _ ListProjectsAPIClient = (*Client)(nil) + +// ListProjectsPaginatorOptions is the paginator options for ListProjects +type ListProjectsPaginatorOptions struct { + // Maximum number of records to list in a single response. + 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 +} + +// ListProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mobile.ListProjects +type ListProjectsPaginator struct { + options ListProjectsPaginatorOptions + client ListProjectsAPIClient + params *ListProjectsInput + nextToken *string + firstPage bool +} + +// NewListProjectsPaginator returns a new ListProjectsPaginator +func NewListProjectsPaginator(client ListProjectsAPIClient, params *ListProjectsInput, optFns ...func(*ListProjectsPaginatorOptions)) *ListProjectsPaginator { + options := ListProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProjectsInput{} + } + + return &ListProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProjects page. +func (p *ListProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mobile/endpoints.go b/service/mobile/endpoints.go index cee17ef3e66..cfc1bac70c8 100644 --- a/service/mobile/endpoints.go +++ b/service/mobile/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mq/api_op_ListBrokers.go b/service/mq/api_op_ListBrokers.go index 8e9a5d1bcd3..35ce2e9a0f8 100644 --- a/service/mq/api_op_ListBrokers.go +++ b/service/mq/api_op_ListBrokers.go @@ -4,6 +4,7 @@ package mq 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/mq/types" @@ -108,6 +109,87 @@ func addOperationListBrokersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListBrokersAPIClient is a client that implements the ListBrokers operation. +type ListBrokersAPIClient interface { + ListBrokers(context.Context, *ListBrokersInput, ...func(*Options)) (*ListBrokersOutput, error) +} + +var _ ListBrokersAPIClient = (*Client)(nil) + +// ListBrokersPaginatorOptions is the paginator options for ListBrokers +type ListBrokersPaginatorOptions struct { + // The maximum number of brokers that Amazon MQ can return per page (20 by + // default). This value must be an integer from 5 to 100. + 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 +} + +// ListBrokersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mq.ListBrokers +type ListBrokersPaginator struct { + options ListBrokersPaginatorOptions + client ListBrokersAPIClient + params *ListBrokersInput + nextToken *string + firstPage bool +} + +// NewListBrokersPaginator returns a new ListBrokersPaginator +func NewListBrokersPaginator(client ListBrokersAPIClient, params *ListBrokersInput, optFns ...func(*ListBrokersPaginatorOptions)) *ListBrokersPaginator { + options := ListBrokersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBrokersInput{} + } + + return &ListBrokersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBrokersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBrokers page. +func (p *ListBrokersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBrokersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListBrokers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBrokers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mq/endpoints.go b/service/mq/endpoints.go index b718cc03b65..f5f964d972a 100644 --- a/service/mq/endpoints.go +++ b/service/mq/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/mturk/api_op_ListAssignmentsForHIT.go b/service/mturk/api_op_ListAssignmentsForHIT.go index c89b8da2500..7c1cd32f5d7 100644 --- a/service/mturk/api_op_ListAssignmentsForHIT.go +++ b/service/mturk/api_op_ListAssignmentsForHIT.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -134,6 +135,87 @@ func addOperationListAssignmentsForHITMiddlewares(stack *middleware.Stack, optio return nil } +// ListAssignmentsForHITAPIClient is a client that implements the +// ListAssignmentsForHIT operation. +type ListAssignmentsForHITAPIClient interface { + ListAssignmentsForHIT(context.Context, *ListAssignmentsForHITInput, ...func(*Options)) (*ListAssignmentsForHITOutput, error) +} + +var _ ListAssignmentsForHITAPIClient = (*Client)(nil) + +// ListAssignmentsForHITPaginatorOptions is the paginator options for +// ListAssignmentsForHIT +type ListAssignmentsForHITPaginatorOptions struct { + 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 +} + +// ListAssignmentsForHITPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListAssignmentsForHIT +type ListAssignmentsForHITPaginator struct { + options ListAssignmentsForHITPaginatorOptions + client ListAssignmentsForHITAPIClient + params *ListAssignmentsForHITInput + nextToken *string + firstPage bool +} + +// NewListAssignmentsForHITPaginator returns a new ListAssignmentsForHITPaginator +func NewListAssignmentsForHITPaginator(client ListAssignmentsForHITAPIClient, params *ListAssignmentsForHITInput, optFns ...func(*ListAssignmentsForHITPaginatorOptions)) *ListAssignmentsForHITPaginator { + options := ListAssignmentsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssignmentsForHITInput{} + } + + return &ListAssignmentsForHITPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssignmentsForHITPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssignmentsForHIT page. +func (p *ListAssignmentsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssignmentsForHITOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAssignmentsForHIT(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssignmentsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListBonusPayments.go b/service/mturk/api_op_ListBonusPayments.go index d51fc342038..72571426f7c 100644 --- a/service/mturk/api_op_ListBonusPayments.go +++ b/service/mturk/api_op_ListBonusPayments.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -123,6 +124,86 @@ func addOperationListBonusPaymentsMiddlewares(stack *middleware.Stack, options O return nil } +// ListBonusPaymentsAPIClient is a client that implements the ListBonusPayments +// operation. +type ListBonusPaymentsAPIClient interface { + ListBonusPayments(context.Context, *ListBonusPaymentsInput, ...func(*Options)) (*ListBonusPaymentsOutput, error) +} + +var _ ListBonusPaymentsAPIClient = (*Client)(nil) + +// ListBonusPaymentsPaginatorOptions is the paginator options for ListBonusPayments +type ListBonusPaymentsPaginatorOptions struct { + 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 +} + +// ListBonusPaymentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListBonusPayments +type ListBonusPaymentsPaginator struct { + options ListBonusPaymentsPaginatorOptions + client ListBonusPaymentsAPIClient + params *ListBonusPaymentsInput + nextToken *string + firstPage bool +} + +// NewListBonusPaymentsPaginator returns a new ListBonusPaymentsPaginator +func NewListBonusPaymentsPaginator(client ListBonusPaymentsAPIClient, params *ListBonusPaymentsInput, optFns ...func(*ListBonusPaymentsPaginatorOptions)) *ListBonusPaymentsPaginator { + options := ListBonusPaymentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBonusPaymentsInput{} + } + + return &ListBonusPaymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBonusPaymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBonusPayments page. +func (p *ListBonusPaymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBonusPaymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBonusPayments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBonusPayments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListHITs.go b/service/mturk/api_op_ListHITs.go index de6b27eda71..73591b5d317 100644 --- a/service/mturk/api_op_ListHITs.go +++ b/service/mturk/api_op_ListHITs.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -111,6 +112,85 @@ func addOperationListHITsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListHITsAPIClient is a client that implements the ListHITs operation. +type ListHITsAPIClient interface { + ListHITs(context.Context, *ListHITsInput, ...func(*Options)) (*ListHITsOutput, error) +} + +var _ ListHITsAPIClient = (*Client)(nil) + +// ListHITsPaginatorOptions is the paginator options for ListHITs +type ListHITsPaginatorOptions struct { + 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 +} + +// ListHITsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListHITs +type ListHITsPaginator struct { + options ListHITsPaginatorOptions + client ListHITsAPIClient + params *ListHITsInput + nextToken *string + firstPage bool +} + +// NewListHITsPaginator returns a new ListHITsPaginator +func NewListHITsPaginator(client ListHITsAPIClient, params *ListHITsInput, optFns ...func(*ListHITsPaginatorOptions)) *ListHITsPaginator { + options := ListHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHITsInput{} + } + + return &ListHITsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHITsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHITs page. +func (p *ListHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHITs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListHITsForQualificationType.go b/service/mturk/api_op_ListHITsForQualificationType.go index 88d59c2f2b9..2b7f2200dae 100644 --- a/service/mturk/api_op_ListHITsForQualificationType.go +++ b/service/mturk/api_op_ListHITsForQualificationType.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -122,6 +123,89 @@ func addOperationListHITsForQualificationTypeMiddlewares(stack *middleware.Stack return nil } +// ListHITsForQualificationTypeAPIClient is a client that implements the +// ListHITsForQualificationType operation. +type ListHITsForQualificationTypeAPIClient interface { + ListHITsForQualificationType(context.Context, *ListHITsForQualificationTypeInput, ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) +} + +var _ ListHITsForQualificationTypeAPIClient = (*Client)(nil) + +// ListHITsForQualificationTypePaginatorOptions is the paginator options for +// ListHITsForQualificationType +type ListHITsForQualificationTypePaginatorOptions struct { + // Limit the number of results returned. + 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 +} + +// ListHITsForQualificationTypePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListHITsForQualificationType +type ListHITsForQualificationTypePaginator struct { + options ListHITsForQualificationTypePaginatorOptions + client ListHITsForQualificationTypeAPIClient + params *ListHITsForQualificationTypeInput + nextToken *string + firstPage bool +} + +// NewListHITsForQualificationTypePaginator returns a new +// ListHITsForQualificationTypePaginator +func NewListHITsForQualificationTypePaginator(client ListHITsForQualificationTypeAPIClient, params *ListHITsForQualificationTypeInput, optFns ...func(*ListHITsForQualificationTypePaginatorOptions)) *ListHITsForQualificationTypePaginator { + options := ListHITsForQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHITsForQualificationTypeInput{} + } + + return &ListHITsForQualificationTypePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHITsForQualificationTypePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHITsForQualificationType page. +func (p *ListHITsForQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHITsForQualificationTypeOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHITsForQualificationType(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHITsForQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListQualificationRequests.go b/service/mturk/api_op_ListQualificationRequests.go index b5e4f7b009f..0671806c5ce 100644 --- a/service/mturk/api_op_ListQualificationRequests.go +++ b/service/mturk/api_op_ListQualificationRequests.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -120,6 +121,89 @@ func addOperationListQualificationRequestsMiddlewares(stack *middleware.Stack, o return nil } +// ListQualificationRequestsAPIClient is a client that implements the +// ListQualificationRequests operation. +type ListQualificationRequestsAPIClient interface { + ListQualificationRequests(context.Context, *ListQualificationRequestsInput, ...func(*Options)) (*ListQualificationRequestsOutput, error) +} + +var _ ListQualificationRequestsAPIClient = (*Client)(nil) + +// ListQualificationRequestsPaginatorOptions is the paginator options for +// ListQualificationRequests +type ListQualificationRequestsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListQualificationRequestsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListQualificationRequests +type ListQualificationRequestsPaginator struct { + options ListQualificationRequestsPaginatorOptions + client ListQualificationRequestsAPIClient + params *ListQualificationRequestsInput + nextToken *string + firstPage bool +} + +// NewListQualificationRequestsPaginator returns a new +// ListQualificationRequestsPaginator +func NewListQualificationRequestsPaginator(client ListQualificationRequestsAPIClient, params *ListQualificationRequestsInput, optFns ...func(*ListQualificationRequestsPaginatorOptions)) *ListQualificationRequestsPaginator { + options := ListQualificationRequestsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQualificationRequestsInput{} + } + + return &ListQualificationRequestsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQualificationRequestsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQualificationRequests page. +func (p *ListQualificationRequestsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationRequestsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListQualificationRequests(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQualificationRequests(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListQualificationTypes.go b/service/mturk/api_op_ListQualificationTypes.go index 5f67f5f44fc..12b5b47b7df 100644 --- a/service/mturk/api_op_ListQualificationTypes.go +++ b/service/mturk/api_op_ListQualificationTypes.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -134,6 +135,88 @@ func addOperationListQualificationTypesMiddlewares(stack *middleware.Stack, opti return nil } +// ListQualificationTypesAPIClient is a client that implements the +// ListQualificationTypes operation. +type ListQualificationTypesAPIClient interface { + ListQualificationTypes(context.Context, *ListQualificationTypesInput, ...func(*Options)) (*ListQualificationTypesOutput, error) +} + +var _ ListQualificationTypesAPIClient = (*Client)(nil) + +// ListQualificationTypesPaginatorOptions is the paginator options for +// ListQualificationTypes +type ListQualificationTypesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListQualificationTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListQualificationTypes +type ListQualificationTypesPaginator struct { + options ListQualificationTypesPaginatorOptions + client ListQualificationTypesAPIClient + params *ListQualificationTypesInput + nextToken *string + firstPage bool +} + +// NewListQualificationTypesPaginator returns a new ListQualificationTypesPaginator +func NewListQualificationTypesPaginator(client ListQualificationTypesAPIClient, params *ListQualificationTypesInput, optFns ...func(*ListQualificationTypesPaginatorOptions)) *ListQualificationTypesPaginator { + options := ListQualificationTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQualificationTypesInput{} + } + + return &ListQualificationTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQualificationTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQualificationTypes page. +func (p *ListQualificationTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQualificationTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListQualificationTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQualificationTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListReviewPolicyResultsForHIT.go b/service/mturk/api_op_ListReviewPolicyResultsForHIT.go index 5ce61841b8d..e2a7e9b81ee 100644 --- a/service/mturk/api_op_ListReviewPolicyResultsForHIT.go +++ b/service/mturk/api_op_ListReviewPolicyResultsForHIT.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -146,6 +147,89 @@ func addOperationListReviewPolicyResultsForHITMiddlewares(stack *middleware.Stac return nil } +// ListReviewPolicyResultsForHITAPIClient is a client that implements the +// ListReviewPolicyResultsForHIT operation. +type ListReviewPolicyResultsForHITAPIClient interface { + ListReviewPolicyResultsForHIT(context.Context, *ListReviewPolicyResultsForHITInput, ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) +} + +var _ ListReviewPolicyResultsForHITAPIClient = (*Client)(nil) + +// ListReviewPolicyResultsForHITPaginatorOptions is the paginator options for +// ListReviewPolicyResultsForHIT +type ListReviewPolicyResultsForHITPaginatorOptions struct { + // Limit the number of results returned. + 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 +} + +// ListReviewPolicyResultsForHITPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListReviewPolicyResultsForHIT +type ListReviewPolicyResultsForHITPaginator struct { + options ListReviewPolicyResultsForHITPaginatorOptions + client ListReviewPolicyResultsForHITAPIClient + params *ListReviewPolicyResultsForHITInput + nextToken *string + firstPage bool +} + +// NewListReviewPolicyResultsForHITPaginator returns a new +// ListReviewPolicyResultsForHITPaginator +func NewListReviewPolicyResultsForHITPaginator(client ListReviewPolicyResultsForHITAPIClient, params *ListReviewPolicyResultsForHITInput, optFns ...func(*ListReviewPolicyResultsForHITPaginatorOptions)) *ListReviewPolicyResultsForHITPaginator { + options := ListReviewPolicyResultsForHITPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReviewPolicyResultsForHITInput{} + } + + return &ListReviewPolicyResultsForHITPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewPolicyResultsForHITPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReviewPolicyResultsForHIT page. +func (p *ListReviewPolicyResultsForHITPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewPolicyResultsForHITOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListReviewPolicyResultsForHIT(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReviewPolicyResultsForHIT(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListReviewableHITs.go b/service/mturk/api_op_ListReviewableHITs.go index 3c7e35c1738..a7d937f05a4 100644 --- a/service/mturk/api_op_ListReviewableHITs.go +++ b/service/mturk/api_op_ListReviewableHITs.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -120,6 +121,88 @@ func addOperationListReviewableHITsMiddlewares(stack *middleware.Stack, options return nil } +// ListReviewableHITsAPIClient is a client that implements the ListReviewableHITs +// operation. +type ListReviewableHITsAPIClient interface { + ListReviewableHITs(context.Context, *ListReviewableHITsInput, ...func(*Options)) (*ListReviewableHITsOutput, error) +} + +var _ ListReviewableHITsAPIClient = (*Client)(nil) + +// ListReviewableHITsPaginatorOptions is the paginator options for +// ListReviewableHITs +type ListReviewableHITsPaginatorOptions struct { + // Limit the number of results returned. + 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 +} + +// ListReviewableHITsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListReviewableHITs +type ListReviewableHITsPaginator struct { + options ListReviewableHITsPaginatorOptions + client ListReviewableHITsAPIClient + params *ListReviewableHITsInput + nextToken *string + firstPage bool +} + +// NewListReviewableHITsPaginator returns a new ListReviewableHITsPaginator +func NewListReviewableHITsPaginator(client ListReviewableHITsAPIClient, params *ListReviewableHITsInput, optFns ...func(*ListReviewableHITsPaginatorOptions)) *ListReviewableHITsPaginator { + options := ListReviewableHITsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListReviewableHITsInput{} + } + + return &ListReviewableHITsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListReviewableHITsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListReviewableHITs page. +func (p *ListReviewableHITsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListReviewableHITsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListReviewableHITs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListReviewableHITs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListWorkerBlocks.go b/service/mturk/api_op_ListWorkerBlocks.go index 7b1d941fecc..8901424452a 100644 --- a/service/mturk/api_op_ListWorkerBlocks.go +++ b/service/mturk/api_op_ListWorkerBlocks.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -111,6 +112,86 @@ func addOperationListWorkerBlocksMiddlewares(stack *middleware.Stack, options Op return nil } +// ListWorkerBlocksAPIClient is a client that implements the ListWorkerBlocks +// operation. +type ListWorkerBlocksAPIClient interface { + ListWorkerBlocks(context.Context, *ListWorkerBlocksInput, ...func(*Options)) (*ListWorkerBlocksOutput, error) +} + +var _ ListWorkerBlocksAPIClient = (*Client)(nil) + +// ListWorkerBlocksPaginatorOptions is the paginator options for ListWorkerBlocks +type ListWorkerBlocksPaginatorOptions struct { + 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 +} + +// ListWorkerBlocksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListWorkerBlocks +type ListWorkerBlocksPaginator struct { + options ListWorkerBlocksPaginatorOptions + client ListWorkerBlocksAPIClient + params *ListWorkerBlocksInput + nextToken *string + firstPage bool +} + +// NewListWorkerBlocksPaginator returns a new ListWorkerBlocksPaginator +func NewListWorkerBlocksPaginator(client ListWorkerBlocksAPIClient, params *ListWorkerBlocksInput, optFns ...func(*ListWorkerBlocksPaginatorOptions)) *ListWorkerBlocksPaginator { + options := ListWorkerBlocksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkerBlocksInput{} + } + + return &ListWorkerBlocksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkerBlocksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkerBlocks page. +func (p *ListWorkerBlocksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerBlocksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkerBlocks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkerBlocks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/api_op_ListWorkersWithQualificationType.go b/service/mturk/api_op_ListWorkersWithQualificationType.go index 431fd06806c..cbd5701f262 100644 --- a/service/mturk/api_op_ListWorkersWithQualificationType.go +++ b/service/mturk/api_op_ListWorkersWithQualificationType.go @@ -4,6 +4,7 @@ package mturk 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/mturk/types" @@ -123,6 +124,89 @@ func addOperationListWorkersWithQualificationTypeMiddlewares(stack *middleware.S return nil } +// ListWorkersWithQualificationTypeAPIClient is a client that implements the +// ListWorkersWithQualificationType operation. +type ListWorkersWithQualificationTypeAPIClient interface { + ListWorkersWithQualificationType(context.Context, *ListWorkersWithQualificationTypeInput, ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) +} + +var _ ListWorkersWithQualificationTypeAPIClient = (*Client)(nil) + +// ListWorkersWithQualificationTypePaginatorOptions is the paginator options for +// ListWorkersWithQualificationType +type ListWorkersWithQualificationTypePaginatorOptions struct { + // Limit the number of results returned. + 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 +} + +// ListWorkersWithQualificationTypePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/mturk.ListWorkersWithQualificationType +type ListWorkersWithQualificationTypePaginator struct { + options ListWorkersWithQualificationTypePaginatorOptions + client ListWorkersWithQualificationTypeAPIClient + params *ListWorkersWithQualificationTypeInput + nextToken *string + firstPage bool +} + +// NewListWorkersWithQualificationTypePaginator returns a new +// ListWorkersWithQualificationTypePaginator +func NewListWorkersWithQualificationTypePaginator(client ListWorkersWithQualificationTypeAPIClient, params *ListWorkersWithQualificationTypeInput, optFns ...func(*ListWorkersWithQualificationTypePaginatorOptions)) *ListWorkersWithQualificationTypePaginator { + options := ListWorkersWithQualificationTypePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkersWithQualificationTypeInput{} + } + + return &ListWorkersWithQualificationTypePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkersWithQualificationTypePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkersWithQualificationType page. +func (p *ListWorkersWithQualificationTypePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkersWithQualificationTypeOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkersWithQualificationType(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkersWithQualificationType(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/mturk/endpoints.go b/service/mturk/endpoints.go index 5bc458b040d..0b02af524ce 100644 --- a/service/mturk/endpoints.go +++ b/service/mturk/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/neptune/api_op_DescribeDBClusterEndpoints.go b/service/neptune/api_op_DescribeDBClusterEndpoints.go index b969de539cb..eb61c0ca5ce 100644 --- a/service/neptune/api_op_DescribeDBClusterEndpoints.go +++ b/service/neptune/api_op_DescribeDBClusterEndpoints.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -137,6 +138,92 @@ func addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterEndpointsAPIClient is a client that implements the +// DescribeDBClusterEndpoints operation. +type DescribeDBClusterEndpointsAPIClient interface { + DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) +} + +var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) + +// DescribeDBClusterEndpointsPaginatorOptions is the paginator options for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginator struct { + options DescribeDBClusterEndpointsPaginatorOptions + client DescribeDBClusterEndpointsAPIClient + params *DescribeDBClusterEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + return &DescribeDBClusterEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterEndpoints page. +func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBEngineVersions.go b/service/neptune/api_op_DescribeDBEngineVersions.go index 140edca47b8..06c298653f9 100644 --- a/service/neptune/api_op_DescribeDBEngineVersions.go +++ b/service/neptune/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -144,6 +145,92 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so that the following results can be retrieved. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBInstances.go b/service/neptune/api_op_DescribeDBInstances.go index 6bb946e24dc..79364fc59db 100644 --- a/service/neptune/api_op_DescribeDBInstances.go +++ b/service/neptune/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -141,6 +142,91 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBParameterGroups.go b/service/neptune/api_op_DescribeDBParameterGroups.go index cf4b290ae08..e8ca5b4959e 100644 --- a/service/neptune/api_op_DescribeDBParameterGroups.go +++ b/service/neptune/api_op_DescribeDBParameterGroups.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -126,6 +127,92 @@ func addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeDBParameterGroupsAPIClient is a client that implements the +// DescribeDBParameterGroups operation. +type DescribeDBParameterGroupsAPIClient interface { + DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) +} + +var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginator struct { + options DescribeDBParameterGroupsPaginatorOptions + client DescribeDBParameterGroupsAPIClient + params *DescribeDBParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + return &DescribeDBParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBParameterGroups page. +func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBParameters.go b/service/neptune/api_op_DescribeDBParameters.go index b3d91939351..b327a23e50f 100644 --- a/service/neptune/api_op_DescribeDBParameters.go +++ b/service/neptune/api_op_DescribeDBParameters.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -130,6 +131,91 @@ func addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, option return nil } +// DescribeDBParametersAPIClient is a client that implements the +// DescribeDBParameters operation. +type DescribeDBParametersAPIClient interface { + DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) +} + +var _ DescribeDBParametersAPIClient = (*Client)(nil) + +// DescribeDBParametersPaginatorOptions is the paginator options for +// DescribeDBParameters +type DescribeDBParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBParameters +type DescribeDBParametersPaginator struct { + options DescribeDBParametersPaginatorOptions + client DescribeDBParametersAPIClient + params *DescribeDBParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParametersInput{} + } + + return &DescribeDBParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBParameters page. +func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeDBSubnetGroups.go b/service/neptune/api_op_DescribeDBSubnetGroups.go index ddc6c19a5d9..6251bc90a05 100644 --- a/service/neptune/api_op_DescribeDBSubnetGroups.go +++ b/service/neptune/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -124,6 +125,91 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEngineDefaultParameters.go b/service/neptune/api_op_DescribeEngineDefaultParameters.go index 396ddd1616d..748e53f2be2 100644 --- a/service/neptune/api_op_DescribeEngineDefaultParameters.go +++ b/service/neptune/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -121,6 +122,94 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return nil } +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEventSubscriptions.go b/service/neptune/api_op_DescribeEventSubscriptions.go index fa1d2030bcc..cdc2ea09851 100644 --- a/service/neptune/api_op_DescribeEventSubscriptions.go +++ b/service/neptune/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -126,6 +127,92 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeEvents.go b/service/neptune/api_op_DescribeEvents.go index ef8b177c23e..52e31e4df2a 100644 --- a/service/neptune/api_op_DescribeEvents.go +++ b/service/neptune/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -166,6 +167,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go b/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go index c0707b043df..03d63b02fb5 100644 --- a/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/neptune/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package neptune 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/neptune/types" @@ -141,6 +142,92 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return nil } +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/neptune.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/neptune/endpoints.go b/service/neptune/endpoints.go index 8ce932deadd..73883a97750 100644 --- a/service/neptune/endpoints.go +++ b/service/neptune/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/networkmanager/api_op_DescribeGlobalNetworks.go b/service/networkmanager/api_op_DescribeGlobalNetworks.go index f73abb40f99..acfd827c3b1 100644 --- a/service/networkmanager/api_op_DescribeGlobalNetworks.go +++ b/service/networkmanager/api_op_DescribeGlobalNetworks.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -111,6 +112,88 @@ func addOperationDescribeGlobalNetworksMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeGlobalNetworksAPIClient is a client that implements the +// DescribeGlobalNetworks operation. +type DescribeGlobalNetworksAPIClient interface { + DescribeGlobalNetworks(context.Context, *DescribeGlobalNetworksInput, ...func(*Options)) (*DescribeGlobalNetworksOutput, error) +} + +var _ DescribeGlobalNetworksAPIClient = (*Client)(nil) + +// DescribeGlobalNetworksPaginatorOptions is the paginator options for +// DescribeGlobalNetworks +type DescribeGlobalNetworksPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeGlobalNetworksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.DescribeGlobalNetworks +type DescribeGlobalNetworksPaginator struct { + options DescribeGlobalNetworksPaginatorOptions + client DescribeGlobalNetworksAPIClient + params *DescribeGlobalNetworksInput + nextToken *string + firstPage bool +} + +// NewDescribeGlobalNetworksPaginator returns a new DescribeGlobalNetworksPaginator +func NewDescribeGlobalNetworksPaginator(client DescribeGlobalNetworksAPIClient, params *DescribeGlobalNetworksInput, optFns ...func(*DescribeGlobalNetworksPaginatorOptions)) *DescribeGlobalNetworksPaginator { + options := DescribeGlobalNetworksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalNetworksInput{} + } + + return &DescribeGlobalNetworksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalNetworksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGlobalNetworks page. +func (p *DescribeGlobalNetworksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalNetworksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeGlobalNetworks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalNetworks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetCustomerGatewayAssociations.go b/service/networkmanager/api_op_GetCustomerGatewayAssociations.go index 18b96224d57..3a1b23c8a92 100644 --- a/service/networkmanager/api_op_GetCustomerGatewayAssociations.go +++ b/service/networkmanager/api_op_GetCustomerGatewayAssociations.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -120,6 +121,89 @@ func addOperationGetCustomerGatewayAssociationsMiddlewares(stack *middleware.Sta return nil } +// GetCustomerGatewayAssociationsAPIClient is a client that implements the +// GetCustomerGatewayAssociations operation. +type GetCustomerGatewayAssociationsAPIClient interface { + GetCustomerGatewayAssociations(context.Context, *GetCustomerGatewayAssociationsInput, ...func(*Options)) (*GetCustomerGatewayAssociationsOutput, error) +} + +var _ GetCustomerGatewayAssociationsAPIClient = (*Client)(nil) + +// GetCustomerGatewayAssociationsPaginatorOptions is the paginator options for +// GetCustomerGatewayAssociations +type GetCustomerGatewayAssociationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetCustomerGatewayAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetCustomerGatewayAssociations +type GetCustomerGatewayAssociationsPaginator struct { + options GetCustomerGatewayAssociationsPaginatorOptions + client GetCustomerGatewayAssociationsAPIClient + params *GetCustomerGatewayAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetCustomerGatewayAssociationsPaginator returns a new +// GetCustomerGatewayAssociationsPaginator +func NewGetCustomerGatewayAssociationsPaginator(client GetCustomerGatewayAssociationsAPIClient, params *GetCustomerGatewayAssociationsInput, optFns ...func(*GetCustomerGatewayAssociationsPaginatorOptions)) *GetCustomerGatewayAssociationsPaginator { + options := GetCustomerGatewayAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCustomerGatewayAssociationsInput{} + } + + return &GetCustomerGatewayAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCustomerGatewayAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCustomerGatewayAssociations page. +func (p *GetCustomerGatewayAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCustomerGatewayAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCustomerGatewayAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCustomerGatewayAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetDevices.go b/service/networkmanager/api_op_GetDevices.go index cf4f429bd2c..0102c1ef36c 100644 --- a/service/networkmanager/api_op_GetDevices.go +++ b/service/networkmanager/api_op_GetDevices.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -119,6 +120,86 @@ func addOperationGetDevicesMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetDevicesAPIClient is a client that implements the GetDevices operation. +type GetDevicesAPIClient interface { + GetDevices(context.Context, *GetDevicesInput, ...func(*Options)) (*GetDevicesOutput, error) +} + +var _ GetDevicesAPIClient = (*Client)(nil) + +// GetDevicesPaginatorOptions is the paginator options for GetDevices +type GetDevicesPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetDevices +type GetDevicesPaginator struct { + options GetDevicesPaginatorOptions + client GetDevicesAPIClient + params *GetDevicesInput + nextToken *string + firstPage bool +} + +// NewGetDevicesPaginator returns a new GetDevicesPaginator +func NewGetDevicesPaginator(client GetDevicesAPIClient, params *GetDevicesInput, optFns ...func(*GetDevicesPaginatorOptions)) *GetDevicesPaginator { + options := GetDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDevicesInput{} + } + + return &GetDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDevices page. +func (p *GetDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetLinkAssociations.go b/service/networkmanager/api_op_GetLinkAssociations.go index b0e3ac1a57b..2296ef20df6 100644 --- a/service/networkmanager/api_op_GetLinkAssociations.go +++ b/service/networkmanager/api_op_GetLinkAssociations.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -120,6 +121,88 @@ func addOperationGetLinkAssociationsMiddlewares(stack *middleware.Stack, options return nil } +// GetLinkAssociationsAPIClient is a client that implements the GetLinkAssociations +// operation. +type GetLinkAssociationsAPIClient interface { + GetLinkAssociations(context.Context, *GetLinkAssociationsInput, ...func(*Options)) (*GetLinkAssociationsOutput, error) +} + +var _ GetLinkAssociationsAPIClient = (*Client)(nil) + +// GetLinkAssociationsPaginatorOptions is the paginator options for +// GetLinkAssociations +type GetLinkAssociationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetLinkAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetLinkAssociations +type GetLinkAssociationsPaginator struct { + options GetLinkAssociationsPaginatorOptions + client GetLinkAssociationsAPIClient + params *GetLinkAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetLinkAssociationsPaginator returns a new GetLinkAssociationsPaginator +func NewGetLinkAssociationsPaginator(client GetLinkAssociationsAPIClient, params *GetLinkAssociationsInput, optFns ...func(*GetLinkAssociationsPaginatorOptions)) *GetLinkAssociationsPaginator { + options := GetLinkAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLinkAssociationsInput{} + } + + return &GetLinkAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLinkAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLinkAssociations page. +func (p *GetLinkAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLinkAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetLinkAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLinkAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetLinks.go b/service/networkmanager/api_op_GetLinks.go index 47f6b56fdaf..8ab353bb7d1 100644 --- a/service/networkmanager/api_op_GetLinks.go +++ b/service/networkmanager/api_op_GetLinks.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -127,6 +128,86 @@ func addOperationGetLinksMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// GetLinksAPIClient is a client that implements the GetLinks operation. +type GetLinksAPIClient interface { + GetLinks(context.Context, *GetLinksInput, ...func(*Options)) (*GetLinksOutput, error) +} + +var _ GetLinksAPIClient = (*Client)(nil) + +// GetLinksPaginatorOptions is the paginator options for GetLinks +type GetLinksPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetLinksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetLinks +type GetLinksPaginator struct { + options GetLinksPaginatorOptions + client GetLinksAPIClient + params *GetLinksInput + nextToken *string + firstPage bool +} + +// NewGetLinksPaginator returns a new GetLinksPaginator +func NewGetLinksPaginator(client GetLinksAPIClient, params *GetLinksInput, optFns ...func(*GetLinksPaginatorOptions)) *GetLinksPaginator { + options := GetLinksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLinksInput{} + } + + return &GetLinksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLinksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLinks page. +func (p *GetLinksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLinksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetLinks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLinks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetSites.go b/service/networkmanager/api_op_GetSites.go index 0e145eb6349..fd4f839e083 100644 --- a/service/networkmanager/api_op_GetSites.go +++ b/service/networkmanager/api_op_GetSites.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -116,6 +117,86 @@ func addOperationGetSitesMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// GetSitesAPIClient is a client that implements the GetSites operation. +type GetSitesAPIClient interface { + GetSites(context.Context, *GetSitesInput, ...func(*Options)) (*GetSitesOutput, error) +} + +var _ GetSitesAPIClient = (*Client)(nil) + +// GetSitesPaginatorOptions is the paginator options for GetSites +type GetSitesPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetSitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetSites +type GetSitesPaginator struct { + options GetSitesPaginatorOptions + client GetSitesAPIClient + params *GetSitesInput + nextToken *string + firstPage bool +} + +// NewGetSitesPaginator returns a new GetSitesPaginator +func NewGetSitesPaginator(client GetSitesAPIClient, params *GetSitesInput, optFns ...func(*GetSitesPaginatorOptions)) *GetSitesPaginator { + options := GetSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSitesInput{} + } + + return &GetSitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSitesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSites page. +func (p *GetSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/api_op_GetTransitGatewayRegistrations.go b/service/networkmanager/api_op_GetTransitGatewayRegistrations.go index 066f7bd98c5..1200d276eff 100644 --- a/service/networkmanager/api_op_GetTransitGatewayRegistrations.go +++ b/service/networkmanager/api_op_GetTransitGatewayRegistrations.go @@ -4,6 +4,7 @@ package networkmanager 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/networkmanager/types" @@ -118,6 +119,89 @@ func addOperationGetTransitGatewayRegistrationsMiddlewares(stack *middleware.Sta return nil } +// GetTransitGatewayRegistrationsAPIClient is a client that implements the +// GetTransitGatewayRegistrations operation. +type GetTransitGatewayRegistrationsAPIClient interface { + GetTransitGatewayRegistrations(context.Context, *GetTransitGatewayRegistrationsInput, ...func(*Options)) (*GetTransitGatewayRegistrationsOutput, error) +} + +var _ GetTransitGatewayRegistrationsAPIClient = (*Client)(nil) + +// GetTransitGatewayRegistrationsPaginatorOptions is the paginator options for +// GetTransitGatewayRegistrations +type GetTransitGatewayRegistrationsPaginatorOptions struct { + // The maximum number of results 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 +} + +// GetTransitGatewayRegistrationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/networkmanager.GetTransitGatewayRegistrations +type GetTransitGatewayRegistrationsPaginator struct { + options GetTransitGatewayRegistrationsPaginatorOptions + client GetTransitGatewayRegistrationsAPIClient + params *GetTransitGatewayRegistrationsInput + nextToken *string + firstPage bool +} + +// NewGetTransitGatewayRegistrationsPaginator returns a new +// GetTransitGatewayRegistrationsPaginator +func NewGetTransitGatewayRegistrationsPaginator(client GetTransitGatewayRegistrationsAPIClient, params *GetTransitGatewayRegistrationsInput, optFns ...func(*GetTransitGatewayRegistrationsPaginatorOptions)) *GetTransitGatewayRegistrationsPaginator { + options := GetTransitGatewayRegistrationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTransitGatewayRegistrationsInput{} + } + + return &GetTransitGatewayRegistrationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTransitGatewayRegistrationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTransitGatewayRegistrations page. +func (p *GetTransitGatewayRegistrationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTransitGatewayRegistrationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetTransitGatewayRegistrations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTransitGatewayRegistrations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/networkmanager/endpoints.go b/service/networkmanager/endpoints.go index b94a4ccf96c..368c325b785 100644 --- a/service/networkmanager/endpoints.go +++ b/service/networkmanager/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/opsworks/api_op_DescribeEcsClusters.go b/service/opsworks/api_op_DescribeEcsClusters.go index ff6365811a0..996d2722f8f 100644 --- a/service/opsworks/api_op_DescribeEcsClusters.go +++ b/service/opsworks/api_op_DescribeEcsClusters.go @@ -4,6 +4,7 @@ package opsworks 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/opsworks/types" @@ -132,6 +133,91 @@ func addOperationDescribeEcsClustersMiddlewares(stack *middleware.Stack, options return nil } +// DescribeEcsClustersAPIClient is a client that implements the DescribeEcsClusters +// operation. +type DescribeEcsClustersAPIClient interface { + DescribeEcsClusters(context.Context, *DescribeEcsClustersInput, ...func(*Options)) (*DescribeEcsClustersOutput, error) +} + +var _ DescribeEcsClustersAPIClient = (*Client)(nil) + +// DescribeEcsClustersPaginatorOptions is the paginator options for +// DescribeEcsClusters +type DescribeEcsClustersPaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + 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 +} + +// DescribeEcsClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworks.DescribeEcsClusters +type DescribeEcsClustersPaginator struct { + options DescribeEcsClustersPaginatorOptions + client DescribeEcsClustersAPIClient + params *DescribeEcsClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeEcsClustersPaginator returns a new DescribeEcsClustersPaginator +func NewDescribeEcsClustersPaginator(client DescribeEcsClustersAPIClient, params *DescribeEcsClustersInput, optFns ...func(*DescribeEcsClustersPaginatorOptions)) *DescribeEcsClustersPaginator { + options := DescribeEcsClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEcsClustersInput{} + } + + return &DescribeEcsClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEcsClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEcsClusters page. +func (p *DescribeEcsClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEcsClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEcsClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEcsClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworks/endpoints.go b/service/opsworks/endpoints.go index 723e650c00a..9be1b3ecb55 100644 --- a/service/opsworks/endpoints.go +++ b/service/opsworks/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/opsworkscm/api_op_DescribeBackups.go b/service/opsworkscm/api_op_DescribeBackups.go index 082121e5de6..b8465255692 100644 --- a/service/opsworkscm/api_op_DescribeBackups.go +++ b/service/opsworkscm/api_op_DescribeBackups.go @@ -4,6 +4,7 @@ package opsworkscm 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/opsworkscm/types" @@ -115,6 +116,87 @@ func addOperationDescribeBackupsMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeBackupsAPIClient is a client that implements the DescribeBackups +// operation. +type DescribeBackupsAPIClient interface { + DescribeBackups(context.Context, *DescribeBackupsInput, ...func(*Options)) (*DescribeBackupsOutput, error) +} + +var _ DescribeBackupsAPIClient = (*Client)(nil) + +// DescribeBackupsPaginatorOptions is the paginator options for DescribeBackups +type DescribeBackupsPaginatorOptions struct { + // This is not currently implemented for DescribeBackups requests. + 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 +} + +// DescribeBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeBackups +type DescribeBackupsPaginator struct { + options DescribeBackupsPaginatorOptions + client DescribeBackupsAPIClient + params *DescribeBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeBackupsPaginator returns a new DescribeBackupsPaginator +func NewDescribeBackupsPaginator(client DescribeBackupsAPIClient, params *DescribeBackupsInput, optFns ...func(*DescribeBackupsPaginatorOptions)) *DescribeBackupsPaginator { + options := DescribeBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeBackupsInput{} + } + + return &DescribeBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeBackupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeBackups page. +func (p *DescribeBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_DescribeEvents.go b/service/opsworkscm/api_op_DescribeEvents.go index 6303cad0197..eee32f1399d 100644 --- a/service/opsworkscm/api_op_DescribeEvents.go +++ b/service/opsworkscm/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package opsworkscm 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/opsworkscm/types" @@ -131,6 +132,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_DescribeServers.go b/service/opsworkscm/api_op_DescribeServers.go index 18b81905c1f..298af2f756b 100644 --- a/service/opsworkscm/api_op_DescribeServers.go +++ b/service/opsworkscm/api_op_DescribeServers.go @@ -4,6 +4,7 @@ package opsworkscm 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/opsworkscm/types" @@ -120,6 +121,87 @@ func addOperationDescribeServersMiddlewares(stack *middleware.Stack, options Opt return nil } +// DescribeServersAPIClient is a client that implements the DescribeServers +// operation. +type DescribeServersAPIClient interface { + DescribeServers(context.Context, *DescribeServersInput, ...func(*Options)) (*DescribeServersOutput, error) +} + +var _ DescribeServersAPIClient = (*Client)(nil) + +// DescribeServersPaginatorOptions is the paginator options for DescribeServers +type DescribeServersPaginatorOptions struct { + // This is not currently implemented for DescribeServers requests. + 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 +} + +// DescribeServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.DescribeServers +type DescribeServersPaginator struct { + options DescribeServersPaginatorOptions + client DescribeServersAPIClient + params *DescribeServersInput + nextToken *string + firstPage bool +} + +// NewDescribeServersPaginator returns a new DescribeServersPaginator +func NewDescribeServersPaginator(client DescribeServersAPIClient, params *DescribeServersInput, optFns ...func(*DescribeServersPaginatorOptions)) *DescribeServersPaginator { + options := DescribeServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServersInput{} + } + + return &DescribeServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeServers page. +func (p *DescribeServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/api_op_ListTagsForResource.go b/service/opsworkscm/api_op_ListTagsForResource.go index 4f0e4ed8c58..b0b40e5ff23 100644 --- a/service/opsworkscm/api_op_ListTagsForResource.go +++ b/service/opsworkscm/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package opsworkscm 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/opsworkscm/types" @@ -128,6 +129,91 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // To receive a paginated response, use this parameter to specify the maximum + // number of results to be returned with a single call. If the number of available + // results exceeds this maximum, the response includes a NextToken value that you + // can assign to the NextToken request parameter to get the next set of results. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/opsworkscm.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/opsworkscm/endpoints.go b/service/opsworkscm/endpoints.go index 95f1831f014..d2a62c15ffb 100644 --- a/service/opsworkscm/endpoints.go +++ b/service/opsworkscm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/organizations/api_op_ListAWSServiceAccessForOrganization.go b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go index 5e46b3f4f89..2875eb5b553 100644 --- a/service/organizations/api_op_ListAWSServiceAccessForOrganization.go +++ b/service/organizations/api_op_ListAWSServiceAccessForOrganization.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -130,6 +131,97 @@ func addOperationListAWSServiceAccessForOrganizationMiddlewares(stack *middlewar return nil } +// ListAWSServiceAccessForOrganizationAPIClient is a client that implements the +// ListAWSServiceAccessForOrganization operation. +type ListAWSServiceAccessForOrganizationAPIClient interface { + ListAWSServiceAccessForOrganization(context.Context, *ListAWSServiceAccessForOrganizationInput, ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) +} + +var _ ListAWSServiceAccessForOrganizationAPIClient = (*Client)(nil) + +// ListAWSServiceAccessForOrganizationPaginatorOptions is the paginator options for +// ListAWSServiceAccessForOrganization +type ListAWSServiceAccessForOrganizationPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListAWSServiceAccessForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAWSServiceAccessForOrganization +type ListAWSServiceAccessForOrganizationPaginator struct { + options ListAWSServiceAccessForOrganizationPaginatorOptions + client ListAWSServiceAccessForOrganizationAPIClient + params *ListAWSServiceAccessForOrganizationInput + nextToken *string + firstPage bool +} + +// NewListAWSServiceAccessForOrganizationPaginator returns a new +// ListAWSServiceAccessForOrganizationPaginator +func NewListAWSServiceAccessForOrganizationPaginator(client ListAWSServiceAccessForOrganizationAPIClient, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*ListAWSServiceAccessForOrganizationPaginatorOptions)) *ListAWSServiceAccessForOrganizationPaginator { + options := ListAWSServiceAccessForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAWSServiceAccessForOrganizationInput{} + } + + return &ListAWSServiceAccessForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAWSServiceAccessForOrganizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAWSServiceAccessForOrganization page. +func (p *ListAWSServiceAccessForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAWSServiceAccessForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAWSServiceAccessForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListAccounts.go b/service/organizations/api_op_ListAccounts.go index 40061ee48ed..6fefce315e1 100644 --- a/service/organizations/api_op_ListAccounts.go +++ b/service/organizations/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -127,6 +128,94 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListAccountsForParent.go b/service/organizations/api_op_ListAccountsForParent.go index 291fab1bb56..d3d2c2490a7 100644 --- a/service/organizations/api_op_ListAccountsForParent.go +++ b/service/organizations/api_op_ListAccountsForParent.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -138,6 +139,96 @@ func addOperationListAccountsForParentMiddlewares(stack *middleware.Stack, optio return nil } +// ListAccountsForParentAPIClient is a client that implements the +// ListAccountsForParent operation. +type ListAccountsForParentAPIClient interface { + ListAccountsForParent(context.Context, *ListAccountsForParentInput, ...func(*Options)) (*ListAccountsForParentOutput, error) +} + +var _ ListAccountsForParentAPIClient = (*Client)(nil) + +// ListAccountsForParentPaginatorOptions is the paginator options for +// ListAccountsForParent +type ListAccountsForParentPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListAccountsForParentPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListAccountsForParent +type ListAccountsForParentPaginator struct { + options ListAccountsForParentPaginatorOptions + client ListAccountsForParentAPIClient + params *ListAccountsForParentInput + nextToken *string + firstPage bool +} + +// NewListAccountsForParentPaginator returns a new ListAccountsForParentPaginator +func NewListAccountsForParentPaginator(client ListAccountsForParentAPIClient, params *ListAccountsForParentInput, optFns ...func(*ListAccountsForParentPaginatorOptions)) *ListAccountsForParentPaginator { + options := ListAccountsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsForParentInput{} + } + + return &ListAccountsForParentPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsForParentPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountsForParent page. +func (p *ListAccountsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForParentOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountsForParent(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListChildren.go b/service/organizations/api_op_ListChildren.go index 9728db8aa98..6fc866fd861 100644 --- a/service/organizations/api_op_ListChildren.go +++ b/service/organizations/api_op_ListChildren.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -150,6 +151,94 @@ func addOperationListChildrenMiddlewares(stack *middleware.Stack, options Option return nil } +// ListChildrenAPIClient is a client that implements the ListChildren operation. +type ListChildrenAPIClient interface { + ListChildren(context.Context, *ListChildrenInput, ...func(*Options)) (*ListChildrenOutput, error) +} + +var _ ListChildrenAPIClient = (*Client)(nil) + +// ListChildrenPaginatorOptions is the paginator options for ListChildren +type ListChildrenPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListChildrenPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListChildren +type ListChildrenPaginator struct { + options ListChildrenPaginatorOptions + client ListChildrenAPIClient + params *ListChildrenInput + nextToken *string + firstPage bool +} + +// NewListChildrenPaginator returns a new ListChildrenPaginator +func NewListChildrenPaginator(client ListChildrenAPIClient, params *ListChildrenInput, optFns ...func(*ListChildrenPaginatorOptions)) *ListChildrenPaginator { + options := ListChildrenPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListChildrenInput{} + } + + return &ListChildrenPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChildrenPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListChildren page. +func (p *ListChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChildrenOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListChildren(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListChildren(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListCreateAccountStatus.go b/service/organizations/api_op_ListCreateAccountStatus.go index 194bc5d4503..eaa3cd0f71a 100644 --- a/service/organizations/api_op_ListCreateAccountStatus.go +++ b/service/organizations/api_op_ListCreateAccountStatus.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -132,6 +133,97 @@ func addOperationListCreateAccountStatusMiddlewares(stack *middleware.Stack, opt return nil } +// ListCreateAccountStatusAPIClient is a client that implements the +// ListCreateAccountStatus operation. +type ListCreateAccountStatusAPIClient interface { + ListCreateAccountStatus(context.Context, *ListCreateAccountStatusInput, ...func(*Options)) (*ListCreateAccountStatusOutput, error) +} + +var _ ListCreateAccountStatusAPIClient = (*Client)(nil) + +// ListCreateAccountStatusPaginatorOptions is the paginator options for +// ListCreateAccountStatus +type ListCreateAccountStatusPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListCreateAccountStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListCreateAccountStatus +type ListCreateAccountStatusPaginator struct { + options ListCreateAccountStatusPaginatorOptions + client ListCreateAccountStatusAPIClient + params *ListCreateAccountStatusInput + nextToken *string + firstPage bool +} + +// NewListCreateAccountStatusPaginator returns a new +// ListCreateAccountStatusPaginator +func NewListCreateAccountStatusPaginator(client ListCreateAccountStatusAPIClient, params *ListCreateAccountStatusInput, optFns ...func(*ListCreateAccountStatusPaginatorOptions)) *ListCreateAccountStatusPaginator { + options := ListCreateAccountStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCreateAccountStatusInput{} + } + + return &ListCreateAccountStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCreateAccountStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCreateAccountStatus page. +func (p *ListCreateAccountStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCreateAccountStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListDelegatedAdministrators.go b/service/organizations/api_op_ListDelegatedAdministrators.go index 1f039c6dfb9..9ece05f75cf 100644 --- a/service/organizations/api_op_ListDelegatedAdministrators.go +++ b/service/organizations/api_op_ListDelegatedAdministrators.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -128,6 +129,97 @@ func addOperationListDelegatedAdministratorsMiddlewares(stack *middleware.Stack, return nil } +// ListDelegatedAdministratorsAPIClient is a client that implements the +// ListDelegatedAdministrators operation. +type ListDelegatedAdministratorsAPIClient interface { + ListDelegatedAdministrators(context.Context, *ListDelegatedAdministratorsInput, ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) +} + +var _ ListDelegatedAdministratorsAPIClient = (*Client)(nil) + +// ListDelegatedAdministratorsPaginatorOptions is the paginator options for +// ListDelegatedAdministrators +type ListDelegatedAdministratorsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListDelegatedAdministratorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListDelegatedAdministrators +type ListDelegatedAdministratorsPaginator struct { + options ListDelegatedAdministratorsPaginatorOptions + client ListDelegatedAdministratorsAPIClient + params *ListDelegatedAdministratorsInput + nextToken *string + firstPage bool +} + +// NewListDelegatedAdministratorsPaginator returns a new +// ListDelegatedAdministratorsPaginator +func NewListDelegatedAdministratorsPaginator(client ListDelegatedAdministratorsAPIClient, params *ListDelegatedAdministratorsInput, optFns ...func(*ListDelegatedAdministratorsPaginatorOptions)) *ListDelegatedAdministratorsPaginator { + options := ListDelegatedAdministratorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDelegatedAdministratorsInput{} + } + + return &ListDelegatedAdministratorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDelegatedAdministratorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDelegatedAdministrators page. +func (p *ListDelegatedAdministratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDelegatedAdministrators(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDelegatedAdministrators(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListDelegatedServicesForAccount.go b/service/organizations/api_op_ListDelegatedServicesForAccount.go index bb9e520a6fd..4f05e448335 100644 --- a/service/organizations/api_op_ListDelegatedServicesForAccount.go +++ b/service/organizations/api_op_ListDelegatedServicesForAccount.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -130,6 +131,97 @@ func addOperationListDelegatedServicesForAccountMiddlewares(stack *middleware.St return nil } +// ListDelegatedServicesForAccountAPIClient is a client that implements the +// ListDelegatedServicesForAccount operation. +type ListDelegatedServicesForAccountAPIClient interface { + ListDelegatedServicesForAccount(context.Context, *ListDelegatedServicesForAccountInput, ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) +} + +var _ ListDelegatedServicesForAccountAPIClient = (*Client)(nil) + +// ListDelegatedServicesForAccountPaginatorOptions is the paginator options for +// ListDelegatedServicesForAccount +type ListDelegatedServicesForAccountPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListDelegatedServicesForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListDelegatedServicesForAccount +type ListDelegatedServicesForAccountPaginator struct { + options ListDelegatedServicesForAccountPaginatorOptions + client ListDelegatedServicesForAccountAPIClient + params *ListDelegatedServicesForAccountInput + nextToken *string + firstPage bool +} + +// NewListDelegatedServicesForAccountPaginator returns a new +// ListDelegatedServicesForAccountPaginator +func NewListDelegatedServicesForAccountPaginator(client ListDelegatedServicesForAccountAPIClient, params *ListDelegatedServicesForAccountInput, optFns ...func(*ListDelegatedServicesForAccountPaginatorOptions)) *ListDelegatedServicesForAccountPaginator { + options := ListDelegatedServicesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDelegatedServicesForAccountInput{} + } + + return &ListDelegatedServicesForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDelegatedServicesForAccountPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDelegatedServicesForAccount page. +func (p *ListDelegatedServicesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDelegatedServicesForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDelegatedServicesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListHandshakesForAccount.go b/service/organizations/api_op_ListHandshakesForAccount.go index 9568d2e78cb..f2edbcaf5fe 100644 --- a/service/organizations/api_op_ListHandshakesForAccount.go +++ b/service/organizations/api_op_ListHandshakesForAccount.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -136,6 +137,97 @@ func addOperationListHandshakesForAccountMiddlewares(stack *middleware.Stack, op return nil } +// ListHandshakesForAccountAPIClient is a client that implements the +// ListHandshakesForAccount operation. +type ListHandshakesForAccountAPIClient interface { + ListHandshakesForAccount(context.Context, *ListHandshakesForAccountInput, ...func(*Options)) (*ListHandshakesForAccountOutput, error) +} + +var _ ListHandshakesForAccountAPIClient = (*Client)(nil) + +// ListHandshakesForAccountPaginatorOptions is the paginator options for +// ListHandshakesForAccount +type ListHandshakesForAccountPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListHandshakesForAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListHandshakesForAccount +type ListHandshakesForAccountPaginator struct { + options ListHandshakesForAccountPaginatorOptions + client ListHandshakesForAccountAPIClient + params *ListHandshakesForAccountInput + nextToken *string + firstPage bool +} + +// NewListHandshakesForAccountPaginator returns a new +// ListHandshakesForAccountPaginator +func NewListHandshakesForAccountPaginator(client ListHandshakesForAccountAPIClient, params *ListHandshakesForAccountInput, optFns ...func(*ListHandshakesForAccountPaginatorOptions)) *ListHandshakesForAccountPaginator { + options := ListHandshakesForAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHandshakesForAccountInput{} + } + + return &ListHandshakesForAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHandshakesForAccountPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHandshakesForAccount page. +func (p *ListHandshakesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHandshakesForAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHandshakesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListHandshakesForOrganization.go b/service/organizations/api_op_ListHandshakesForOrganization.go index bd955a6d4dd..5c756e762ed 100644 --- a/service/organizations/api_op_ListHandshakesForOrganization.go +++ b/service/organizations/api_op_ListHandshakesForOrganization.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -139,6 +140,97 @@ func addOperationListHandshakesForOrganizationMiddlewares(stack *middleware.Stac return nil } +// ListHandshakesForOrganizationAPIClient is a client that implements the +// ListHandshakesForOrganization operation. +type ListHandshakesForOrganizationAPIClient interface { + ListHandshakesForOrganization(context.Context, *ListHandshakesForOrganizationInput, ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) +} + +var _ ListHandshakesForOrganizationAPIClient = (*Client)(nil) + +// ListHandshakesForOrganizationPaginatorOptions is the paginator options for +// ListHandshakesForOrganization +type ListHandshakesForOrganizationPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListHandshakesForOrganizationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListHandshakesForOrganization +type ListHandshakesForOrganizationPaginator struct { + options ListHandshakesForOrganizationPaginatorOptions + client ListHandshakesForOrganizationAPIClient + params *ListHandshakesForOrganizationInput + nextToken *string + firstPage bool +} + +// NewListHandshakesForOrganizationPaginator returns a new +// ListHandshakesForOrganizationPaginator +func NewListHandshakesForOrganizationPaginator(client ListHandshakesForOrganizationAPIClient, params *ListHandshakesForOrganizationInput, optFns ...func(*ListHandshakesForOrganizationPaginatorOptions)) *ListHandshakesForOrganizationPaginator { + options := ListHandshakesForOrganizationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHandshakesForOrganizationInput{} + } + + return &ListHandshakesForOrganizationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHandshakesForOrganizationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHandshakesForOrganization page. +func (p *ListHandshakesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHandshakesForOrganization(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHandshakesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListOrganizationalUnitsForParent.go b/service/organizations/api_op_ListOrganizationalUnitsForParent.go index 91090642d56..06dfa217260 100644 --- a/service/organizations/api_op_ListOrganizationalUnitsForParent.go +++ b/service/organizations/api_op_ListOrganizationalUnitsForParent.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -143,6 +144,97 @@ func addOperationListOrganizationalUnitsForParentMiddlewares(stack *middleware.S return nil } +// ListOrganizationalUnitsForParentAPIClient is a client that implements the +// ListOrganizationalUnitsForParent operation. +type ListOrganizationalUnitsForParentAPIClient interface { + ListOrganizationalUnitsForParent(context.Context, *ListOrganizationalUnitsForParentInput, ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) +} + +var _ ListOrganizationalUnitsForParentAPIClient = (*Client)(nil) + +// ListOrganizationalUnitsForParentPaginatorOptions is the paginator options for +// ListOrganizationalUnitsForParent +type ListOrganizationalUnitsForParentPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListOrganizationalUnitsForParentPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListOrganizationalUnitsForParent +type ListOrganizationalUnitsForParentPaginator struct { + options ListOrganizationalUnitsForParentPaginatorOptions + client ListOrganizationalUnitsForParentAPIClient + params *ListOrganizationalUnitsForParentInput + nextToken *string + firstPage bool +} + +// NewListOrganizationalUnitsForParentPaginator returns a new +// ListOrganizationalUnitsForParentPaginator +func NewListOrganizationalUnitsForParentPaginator(client ListOrganizationalUnitsForParentAPIClient, params *ListOrganizationalUnitsForParentInput, optFns ...func(*ListOrganizationalUnitsForParentPaginatorOptions)) *ListOrganizationalUnitsForParentPaginator { + options := ListOrganizationalUnitsForParentPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationalUnitsForParentInput{} + } + + return &ListOrganizationalUnitsForParentPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationalUnitsForParentPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOrganizationalUnitsForParent page. +func (p *ListOrganizationalUnitsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListOrganizationalUnitsForParent(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationalUnitsForParent(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListParents.go b/service/organizations/api_op_ListParents.go index ef71b4293bb..d4bf0644a0e 100644 --- a/service/organizations/api_op_ListParents.go +++ b/service/organizations/api_op_ListParents.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -147,6 +148,94 @@ func addOperationListParentsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListParentsAPIClient is a client that implements the ListParents operation. +type ListParentsAPIClient interface { + ListParents(context.Context, *ListParentsInput, ...func(*Options)) (*ListParentsOutput, error) +} + +var _ ListParentsAPIClient = (*Client)(nil) + +// ListParentsPaginatorOptions is the paginator options for ListParents +type ListParentsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListParentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListParents +type ListParentsPaginator struct { + options ListParentsPaginatorOptions + client ListParentsAPIClient + params *ListParentsInput + nextToken *string + firstPage bool +} + +// NewListParentsPaginator returns a new ListParentsPaginator +func NewListParentsPaginator(client ListParentsAPIClient, params *ListParentsInput, optFns ...func(*ListParentsPaginatorOptions)) *ListParentsPaginator { + options := ListParentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListParentsInput{} + } + + return &ListParentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListParentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListParents page. +func (p *ListParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListParentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListParents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListParents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListPolicies.go b/service/organizations/api_op_ListPolicies.go index 985bd2e20aa..410f2836215 100644 --- a/service/organizations/api_op_ListPolicies.go +++ b/service/organizations/api_op_ListPolicies.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -151,6 +152,94 @@ func addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListPoliciesAPIClient is a client that implements the ListPolicies operation. +type ListPoliciesAPIClient interface { + ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) +} + +var _ ListPoliciesAPIClient = (*Client)(nil) + +// ListPoliciesPaginatorOptions is the paginator options for ListPolicies +type ListPoliciesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListPolicies +type ListPoliciesPaginator struct { + options ListPoliciesPaginatorOptions + client ListPoliciesAPIClient + params *ListPoliciesInput + nextToken *string + firstPage bool +} + +// NewListPoliciesPaginator returns a new ListPoliciesPaginator +func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { + options := ListPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesInput{} + } + + return &ListPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPolicies page. +func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListPoliciesForTarget.go b/service/organizations/api_op_ListPoliciesForTarget.go index 00bb6c4248f..6b61e4035db 100644 --- a/service/organizations/api_op_ListPoliciesForTarget.go +++ b/service/organizations/api_op_ListPoliciesForTarget.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -170,6 +171,96 @@ func addOperationListPoliciesForTargetMiddlewares(stack *middleware.Stack, optio return nil } +// ListPoliciesForTargetAPIClient is a client that implements the +// ListPoliciesForTarget operation. +type ListPoliciesForTargetAPIClient interface { + ListPoliciesForTarget(context.Context, *ListPoliciesForTargetInput, ...func(*Options)) (*ListPoliciesForTargetOutput, error) +} + +var _ ListPoliciesForTargetAPIClient = (*Client)(nil) + +// ListPoliciesForTargetPaginatorOptions is the paginator options for +// ListPoliciesForTarget +type ListPoliciesForTargetPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListPoliciesForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListPoliciesForTarget +type ListPoliciesForTargetPaginator struct { + options ListPoliciesForTargetPaginatorOptions + client ListPoliciesForTargetAPIClient + params *ListPoliciesForTargetInput + nextToken *string + firstPage bool +} + +// NewListPoliciesForTargetPaginator returns a new ListPoliciesForTargetPaginator +func NewListPoliciesForTargetPaginator(client ListPoliciesForTargetAPIClient, params *ListPoliciesForTargetInput, optFns ...func(*ListPoliciesForTargetPaginatorOptions)) *ListPoliciesForTargetPaginator { + options := ListPoliciesForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPoliciesForTargetInput{} + } + + return &ListPoliciesForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPoliciesForTargetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPoliciesForTarget page. +func (p *ListPoliciesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPoliciesForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPoliciesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListRoots.go b/service/organizations/api_op_ListRoots.go index d87798cebab..06397f3a54f 100644 --- a/service/organizations/api_op_ListRoots.go +++ b/service/organizations/api_op_ListRoots.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -130,6 +131,94 @@ func addOperationListRootsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListRootsAPIClient is a client that implements the ListRoots operation. +type ListRootsAPIClient interface { + ListRoots(context.Context, *ListRootsInput, ...func(*Options)) (*ListRootsOutput, error) +} + +var _ ListRootsAPIClient = (*Client)(nil) + +// ListRootsPaginatorOptions is the paginator options for ListRoots +type ListRootsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListRootsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListRoots +type ListRootsPaginator struct { + options ListRootsPaginatorOptions + client ListRootsAPIClient + params *ListRootsInput + nextToken *string + firstPage bool +} + +// NewListRootsPaginator returns a new ListRootsPaginator +func NewListRootsPaginator(client ListRootsAPIClient, params *ListRootsInput, optFns ...func(*ListRootsPaginatorOptions)) *ListRootsPaginator { + options := ListRootsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRootsInput{} + } + + return &ListRootsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRootsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRoots page. +func (p *ListRootsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRootsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRoots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRoots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListTagsForResource.go b/service/organizations/api_op_ListTagsForResource.go index 6281f6a076c..903369899db 100644 --- a/service/organizations/api_op_ListTagsForResource.go +++ b/service/organizations/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -143,6 +144,81 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/api_op_ListTargetsForPolicy.go b/service/organizations/api_op_ListTargetsForPolicy.go index e284e19f4e8..0581bc05d55 100644 --- a/service/organizations/api_op_ListTargetsForPolicy.go +++ b/service/organizations/api_op_ListTargetsForPolicy.go @@ -4,6 +4,7 @@ package organizations 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/organizations/types" @@ -138,6 +139,96 @@ func addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, option return nil } +// ListTargetsForPolicyAPIClient is a client that implements the +// ListTargetsForPolicy operation. +type ListTargetsForPolicyAPIClient interface { + ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) +} + +var _ ListTargetsForPolicyAPIClient = (*Client)(nil) + +// ListTargetsForPolicyPaginatorOptions is the paginator options for +// ListTargetsForPolicy +type ListTargetsForPolicyPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that Organizations might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListTargetsForPolicyPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/organizations.ListTargetsForPolicy +type ListTargetsForPolicyPaginator struct { + options ListTargetsForPolicyPaginatorOptions + client ListTargetsForPolicyAPIClient + params *ListTargetsForPolicyInput + nextToken *string + firstPage bool +} + +// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator +func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { + options := ListTargetsForPolicyPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTargetsForPolicyInput{} + } + + return &ListTargetsForPolicyPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTargetsForPolicy page. +func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTargetsForPolicy(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/organizations/endpoints.go b/service/organizations/endpoints.go index 30effc64fcc..d0706c82185 100644 --- a/service/organizations/endpoints.go +++ b/service/organizations/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/outposts/api_op_ListOutposts.go b/service/outposts/api_op_ListOutposts.go index f8eb3216eaa..81ec074edc5 100644 --- a/service/outposts/api_op_ListOutposts.go +++ b/service/outposts/api_op_ListOutposts.go @@ -4,6 +4,7 @@ package outposts 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/outposts/types" @@ -105,6 +106,86 @@ func addOperationListOutpostsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListOutpostsAPIClient is a client that implements the ListOutposts operation. +type ListOutpostsAPIClient interface { + ListOutposts(context.Context, *ListOutpostsInput, ...func(*Options)) (*ListOutpostsOutput, error) +} + +var _ ListOutpostsAPIClient = (*Client)(nil) + +// ListOutpostsPaginatorOptions is the paginator options for ListOutposts +type ListOutpostsPaginatorOptions struct { + // The maximum page size. + 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 +} + +// ListOutpostsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/outposts.ListOutposts +type ListOutpostsPaginator struct { + options ListOutpostsPaginatorOptions + client ListOutpostsAPIClient + params *ListOutpostsInput + nextToken *string + firstPage bool +} + +// NewListOutpostsPaginator returns a new ListOutpostsPaginator +func NewListOutpostsPaginator(client ListOutpostsAPIClient, params *ListOutpostsInput, optFns ...func(*ListOutpostsPaginatorOptions)) *ListOutpostsPaginator { + options := ListOutpostsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOutpostsInput{} + } + + return &ListOutpostsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOutpostsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOutposts page. +func (p *ListOutpostsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOutpostsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListOutposts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOutposts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/outposts/api_op_ListSites.go b/service/outposts/api_op_ListSites.go index 9b0e2d335c0..9bb12c3db02 100644 --- a/service/outposts/api_op_ListSites.go +++ b/service/outposts/api_op_ListSites.go @@ -4,6 +4,7 @@ package outposts 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/outposts/types" @@ -105,6 +106,86 @@ func addOperationListSitesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListSitesAPIClient is a client that implements the ListSites operation. +type ListSitesAPIClient interface { + ListSites(context.Context, *ListSitesInput, ...func(*Options)) (*ListSitesOutput, error) +} + +var _ ListSitesAPIClient = (*Client)(nil) + +// ListSitesPaginatorOptions is the paginator options for ListSites +type ListSitesPaginatorOptions struct { + // The maximum page size. + 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 +} + +// ListSitesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/outposts.ListSites +type ListSitesPaginator struct { + options ListSitesPaginatorOptions + client ListSitesAPIClient + params *ListSitesInput + nextToken *string + firstPage bool +} + +// NewListSitesPaginator returns a new ListSitesPaginator +func NewListSitesPaginator(client ListSitesAPIClient, params *ListSitesInput, optFns ...func(*ListSitesPaginatorOptions)) *ListSitesPaginator { + options := ListSitesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSitesInput{} + } + + return &ListSitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSitesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSites page. +func (p *ListSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSites(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/outposts/endpoints.go b/service/outposts/endpoints.go index cfe3197ba8a..ec11950a309 100644 --- a/service/outposts/endpoints.go +++ b/service/outposts/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/personalize/api_op_ListBatchInferenceJobs.go b/service/personalize/api_op_ListBatchInferenceJobs.go index a4b7f865da8..317e5abbf27 100644 --- a/service/personalize/api_op_ListBatchInferenceJobs.go +++ b/service/personalize/api_op_ListBatchInferenceJobs.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -112,6 +113,89 @@ func addOperationListBatchInferenceJobsMiddlewares(stack *middleware.Stack, opti return nil } +// ListBatchInferenceJobsAPIClient is a client that implements the +// ListBatchInferenceJobs operation. +type ListBatchInferenceJobsAPIClient interface { + ListBatchInferenceJobs(context.Context, *ListBatchInferenceJobsInput, ...func(*Options)) (*ListBatchInferenceJobsOutput, error) +} + +var _ ListBatchInferenceJobsAPIClient = (*Client)(nil) + +// ListBatchInferenceJobsPaginatorOptions is the paginator options for +// ListBatchInferenceJobs +type ListBatchInferenceJobsPaginatorOptions struct { + // The maximum number of batch inference job results to return in each page. The + // default value is 100. + 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 +} + +// ListBatchInferenceJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListBatchInferenceJobs +type ListBatchInferenceJobsPaginator struct { + options ListBatchInferenceJobsPaginatorOptions + client ListBatchInferenceJobsAPIClient + params *ListBatchInferenceJobsInput + nextToken *string + firstPage bool +} + +// NewListBatchInferenceJobsPaginator returns a new ListBatchInferenceJobsPaginator +func NewListBatchInferenceJobsPaginator(client ListBatchInferenceJobsAPIClient, params *ListBatchInferenceJobsInput, optFns ...func(*ListBatchInferenceJobsPaginatorOptions)) *ListBatchInferenceJobsPaginator { + options := ListBatchInferenceJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBatchInferenceJobsInput{} + } + + return &ListBatchInferenceJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBatchInferenceJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBatchInferenceJobs page. +func (p *ListBatchInferenceJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBatchInferenceJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListBatchInferenceJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBatchInferenceJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListCampaigns.go b/service/personalize/api_op_ListCampaigns.go index 2ed7cd5600d..f7be36e3946 100644 --- a/service/personalize/api_op_ListCampaigns.go +++ b/service/personalize/api_op_ListCampaigns.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -114,6 +115,86 @@ func addOperationListCampaignsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListCampaignsAPIClient is a client that implements the ListCampaigns operation. +type ListCampaignsAPIClient interface { + ListCampaigns(context.Context, *ListCampaignsInput, ...func(*Options)) (*ListCampaignsOutput, error) +} + +var _ ListCampaignsAPIClient = (*Client)(nil) + +// ListCampaignsPaginatorOptions is the paginator options for ListCampaigns +type ListCampaignsPaginatorOptions struct { + // The maximum number of campaigns 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 +} + +// ListCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListCampaigns +type ListCampaignsPaginator struct { + options ListCampaignsPaginatorOptions + client ListCampaignsAPIClient + params *ListCampaignsInput + nextToken *string + firstPage bool +} + +// NewListCampaignsPaginator returns a new ListCampaignsPaginator +func NewListCampaignsPaginator(client ListCampaignsAPIClient, params *ListCampaignsInput, optFns ...func(*ListCampaignsPaginatorOptions)) *ListCampaignsPaginator { + options := ListCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCampaignsInput{} + } + + return &ListCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCampaignsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCampaigns page. +func (p *ListCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasetGroups.go b/service/personalize/api_op_ListDatasetGroups.go index 77f1449cc7c..a8c23c15295 100644 --- a/service/personalize/api_op_ListDatasetGroups.go +++ b/service/personalize/api_op_ListDatasetGroups.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -108,6 +109,87 @@ func addOperationListDatasetGroupsMiddlewares(stack *middleware.Stack, options O return nil } +// ListDatasetGroupsAPIClient is a client that implements the ListDatasetGroups +// operation. +type ListDatasetGroupsAPIClient interface { + ListDatasetGroups(context.Context, *ListDatasetGroupsInput, ...func(*Options)) (*ListDatasetGroupsOutput, error) +} + +var _ ListDatasetGroupsAPIClient = (*Client)(nil) + +// ListDatasetGroupsPaginatorOptions is the paginator options for ListDatasetGroups +type ListDatasetGroupsPaginatorOptions struct { + // The maximum number of dataset groups 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 +} + +// ListDatasetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasetGroups +type ListDatasetGroupsPaginator struct { + options ListDatasetGroupsPaginatorOptions + client ListDatasetGroupsAPIClient + params *ListDatasetGroupsInput + nextToken *string + firstPage bool +} + +// NewListDatasetGroupsPaginator returns a new ListDatasetGroupsPaginator +func NewListDatasetGroupsPaginator(client ListDatasetGroupsAPIClient, params *ListDatasetGroupsInput, optFns ...func(*ListDatasetGroupsPaginatorOptions)) *ListDatasetGroupsPaginator { + options := ListDatasetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetGroupsInput{} + } + + return &ListDatasetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasetGroups page. +func (p *ListDatasetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasetImportJobs.go b/service/personalize/api_op_ListDatasetImportJobs.go index 9db6f0a6b85..305ec0fcf8b 100644 --- a/service/personalize/api_op_ListDatasetImportJobs.go +++ b/service/personalize/api_op_ListDatasetImportJobs.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -115,6 +116,88 @@ func addOperationListDatasetImportJobsMiddlewares(stack *middleware.Stack, optio return nil } +// ListDatasetImportJobsAPIClient is a client that implements the +// ListDatasetImportJobs operation. +type ListDatasetImportJobsAPIClient interface { + ListDatasetImportJobs(context.Context, *ListDatasetImportJobsInput, ...func(*Options)) (*ListDatasetImportJobsOutput, error) +} + +var _ ListDatasetImportJobsAPIClient = (*Client)(nil) + +// ListDatasetImportJobsPaginatorOptions is the paginator options for +// ListDatasetImportJobs +type ListDatasetImportJobsPaginatorOptions struct { + // The maximum number of dataset import jobs 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 +} + +// ListDatasetImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasetImportJobs +type ListDatasetImportJobsPaginator struct { + options ListDatasetImportJobsPaginatorOptions + client ListDatasetImportJobsAPIClient + params *ListDatasetImportJobsInput + nextToken *string + firstPage bool +} + +// NewListDatasetImportJobsPaginator returns a new ListDatasetImportJobsPaginator +func NewListDatasetImportJobsPaginator(client ListDatasetImportJobsAPIClient, params *ListDatasetImportJobsInput, optFns ...func(*ListDatasetImportJobsPaginatorOptions)) *ListDatasetImportJobsPaginator { + options := ListDatasetImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetImportJobsInput{} + } + + return &ListDatasetImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetImportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasetImportJobs page. +func (p *ListDatasetImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasetImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasetImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListDatasets.go b/service/personalize/api_op_ListDatasets.go index 85c54600b97..519d38514d3 100644 --- a/service/personalize/api_op_ListDatasets.go +++ b/service/personalize/api_op_ListDatasets.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -112,6 +113,86 @@ func addOperationListDatasetsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListDatasetsAPIClient is a client that implements the ListDatasets operation. +type ListDatasetsAPIClient interface { + ListDatasets(context.Context, *ListDatasetsInput, ...func(*Options)) (*ListDatasetsOutput, error) +} + +var _ ListDatasetsAPIClient = (*Client)(nil) + +// ListDatasetsPaginatorOptions is the paginator options for ListDatasets +type ListDatasetsPaginatorOptions struct { + // The maximum number of datasets 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 +} + +// ListDatasetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListDatasets +type ListDatasetsPaginator struct { + options ListDatasetsPaginatorOptions + client ListDatasetsAPIClient + params *ListDatasetsInput + nextToken *string + firstPage bool +} + +// NewListDatasetsPaginator returns a new ListDatasetsPaginator +func NewListDatasetsPaginator(client ListDatasetsAPIClient, params *ListDatasetsInput, optFns ...func(*ListDatasetsPaginatorOptions)) *ListDatasetsPaginator { + options := ListDatasetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatasetsInput{} + } + + return &ListDatasetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatasetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatasets page. +func (p *ListDatasetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatasetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatasets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatasets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListEventTrackers.go b/service/personalize/api_op_ListEventTrackers.go index a38778297ba..d99f0dc7621 100644 --- a/service/personalize/api_op_ListEventTrackers.go +++ b/service/personalize/api_op_ListEventTrackers.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -112,6 +113,87 @@ func addOperationListEventTrackersMiddlewares(stack *middleware.Stack, options O return nil } +// ListEventTrackersAPIClient is a client that implements the ListEventTrackers +// operation. +type ListEventTrackersAPIClient interface { + ListEventTrackers(context.Context, *ListEventTrackersInput, ...func(*Options)) (*ListEventTrackersOutput, error) +} + +var _ ListEventTrackersAPIClient = (*Client)(nil) + +// ListEventTrackersPaginatorOptions is the paginator options for ListEventTrackers +type ListEventTrackersPaginatorOptions struct { + // The maximum number of event trackers 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 +} + +// ListEventTrackersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListEventTrackers +type ListEventTrackersPaginator struct { + options ListEventTrackersPaginatorOptions + client ListEventTrackersAPIClient + params *ListEventTrackersInput + nextToken *string + firstPage bool +} + +// NewListEventTrackersPaginator returns a new ListEventTrackersPaginator +func NewListEventTrackersPaginator(client ListEventTrackersAPIClient, params *ListEventTrackersInput, optFns ...func(*ListEventTrackersPaginatorOptions)) *ListEventTrackersPaginator { + options := ListEventTrackersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEventTrackersInput{} + } + + return &ListEventTrackersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventTrackersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEventTrackers page. +func (p *ListEventTrackersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventTrackersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEventTrackers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEventTrackers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListRecipes.go b/service/personalize/api_op_ListRecipes.go index a54a1f32066..9039f75daf9 100644 --- a/service/personalize/api_op_ListRecipes.go +++ b/service/personalize/api_op_ListRecipes.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -110,6 +111,86 @@ func addOperationListRecipesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListRecipesAPIClient is a client that implements the ListRecipes operation. +type ListRecipesAPIClient interface { + ListRecipes(context.Context, *ListRecipesInput, ...func(*Options)) (*ListRecipesOutput, error) +} + +var _ ListRecipesAPIClient = (*Client)(nil) + +// ListRecipesPaginatorOptions is the paginator options for ListRecipes +type ListRecipesPaginatorOptions struct { + // The maximum number of recipes 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 +} + +// ListRecipesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListRecipes +type ListRecipesPaginator struct { + options ListRecipesPaginatorOptions + client ListRecipesAPIClient + params *ListRecipesInput + nextToken *string + firstPage bool +} + +// NewListRecipesPaginator returns a new ListRecipesPaginator +func NewListRecipesPaginator(client ListRecipesAPIClient, params *ListRecipesInput, optFns ...func(*ListRecipesPaginatorOptions)) *ListRecipesPaginator { + options := ListRecipesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRecipesInput{} + } + + return &ListRecipesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecipesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRecipes page. +func (p *ListRecipesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecipesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRecipes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRecipes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSchemas.go b/service/personalize/api_op_ListSchemas.go index 6014f673037..1491e2df4b3 100644 --- a/service/personalize/api_op_ListSchemas.go +++ b/service/personalize/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -108,6 +109,86 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return nil } +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + // The maximum number of schemas 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 +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSolutionVersions.go b/service/personalize/api_op_ListSolutionVersions.go index aeeec7af7a7..b1ffcd562ab 100644 --- a/service/personalize/api_op_ListSolutionVersions.go +++ b/service/personalize/api_op_ListSolutionVersions.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -113,6 +114,88 @@ func addOperationListSolutionVersionsMiddlewares(stack *middleware.Stack, option return nil } +// ListSolutionVersionsAPIClient is a client that implements the +// ListSolutionVersions operation. +type ListSolutionVersionsAPIClient interface { + ListSolutionVersions(context.Context, *ListSolutionVersionsInput, ...func(*Options)) (*ListSolutionVersionsOutput, error) +} + +var _ ListSolutionVersionsAPIClient = (*Client)(nil) + +// ListSolutionVersionsPaginatorOptions is the paginator options for +// ListSolutionVersions +type ListSolutionVersionsPaginatorOptions struct { + // The maximum number of solution versions 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 +} + +// ListSolutionVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSolutionVersions +type ListSolutionVersionsPaginator struct { + options ListSolutionVersionsPaginatorOptions + client ListSolutionVersionsAPIClient + params *ListSolutionVersionsInput + nextToken *string + firstPage bool +} + +// NewListSolutionVersionsPaginator returns a new ListSolutionVersionsPaginator +func NewListSolutionVersionsPaginator(client ListSolutionVersionsAPIClient, params *ListSolutionVersionsInput, optFns ...func(*ListSolutionVersionsPaginatorOptions)) *ListSolutionVersionsPaginator { + options := ListSolutionVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSolutionVersionsInput{} + } + + return &ListSolutionVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolutionVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSolutionVersions page. +func (p *ListSolutionVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolutionVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSolutionVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSolutionVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/api_op_ListSolutions.go b/service/personalize/api_op_ListSolutions.go index 50344724399..fdbed97fdca 100644 --- a/service/personalize/api_op_ListSolutions.go +++ b/service/personalize/api_op_ListSolutions.go @@ -4,6 +4,7 @@ package personalize 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/personalize/types" @@ -113,6 +114,86 @@ func addOperationListSolutionsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListSolutionsAPIClient is a client that implements the ListSolutions operation. +type ListSolutionsAPIClient interface { + ListSolutions(context.Context, *ListSolutionsInput, ...func(*Options)) (*ListSolutionsOutput, error) +} + +var _ ListSolutionsAPIClient = (*Client)(nil) + +// ListSolutionsPaginatorOptions is the paginator options for ListSolutions +type ListSolutionsPaginatorOptions struct { + // The maximum number of solutions 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 +} + +// ListSolutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/personalize.ListSolutions +type ListSolutionsPaginator struct { + options ListSolutionsPaginatorOptions + client ListSolutionsAPIClient + params *ListSolutionsInput + nextToken *string + firstPage bool +} + +// NewListSolutionsPaginator returns a new ListSolutionsPaginator +func NewListSolutionsPaginator(client ListSolutionsAPIClient, params *ListSolutionsInput, optFns ...func(*ListSolutionsPaginatorOptions)) *ListSolutionsPaginator { + options := ListSolutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSolutionsInput{} + } + + return &ListSolutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSolutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSolutions page. +func (p *ListSolutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSolutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSolutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSolutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/personalize/endpoints.go b/service/personalize/endpoints.go index ab71b4ba2d6..013a245a58c 100644 --- a/service/personalize/endpoints.go +++ b/service/personalize/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/personalizeevents/endpoints.go b/service/personalizeevents/endpoints.go index 13b5febac8f..08aecd84b73 100644 --- a/service/personalizeevents/endpoints.go +++ b/service/personalizeevents/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/personalizeruntime/endpoints.go b/service/personalizeruntime/endpoints.go index 84e048a159c..38cf3d304aa 100644 --- a/service/personalizeruntime/endpoints.go +++ b/service/personalizeruntime/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/pi/endpoints.go b/service/pi/endpoints.go index db578d5a77a..1941f324557 100644 --- a/service/pi/endpoints.go +++ b/service/pi/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/pinpoint/endpoints.go b/service/pinpoint/endpoints.go index 580e65c979a..ed8b5d0d9e3 100644 --- a/service/pinpoint/endpoints.go +++ b/service/pinpoint/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/pinpointemail/api_op_GetDedicatedIps.go b/service/pinpointemail/api_op_GetDedicatedIps.go index 38873b67bbd..659e7cafd90 100644 --- a/service/pinpointemail/api_op_GetDedicatedIps.go +++ b/service/pinpointemail/api_op_GetDedicatedIps.go @@ -4,6 +4,7 @@ package pinpointemail 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/pinpointemail/types" @@ -119,6 +120,90 @@ func addOperationGetDedicatedIpsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetDedicatedIpsAPIClient is a client that implements the GetDedicatedIps +// operation. +type GetDedicatedIpsAPIClient interface { + GetDedicatedIps(context.Context, *GetDedicatedIpsInput, ...func(*Options)) (*GetDedicatedIpsOutput, error) +} + +var _ GetDedicatedIpsAPIClient = (*Client)(nil) + +// GetDedicatedIpsPaginatorOptions is the paginator options for GetDedicatedIps +type GetDedicatedIpsPaginatorOptions struct { + // The number of results to show in a single call to GetDedicatedIpsRequest. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// GetDedicatedIpsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.GetDedicatedIps +type GetDedicatedIpsPaginator struct { + options GetDedicatedIpsPaginatorOptions + client GetDedicatedIpsAPIClient + params *GetDedicatedIpsInput + nextToken *string + firstPage bool +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDedicatedIpsInput{} + } + + return &GetDedicatedIpsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDedicatedIpsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDedicatedIps page. +func (p *GetDedicatedIpsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.GetDedicatedIps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDedicatedIps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListConfigurationSets.go b/service/pinpointemail/api_op_ListConfigurationSets.go index 2740cc94056..e4c945fb3c6 100644 --- a/service/pinpointemail/api_op_ListConfigurationSets.go +++ b/service/pinpointemail/api_op_ListConfigurationSets.go @@ -4,6 +4,7 @@ package pinpointemail 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/awslabs/smithy-go/middleware" @@ -120,6 +121,91 @@ func addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, optio return nil } +// ListConfigurationSetsAPIClient is a client that implements the +// ListConfigurationSets operation. +type ListConfigurationSetsAPIClient interface { + ListConfigurationSets(context.Context, *ListConfigurationSetsInput, ...func(*Options)) (*ListConfigurationSetsOutput, error) +} + +var _ ListConfigurationSetsAPIClient = (*Client)(nil) + +// ListConfigurationSetsPaginatorOptions is the paginator options for +// ListConfigurationSets +type ListConfigurationSetsPaginatorOptions struct { + // The number of results to show in a single call to ListConfigurationSets. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// ListConfigurationSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListConfigurationSets +type ListConfigurationSetsPaginator struct { + options ListConfigurationSetsPaginatorOptions + client ListConfigurationSetsAPIClient + params *ListConfigurationSetsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationSetsInput{} + } + + return &ListConfigurationSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurationSets page. +func (p *ListConfigurationSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListConfigurationSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDedicatedIpPools.go b/service/pinpointemail/api_op_ListDedicatedIpPools.go index c1e1bff3097..cc9b56ddcab 100644 --- a/service/pinpointemail/api_op_ListDedicatedIpPools.go +++ b/service/pinpointemail/api_op_ListDedicatedIpPools.go @@ -4,6 +4,7 @@ package pinpointemail 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/awslabs/smithy-go/middleware" @@ -114,6 +115,91 @@ func addOperationListDedicatedIpPoolsMiddlewares(stack *middleware.Stack, option return nil } +// ListDedicatedIpPoolsAPIClient is a client that implements the +// ListDedicatedIpPools operation. +type ListDedicatedIpPoolsAPIClient interface { + ListDedicatedIpPools(context.Context, *ListDedicatedIpPoolsInput, ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) +} + +var _ ListDedicatedIpPoolsAPIClient = (*Client)(nil) + +// ListDedicatedIpPoolsPaginatorOptions is the paginator options for +// ListDedicatedIpPools +type ListDedicatedIpPoolsPaginatorOptions struct { + // The number of results to show in a single call to ListDedicatedIpPools. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// ListDedicatedIpPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDedicatedIpPools +type ListDedicatedIpPoolsPaginator struct { + options ListDedicatedIpPoolsPaginatorOptions + client ListDedicatedIpPoolsAPIClient + params *ListDedicatedIpPoolsInput + nextToken *string + firstPage bool +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDedicatedIpPoolsInput{} + } + + return &ListDedicatedIpPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDedicatedIpPoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDedicatedIpPools page. +func (p *ListDedicatedIpPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDedicatedIpPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDedicatedIpPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDeliverabilityTestReports.go b/service/pinpointemail/api_op_ListDeliverabilityTestReports.go index 94612c4d9d4..314ef9c77a3 100644 --- a/service/pinpointemail/api_op_ListDeliverabilityTestReports.go +++ b/service/pinpointemail/api_op_ListDeliverabilityTestReports.go @@ -4,6 +4,7 @@ package pinpointemail 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/pinpointemail/types" @@ -123,6 +124,93 @@ func addOperationListDeliverabilityTestReportsMiddlewares(stack *middleware.Stac return nil } +// ListDeliverabilityTestReportsAPIClient is a client that implements the +// ListDeliverabilityTestReports operation. +type ListDeliverabilityTestReportsAPIClient interface { + ListDeliverabilityTestReports(context.Context, *ListDeliverabilityTestReportsInput, ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) +} + +var _ ListDeliverabilityTestReportsAPIClient = (*Client)(nil) + +// ListDeliverabilityTestReportsPaginatorOptions is the paginator options for +// ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginatorOptions struct { + // The number of results to show in a single call to ListDeliverabilityTestReports. + // If the number of results is larger than the number you specified in this + // parameter, then the response includes a NextToken element, which you can use to + // obtain additional results. The value you specify has to be at least 0, and can + // be no more than 1000. + 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 +} + +// ListDeliverabilityTestReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginator struct { + options ListDeliverabilityTestReportsPaginatorOptions + client ListDeliverabilityTestReportsAPIClient + params *ListDeliverabilityTestReportsInput + nextToken *string + firstPage bool +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeliverabilityTestReportsInput{} + } + + return &ListDeliverabilityTestReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeliverabilityTestReportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeliverabilityTestReports page. +func (p *ListDeliverabilityTestReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDeliverabilityTestReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeliverabilityTestReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go b/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go index 8f30fdccc9f..ec12d551f65 100644 --- a/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go +++ b/service/pinpointemail/api_op_ListDomainDeliverabilityCampaigns.go @@ -4,6 +4,7 @@ package pinpointemail 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/pinpointemail/types" @@ -148,6 +149,92 @@ func addOperationListDomainDeliverabilityCampaignsMiddlewares(stack *middleware. return nil } +// ListDomainDeliverabilityCampaignsAPIClient is a client that implements the +// ListDomainDeliverabilityCampaigns operation. +type ListDomainDeliverabilityCampaignsAPIClient interface { + ListDomainDeliverabilityCampaigns(context.Context, *ListDomainDeliverabilityCampaignsInput, ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) +} + +var _ ListDomainDeliverabilityCampaignsAPIClient = (*Client)(nil) + +// ListDomainDeliverabilityCampaignsPaginatorOptions is the paginator options for +// ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginatorOptions struct { + // The maximum number of results to include in response to a single call to the + // ListDomainDeliverabilityCampaigns operation. If the number of results is larger + // than the number that you specify in this parameter, the response includes a + // NextToken element, which you can use to obtain additional results. + 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 +} + +// ListDomainDeliverabilityCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginator struct { + options ListDomainDeliverabilityCampaignsPaginatorOptions + client ListDomainDeliverabilityCampaignsAPIClient + params *ListDomainDeliverabilityCampaignsInput + nextToken *string + firstPage bool +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainDeliverabilityCampaignsInput{} + } + + return &ListDomainDeliverabilityCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainDeliverabilityCampaignsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomainDeliverabilityCampaigns page. +func (p *ListDomainDeliverabilityCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDomainDeliverabilityCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainDeliverabilityCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/api_op_ListEmailIdentities.go b/service/pinpointemail/api_op_ListEmailIdentities.go index 7c71bb53fc6..8fe43f681b6 100644 --- a/service/pinpointemail/api_op_ListEmailIdentities.go +++ b/service/pinpointemail/api_op_ListEmailIdentities.go @@ -4,6 +4,7 @@ package pinpointemail 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/pinpointemail/types" @@ -123,6 +124,92 @@ func addOperationListEmailIdentitiesMiddlewares(stack *middleware.Stack, options return nil } +// ListEmailIdentitiesAPIClient is a client that implements the ListEmailIdentities +// operation. +type ListEmailIdentitiesAPIClient interface { + ListEmailIdentities(context.Context, *ListEmailIdentitiesInput, ...func(*Options)) (*ListEmailIdentitiesOutput, error) +} + +var _ ListEmailIdentitiesAPIClient = (*Client)(nil) + +// ListEmailIdentitiesPaginatorOptions is the paginator options for +// ListEmailIdentities +type ListEmailIdentitiesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailIdentities. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 0, and can be no + // more than 1000. + 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 +} + +// ListEmailIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pinpointemail.ListEmailIdentities +type ListEmailIdentitiesPaginator struct { + options ListEmailIdentitiesPaginatorOptions + client ListEmailIdentitiesAPIClient + params *ListEmailIdentitiesInput + nextToken *string + firstPage bool +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailIdentitiesInput{} + } + + return &ListEmailIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailIdentitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEmailIdentities page. +func (p *ListEmailIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListEmailIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pinpointemail/endpoints.go b/service/pinpointemail/endpoints.go index 12b7ad6ebe8..62d4a3cb6b7 100644 --- a/service/pinpointemail/endpoints.go +++ b/service/pinpointemail/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/pinpointsmsvoice/endpoints.go b/service/pinpointsmsvoice/endpoints.go index a03cc079c08..4f3c475b6ce 100644 --- a/service/pinpointsmsvoice/endpoints.go +++ b/service/pinpointsmsvoice/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/polly/api_op_ListSpeechSynthesisTasks.go b/service/polly/api_op_ListSpeechSynthesisTasks.go index 775d8af7599..00fc8222295 100644 --- a/service/polly/api_op_ListSpeechSynthesisTasks.go +++ b/service/polly/api_op_ListSpeechSynthesisTasks.go @@ -4,6 +4,7 @@ package polly 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/polly/types" @@ -114,6 +115,89 @@ func addOperationListSpeechSynthesisTasksMiddlewares(stack *middleware.Stack, op return nil } +// ListSpeechSynthesisTasksAPIClient is a client that implements the +// ListSpeechSynthesisTasks operation. +type ListSpeechSynthesisTasksAPIClient interface { + ListSpeechSynthesisTasks(context.Context, *ListSpeechSynthesisTasksInput, ...func(*Options)) (*ListSpeechSynthesisTasksOutput, error) +} + +var _ ListSpeechSynthesisTasksAPIClient = (*Client)(nil) + +// ListSpeechSynthesisTasksPaginatorOptions is the paginator options for +// ListSpeechSynthesisTasks +type ListSpeechSynthesisTasksPaginatorOptions struct { + // Maximum number of speech synthesis tasks returned in a List operation. + 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 +} + +// ListSpeechSynthesisTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/polly.ListSpeechSynthesisTasks +type ListSpeechSynthesisTasksPaginator struct { + options ListSpeechSynthesisTasksPaginatorOptions + client ListSpeechSynthesisTasksAPIClient + params *ListSpeechSynthesisTasksInput + nextToken *string + firstPage bool +} + +// NewListSpeechSynthesisTasksPaginator returns a new +// ListSpeechSynthesisTasksPaginator +func NewListSpeechSynthesisTasksPaginator(client ListSpeechSynthesisTasksAPIClient, params *ListSpeechSynthesisTasksInput, optFns ...func(*ListSpeechSynthesisTasksPaginatorOptions)) *ListSpeechSynthesisTasksPaginator { + options := ListSpeechSynthesisTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSpeechSynthesisTasksInput{} + } + + return &ListSpeechSynthesisTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSpeechSynthesisTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSpeechSynthesisTasks page. +func (p *ListSpeechSynthesisTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSpeechSynthesisTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSpeechSynthesisTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSpeechSynthesisTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/polly/endpoints.go b/service/polly/endpoints.go index dfd92937daa..987960d712d 100644 --- a/service/polly/endpoints.go +++ b/service/polly/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/pricing/api_op_DescribeServices.go b/service/pricing/api_op_DescribeServices.go index 8436e4e205b..f9d78d3c1c2 100644 --- a/service/pricing/api_op_DescribeServices.go +++ b/service/pricing/api_op_DescribeServices.go @@ -4,6 +4,7 @@ package pricing 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/pricing/types" @@ -122,6 +123,87 @@ func addOperationDescribeServicesMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeServicesAPIClient is a client that implements the DescribeServices +// operation. +type DescribeServicesAPIClient interface { + DescribeServices(context.Context, *DescribeServicesInput, ...func(*Options)) (*DescribeServicesOutput, error) +} + +var _ DescribeServicesAPIClient = (*Client)(nil) + +// DescribeServicesPaginatorOptions is the paginator options for DescribeServices +type DescribeServicesPaginatorOptions struct { + // The maximum number of results that you want returned in the response. + 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 +} + +// DescribeServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.DescribeServices +type DescribeServicesPaginator struct { + options DescribeServicesPaginatorOptions + client DescribeServicesAPIClient + params *DescribeServicesInput + nextToken *string + firstPage bool +} + +// NewDescribeServicesPaginator returns a new DescribeServicesPaginator +func NewDescribeServicesPaginator(client DescribeServicesAPIClient, params *DescribeServicesInput, optFns ...func(*DescribeServicesPaginatorOptions)) *DescribeServicesPaginator { + options := DescribeServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeServicesInput{} + } + + return &DescribeServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeServicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeServices page. +func (p *DescribeServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/api_op_GetAttributeValues.go b/service/pricing/api_op_GetAttributeValues.go index 3dad704772e..b38815521be 100644 --- a/service/pricing/api_op_GetAttributeValues.go +++ b/service/pricing/api_op_GetAttributeValues.go @@ -4,6 +4,7 @@ package pricing 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/pricing/types" @@ -127,6 +128,88 @@ func addOperationGetAttributeValuesMiddlewares(stack *middleware.Stack, options return nil } +// GetAttributeValuesAPIClient is a client that implements the GetAttributeValues +// operation. +type GetAttributeValuesAPIClient interface { + GetAttributeValues(context.Context, *GetAttributeValuesInput, ...func(*Options)) (*GetAttributeValuesOutput, error) +} + +var _ GetAttributeValuesAPIClient = (*Client)(nil) + +// GetAttributeValuesPaginatorOptions is the paginator options for +// GetAttributeValues +type GetAttributeValuesPaginatorOptions struct { + // The maximum number of results to return in response. + 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 +} + +// GetAttributeValuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.GetAttributeValues +type GetAttributeValuesPaginator struct { + options GetAttributeValuesPaginatorOptions + client GetAttributeValuesAPIClient + params *GetAttributeValuesInput + nextToken *string + firstPage bool +} + +// NewGetAttributeValuesPaginator returns a new GetAttributeValuesPaginator +func NewGetAttributeValuesPaginator(client GetAttributeValuesAPIClient, params *GetAttributeValuesInput, optFns ...func(*GetAttributeValuesPaginatorOptions)) *GetAttributeValuesPaginator { + options := GetAttributeValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetAttributeValuesInput{} + } + + return &GetAttributeValuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetAttributeValuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetAttributeValues page. +func (p *GetAttributeValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAttributeValuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetAttributeValues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetAttributeValues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/api_op_GetProducts.go b/service/pricing/api_op_GetProducts.go index 73e6177e691..226d2604cb2 100644 --- a/service/pricing/api_op_GetProducts.go +++ b/service/pricing/api_op_GetProducts.go @@ -4,6 +4,7 @@ package pricing 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/pricing/types" @@ -123,6 +124,86 @@ func addOperationGetProductsMiddlewares(stack *middleware.Stack, options Options return nil } +// GetProductsAPIClient is a client that implements the GetProducts operation. +type GetProductsAPIClient interface { + GetProducts(context.Context, *GetProductsInput, ...func(*Options)) (*GetProductsOutput, error) +} + +var _ GetProductsAPIClient = (*Client)(nil) + +// GetProductsPaginatorOptions is the paginator options for GetProducts +type GetProductsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// GetProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/pricing.GetProducts +type GetProductsPaginator struct { + options GetProductsPaginatorOptions + client GetProductsAPIClient + params *GetProductsInput + nextToken *string + firstPage bool +} + +// NewGetProductsPaginator returns a new GetProductsPaginator +func NewGetProductsPaginator(client GetProductsAPIClient, params *GetProductsInput, optFns ...func(*GetProductsPaginatorOptions)) *GetProductsPaginator { + options := GetProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetProductsInput{} + } + + return &GetProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetProductsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetProducts page. +func (p *GetProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/pricing/endpoints.go b/service/pricing/endpoints.go index ab22fc0bb6c..b6fd4cc2aa8 100644 --- a/service/pricing/endpoints.go +++ b/service/pricing/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go b/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go index 49c9211da5a..8ecfdd45d36 100644 --- a/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go +++ b/service/qldb/api_op_ListJournalKinesisStreamsForLedger.go @@ -4,6 +4,7 @@ package qldb 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/qldb/types" @@ -128,6 +129,91 @@ func addOperationListJournalKinesisStreamsForLedgerMiddlewares(stack *middleware return nil } +// ListJournalKinesisStreamsForLedgerAPIClient is a client that implements the +// ListJournalKinesisStreamsForLedger operation. +type ListJournalKinesisStreamsForLedgerAPIClient interface { + ListJournalKinesisStreamsForLedger(context.Context, *ListJournalKinesisStreamsForLedgerInput, ...func(*Options)) (*ListJournalKinesisStreamsForLedgerOutput, error) +} + +var _ ListJournalKinesisStreamsForLedgerAPIClient = (*Client)(nil) + +// ListJournalKinesisStreamsForLedgerPaginatorOptions is the paginator options for +// ListJournalKinesisStreamsForLedger +type ListJournalKinesisStreamsForLedgerPaginatorOptions struct { + // The maximum number of results to return in a single + // ListJournalKinesisStreamsForLedger request. (The actual number of results + // returned might be fewer.) + 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 +} + +// ListJournalKinesisStreamsForLedgerPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalKinesisStreamsForLedger +type ListJournalKinesisStreamsForLedgerPaginator struct { + options ListJournalKinesisStreamsForLedgerPaginatorOptions + client ListJournalKinesisStreamsForLedgerAPIClient + params *ListJournalKinesisStreamsForLedgerInput + nextToken *string + firstPage bool +} + +// NewListJournalKinesisStreamsForLedgerPaginator returns a new +// ListJournalKinesisStreamsForLedgerPaginator +func NewListJournalKinesisStreamsForLedgerPaginator(client ListJournalKinesisStreamsForLedgerAPIClient, params *ListJournalKinesisStreamsForLedgerInput, optFns ...func(*ListJournalKinesisStreamsForLedgerPaginatorOptions)) *ListJournalKinesisStreamsForLedgerPaginator { + options := ListJournalKinesisStreamsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalKinesisStreamsForLedgerInput{} + } + + return &ListJournalKinesisStreamsForLedgerPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalKinesisStreamsForLedgerPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJournalKinesisStreamsForLedger page. +func (p *ListJournalKinesisStreamsForLedgerPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalKinesisStreamsForLedgerOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJournalKinesisStreamsForLedger(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalKinesisStreamsForLedger(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListJournalS3Exports.go b/service/qldb/api_op_ListJournalS3Exports.go index 7e371643d6f..7d7ab8b2643 100644 --- a/service/qldb/api_op_ListJournalS3Exports.go +++ b/service/qldb/api_op_ListJournalS3Exports.go @@ -4,6 +4,7 @@ package qldb 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/qldb/types" @@ -120,6 +121,89 @@ func addOperationListJournalS3ExportsMiddlewares(stack *middleware.Stack, option return nil } +// ListJournalS3ExportsAPIClient is a client that implements the +// ListJournalS3Exports operation. +type ListJournalS3ExportsAPIClient interface { + ListJournalS3Exports(context.Context, *ListJournalS3ExportsInput, ...func(*Options)) (*ListJournalS3ExportsOutput, error) +} + +var _ ListJournalS3ExportsAPIClient = (*Client)(nil) + +// ListJournalS3ExportsPaginatorOptions is the paginator options for +// ListJournalS3Exports +type ListJournalS3ExportsPaginatorOptions struct { + // The maximum number of results to return in a single ListJournalS3Exports + // request. (The actual number of results returned might be fewer.) + 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 +} + +// ListJournalS3ExportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalS3Exports +type ListJournalS3ExportsPaginator struct { + options ListJournalS3ExportsPaginatorOptions + client ListJournalS3ExportsAPIClient + params *ListJournalS3ExportsInput + nextToken *string + firstPage bool +} + +// NewListJournalS3ExportsPaginator returns a new ListJournalS3ExportsPaginator +func NewListJournalS3ExportsPaginator(client ListJournalS3ExportsAPIClient, params *ListJournalS3ExportsInput, optFns ...func(*ListJournalS3ExportsPaginatorOptions)) *ListJournalS3ExportsPaginator { + options := ListJournalS3ExportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalS3ExportsInput{} + } + + return &ListJournalS3ExportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalS3ExportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJournalS3Exports page. +func (p *ListJournalS3ExportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalS3ExportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJournalS3Exports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalS3Exports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListJournalS3ExportsForLedger.go b/service/qldb/api_op_ListJournalS3ExportsForLedger.go index 63e741209c7..1fb6ece11f6 100644 --- a/service/qldb/api_op_ListJournalS3ExportsForLedger.go +++ b/service/qldb/api_op_ListJournalS3ExportsForLedger.go @@ -4,6 +4,7 @@ package qldb 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/qldb/types" @@ -130,6 +131,91 @@ func addOperationListJournalS3ExportsForLedgerMiddlewares(stack *middleware.Stac return nil } +// ListJournalS3ExportsForLedgerAPIClient is a client that implements the +// ListJournalS3ExportsForLedger operation. +type ListJournalS3ExportsForLedgerAPIClient interface { + ListJournalS3ExportsForLedger(context.Context, *ListJournalS3ExportsForLedgerInput, ...func(*Options)) (*ListJournalS3ExportsForLedgerOutput, error) +} + +var _ ListJournalS3ExportsForLedgerAPIClient = (*Client)(nil) + +// ListJournalS3ExportsForLedgerPaginatorOptions is the paginator options for +// ListJournalS3ExportsForLedger +type ListJournalS3ExportsForLedgerPaginatorOptions struct { + // The maximum number of results to return in a single + // ListJournalS3ExportsForLedger request. (The actual number of results returned + // might be fewer.) + 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 +} + +// ListJournalS3ExportsForLedgerPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListJournalS3ExportsForLedger +type ListJournalS3ExportsForLedgerPaginator struct { + options ListJournalS3ExportsForLedgerPaginatorOptions + client ListJournalS3ExportsForLedgerAPIClient + params *ListJournalS3ExportsForLedgerInput + nextToken *string + firstPage bool +} + +// NewListJournalS3ExportsForLedgerPaginator returns a new +// ListJournalS3ExportsForLedgerPaginator +func NewListJournalS3ExportsForLedgerPaginator(client ListJournalS3ExportsForLedgerAPIClient, params *ListJournalS3ExportsForLedgerInput, optFns ...func(*ListJournalS3ExportsForLedgerPaginatorOptions)) *ListJournalS3ExportsForLedgerPaginator { + options := ListJournalS3ExportsForLedgerPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJournalS3ExportsForLedgerInput{} + } + + return &ListJournalS3ExportsForLedgerPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJournalS3ExportsForLedgerPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJournalS3ExportsForLedger page. +func (p *ListJournalS3ExportsForLedgerPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJournalS3ExportsForLedgerOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJournalS3ExportsForLedger(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJournalS3ExportsForLedger(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/api_op_ListLedgers.go b/service/qldb/api_op_ListLedgers.go index 2da9542b319..973016cad97 100644 --- a/service/qldb/api_op_ListLedgers.go +++ b/service/qldb/api_op_ListLedgers.go @@ -4,6 +4,7 @@ package qldb 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/qldb/types" @@ -119,6 +120,87 @@ func addOperationListLedgersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListLedgersAPIClient is a client that implements the ListLedgers operation. +type ListLedgersAPIClient interface { + ListLedgers(context.Context, *ListLedgersInput, ...func(*Options)) (*ListLedgersOutput, error) +} + +var _ ListLedgersAPIClient = (*Client)(nil) + +// ListLedgersPaginatorOptions is the paginator options for ListLedgers +type ListLedgersPaginatorOptions struct { + // The maximum number of results to return in a single ListLedgers request. (The + // actual number of results returned might be fewer.) + 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 +} + +// ListLedgersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/qldb.ListLedgers +type ListLedgersPaginator struct { + options ListLedgersPaginatorOptions + client ListLedgersAPIClient + params *ListLedgersInput + nextToken *string + firstPage bool +} + +// NewListLedgersPaginator returns a new ListLedgersPaginator +func NewListLedgersPaginator(client ListLedgersAPIClient, params *ListLedgersInput, optFns ...func(*ListLedgersPaginatorOptions)) *ListLedgersPaginator { + options := ListLedgersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLedgersInput{} + } + + return &ListLedgersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLedgersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLedgers page. +func (p *ListLedgersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLedgersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLedgers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLedgers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/qldb/endpoints.go b/service/qldb/endpoints.go index 2e8477bfbfa..b729120bf66 100644 --- a/service/qldb/endpoints.go +++ b/service/qldb/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/qldbsession/endpoints.go b/service/qldbsession/endpoints.go index 1c2701743bc..26196651cf8 100644 --- a/service/qldbsession/endpoints.go +++ b/service/qldbsession/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/quicksight/api_op_ListAnalyses.go b/service/quicksight/api_op_ListAnalyses.go index f529e99345b..80d6e1725c5 100644 --- a/service/quicksight/api_op_ListAnalyses.go +++ b/service/quicksight/api_op_ListAnalyses.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -119,6 +120,86 @@ func addOperationListAnalysesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListAnalysesAPIClient is a client that implements the ListAnalyses operation. +type ListAnalysesAPIClient interface { + ListAnalyses(context.Context, *ListAnalysesInput, ...func(*Options)) (*ListAnalysesOutput, error) +} + +var _ ListAnalysesAPIClient = (*Client)(nil) + +// ListAnalysesPaginatorOptions is the paginator options for ListAnalyses +type ListAnalysesPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListAnalysesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListAnalyses +type ListAnalysesPaginator struct { + options ListAnalysesPaginatorOptions + client ListAnalysesAPIClient + params *ListAnalysesInput + nextToken *string + firstPage bool +} + +// NewListAnalysesPaginator returns a new ListAnalysesPaginator +func NewListAnalysesPaginator(client ListAnalysesAPIClient, params *ListAnalysesInput, optFns ...func(*ListAnalysesPaginatorOptions)) *ListAnalysesPaginator { + options := ListAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnalysesInput{} + } + + return &ListAnalysesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnalysesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAnalyses page. +func (p *ListAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnalysesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAnalyses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDashboardVersions.go b/service/quicksight/api_op_ListDashboardVersions.go index 1938f30d4be..8329893e23b 100644 --- a/service/quicksight/api_op_ListDashboardVersions.go +++ b/service/quicksight/api_op_ListDashboardVersions.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -125,6 +126,88 @@ func addOperationListDashboardVersionsMiddlewares(stack *middleware.Stack, optio return nil } +// ListDashboardVersionsAPIClient is a client that implements the +// ListDashboardVersions operation. +type ListDashboardVersionsAPIClient interface { + ListDashboardVersions(context.Context, *ListDashboardVersionsInput, ...func(*Options)) (*ListDashboardVersionsOutput, error) +} + +var _ ListDashboardVersionsAPIClient = (*Client)(nil) + +// ListDashboardVersionsPaginatorOptions is the paginator options for +// ListDashboardVersions +type ListDashboardVersionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListDashboardVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDashboardVersions +type ListDashboardVersionsPaginator struct { + options ListDashboardVersionsPaginatorOptions + client ListDashboardVersionsAPIClient + params *ListDashboardVersionsInput + nextToken *string + firstPage bool +} + +// NewListDashboardVersionsPaginator returns a new ListDashboardVersionsPaginator +func NewListDashboardVersionsPaginator(client ListDashboardVersionsAPIClient, params *ListDashboardVersionsInput, optFns ...func(*ListDashboardVersionsPaginatorOptions)) *ListDashboardVersionsPaginator { + options := ListDashboardVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardVersionsInput{} + } + + return &ListDashboardVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDashboardVersions page. +func (p *ListDashboardVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDashboardVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboardVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDashboards.go b/service/quicksight/api_op_ListDashboards.go index 502bae0d866..e9fc7f94855 100644 --- a/service/quicksight/api_op_ListDashboards.go +++ b/service/quicksight/api_op_ListDashboards.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -120,6 +121,87 @@ func addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListDashboardsAPIClient is a client that implements the ListDashboards +// operation. +type ListDashboardsAPIClient interface { + ListDashboards(context.Context, *ListDashboardsInput, ...func(*Options)) (*ListDashboardsOutput, error) +} + +var _ ListDashboardsAPIClient = (*Client)(nil) + +// ListDashboardsPaginatorOptions is the paginator options for ListDashboards +type ListDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDashboards +type ListDashboardsPaginator struct { + options ListDashboardsPaginatorOptions + client ListDashboardsAPIClient + params *ListDashboardsInput + nextToken *string + firstPage bool +} + +// NewListDashboardsPaginator returns a new ListDashboardsPaginator +func NewListDashboardsPaginator(client ListDashboardsAPIClient, params *ListDashboardsInput, optFns ...func(*ListDashboardsPaginatorOptions)) *ListDashboardsPaginator { + options := ListDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDashboardsInput{} + } + + return &ListDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDashboardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDashboards page. +func (p *ListDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDataSets.go b/service/quicksight/api_op_ListDataSets.go index 8efc2c31e76..0c70c3319d2 100644 --- a/service/quicksight/api_op_ListDataSets.go +++ b/service/quicksight/api_op_ListDataSets.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -120,6 +121,86 @@ func addOperationListDataSetsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListDataSetsAPIClient is a client that implements the ListDataSets operation. +type ListDataSetsAPIClient interface { + ListDataSets(context.Context, *ListDataSetsInput, ...func(*Options)) (*ListDataSetsOutput, error) +} + +var _ ListDataSetsAPIClient = (*Client)(nil) + +// ListDataSetsPaginatorOptions is the paginator options for ListDataSets +type ListDataSetsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListDataSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDataSets +type ListDataSetsPaginator struct { + options ListDataSetsPaginatorOptions + client ListDataSetsAPIClient + params *ListDataSetsInput + nextToken *string + firstPage bool +} + +// NewListDataSetsPaginator returns a new ListDataSetsPaginator +func NewListDataSetsPaginator(client ListDataSetsAPIClient, params *ListDataSetsInput, optFns ...func(*ListDataSetsPaginatorOptions)) *ListDataSetsPaginator { + options := ListDataSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSetsInput{} + } + + return &ListDataSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSets page. +func (p *ListDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDataSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListDataSources.go b/service/quicksight/api_op_ListDataSources.go index f735330a964..333bdbdd21b 100644 --- a/service/quicksight/api_op_ListDataSources.go +++ b/service/quicksight/api_op_ListDataSources.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -119,6 +120,87 @@ func addOperationListDataSourcesMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDataSourcesAPIClient is a client that implements the ListDataSources +// operation. +type ListDataSourcesAPIClient interface { + ListDataSources(context.Context, *ListDataSourcesInput, ...func(*Options)) (*ListDataSourcesOutput, error) +} + +var _ ListDataSourcesAPIClient = (*Client)(nil) + +// ListDataSourcesPaginatorOptions is the paginator options for ListDataSources +type ListDataSourcesPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListDataSourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListDataSources +type ListDataSourcesPaginator struct { + options ListDataSourcesPaginatorOptions + client ListDataSourcesAPIClient + params *ListDataSourcesInput + nextToken *string + firstPage bool +} + +// NewListDataSourcesPaginator returns a new ListDataSourcesPaginator +func NewListDataSourcesPaginator(client ListDataSourcesAPIClient, params *ListDataSourcesInput, optFns ...func(*ListDataSourcesPaginatorOptions)) *ListDataSourcesPaginator { + options := ListDataSourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDataSourcesInput{} + } + + return &ListDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDataSourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDataSources page. +func (p *ListDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDataSources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListIngestions.go b/service/quicksight/api_op_ListIngestions.go index bdbe1629c14..1dc14c1db6b 100644 --- a/service/quicksight/api_op_ListIngestions.go +++ b/service/quicksight/api_op_ListIngestions.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -124,6 +125,87 @@ func addOperationListIngestionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListIngestionsAPIClient is a client that implements the ListIngestions +// operation. +type ListIngestionsAPIClient interface { + ListIngestions(context.Context, *ListIngestionsInput, ...func(*Options)) (*ListIngestionsOutput, error) +} + +var _ ListIngestionsAPIClient = (*Client)(nil) + +// ListIngestionsPaginatorOptions is the paginator options for ListIngestions +type ListIngestionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListIngestionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListIngestions +type ListIngestionsPaginator struct { + options ListIngestionsPaginatorOptions + client ListIngestionsAPIClient + params *ListIngestionsInput + nextToken *string + firstPage bool +} + +// NewListIngestionsPaginator returns a new ListIngestionsPaginator +func NewListIngestionsPaginator(client ListIngestionsAPIClient, params *ListIngestionsInput, optFns ...func(*ListIngestionsPaginatorOptions)) *ListIngestionsPaginator { + options := ListIngestionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIngestionsInput{} + } + + return &ListIngestionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIngestionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIngestions page. +func (p *ListIngestionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIngestionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListIngestions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIngestions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListNamespaces.go b/service/quicksight/api_op_ListNamespaces.go index acccfcdfa47..aa7346d2ef4 100644 --- a/service/quicksight/api_op_ListNamespaces.go +++ b/service/quicksight/api_op_ListNamespaces.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -122,6 +123,87 @@ func addOperationListNamespacesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListNamespacesAPIClient is a client that implements the ListNamespaces +// operation. +type ListNamespacesAPIClient interface { + ListNamespaces(context.Context, *ListNamespacesInput, ...func(*Options)) (*ListNamespacesOutput, error) +} + +var _ ListNamespacesAPIClient = (*Client)(nil) + +// ListNamespacesPaginatorOptions is the paginator options for ListNamespaces +type ListNamespacesPaginatorOptions struct { + // The maximum number of results 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 +} + +// ListNamespacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListNamespaces +type ListNamespacesPaginator struct { + options ListNamespacesPaginatorOptions + client ListNamespacesAPIClient + params *ListNamespacesInput + nextToken *string + firstPage bool +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamespacesInput{} + } + + return &ListNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamespacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNamespaces page. +func (p *ListNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListNamespaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplateAliases.go b/service/quicksight/api_op_ListTemplateAliases.go index b7872b4bd52..291975028d1 100644 --- a/service/quicksight/api_op_ListTemplateAliases.go +++ b/service/quicksight/api_op_ListTemplateAliases.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -125,6 +126,88 @@ func addOperationListTemplateAliasesMiddlewares(stack *middleware.Stack, options return nil } +// ListTemplateAliasesAPIClient is a client that implements the ListTemplateAliases +// operation. +type ListTemplateAliasesAPIClient interface { + ListTemplateAliases(context.Context, *ListTemplateAliasesInput, ...func(*Options)) (*ListTemplateAliasesOutput, error) +} + +var _ ListTemplateAliasesAPIClient = (*Client)(nil) + +// ListTemplateAliasesPaginatorOptions is the paginator options for +// ListTemplateAliases +type ListTemplateAliasesPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListTemplateAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplateAliases +type ListTemplateAliasesPaginator struct { + options ListTemplateAliasesPaginatorOptions + client ListTemplateAliasesAPIClient + params *ListTemplateAliasesInput + nextToken *string + firstPage bool +} + +// NewListTemplateAliasesPaginator returns a new ListTemplateAliasesPaginator +func NewListTemplateAliasesPaginator(client ListTemplateAliasesAPIClient, params *ListTemplateAliasesInput, optFns ...func(*ListTemplateAliasesPaginatorOptions)) *ListTemplateAliasesPaginator { + options := ListTemplateAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplateAliasesInput{} + } + + return &ListTemplateAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplateAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTemplateAliases page. +func (p *ListTemplateAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTemplateAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplateAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplateVersions.go b/service/quicksight/api_op_ListTemplateVersions.go index af51808161c..0526a87be6e 100644 --- a/service/quicksight/api_op_ListTemplateVersions.go +++ b/service/quicksight/api_op_ListTemplateVersions.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -125,6 +126,88 @@ func addOperationListTemplateVersionsMiddlewares(stack *middleware.Stack, option return nil } +// ListTemplateVersionsAPIClient is a client that implements the +// ListTemplateVersions operation. +type ListTemplateVersionsAPIClient interface { + ListTemplateVersions(context.Context, *ListTemplateVersionsInput, ...func(*Options)) (*ListTemplateVersionsOutput, error) +} + +var _ ListTemplateVersionsAPIClient = (*Client)(nil) + +// ListTemplateVersionsPaginatorOptions is the paginator options for +// ListTemplateVersions +type ListTemplateVersionsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListTemplateVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplateVersions +type ListTemplateVersionsPaginator struct { + options ListTemplateVersionsPaginatorOptions + client ListTemplateVersionsAPIClient + params *ListTemplateVersionsInput + nextToken *string + firstPage bool +} + +// NewListTemplateVersionsPaginator returns a new ListTemplateVersionsPaginator +func NewListTemplateVersionsPaginator(client ListTemplateVersionsAPIClient, params *ListTemplateVersionsInput, optFns ...func(*ListTemplateVersionsPaginatorOptions)) *ListTemplateVersionsPaginator { + options := ListTemplateVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplateVersionsInput{} + } + + return &ListTemplateVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplateVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTemplateVersions page. +func (p *ListTemplateVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplateVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTemplateVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplateVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_ListTemplates.go b/service/quicksight/api_op_ListTemplates.go index 9d88762f805..6a973cfd8b5 100644 --- a/service/quicksight/api_op_ListTemplates.go +++ b/service/quicksight/api_op_ListTemplates.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -119,6 +120,86 @@ func addOperationListTemplatesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListTemplatesAPIClient is a client that implements the ListTemplates operation. +type ListTemplatesAPIClient interface { + ListTemplates(context.Context, *ListTemplatesInput, ...func(*Options)) (*ListTemplatesOutput, error) +} + +var _ ListTemplatesAPIClient = (*Client)(nil) + +// ListTemplatesPaginatorOptions is the paginator options for ListTemplates +type ListTemplatesPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// ListTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.ListTemplates +type ListTemplatesPaginator struct { + options ListTemplatesPaginatorOptions + client ListTemplatesAPIClient + params *ListTemplatesInput + nextToken *string + firstPage bool +} + +// NewListTemplatesPaginator returns a new ListTemplatesPaginator +func NewListTemplatesPaginator(client ListTemplatesAPIClient, params *ListTemplatesInput, optFns ...func(*ListTemplatesPaginatorOptions)) *ListTemplatesPaginator { + options := ListTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTemplatesInput{} + } + + return &ListTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTemplates page. +func (p *ListTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_SearchAnalyses.go b/service/quicksight/api_op_SearchAnalyses.go index 30763cbc39d..875bbe2c32b 100644 --- a/service/quicksight/api_op_SearchAnalyses.go +++ b/service/quicksight/api_op_SearchAnalyses.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -124,6 +125,87 @@ func addOperationSearchAnalysesMiddlewares(stack *middleware.Stack, options Opti return nil } +// SearchAnalysesAPIClient is a client that implements the SearchAnalyses +// operation. +type SearchAnalysesAPIClient interface { + SearchAnalyses(context.Context, *SearchAnalysesInput, ...func(*Options)) (*SearchAnalysesOutput, error) +} + +var _ SearchAnalysesAPIClient = (*Client)(nil) + +// SearchAnalysesPaginatorOptions is the paginator options for SearchAnalyses +type SearchAnalysesPaginatorOptions struct { + // The maximum number of results 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 +} + +// SearchAnalysesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.SearchAnalyses +type SearchAnalysesPaginator struct { + options SearchAnalysesPaginatorOptions + client SearchAnalysesAPIClient + params *SearchAnalysesInput + nextToken *string + firstPage bool +} + +// NewSearchAnalysesPaginator returns a new SearchAnalysesPaginator +func NewSearchAnalysesPaginator(client SearchAnalysesAPIClient, params *SearchAnalysesInput, optFns ...func(*SearchAnalysesPaginatorOptions)) *SearchAnalysesPaginator { + options := SearchAnalysesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchAnalysesInput{} + } + + return &SearchAnalysesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchAnalysesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchAnalyses page. +func (p *SearchAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchAnalysesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.SearchAnalyses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/api_op_SearchDashboards.go b/service/quicksight/api_op_SearchDashboards.go index 08e928245b1..2c45d8514b1 100644 --- a/service/quicksight/api_op_SearchDashboards.go +++ b/service/quicksight/api_op_SearchDashboards.go @@ -4,6 +4,7 @@ package quicksight 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/quicksight/types" @@ -128,6 +129,87 @@ func addOperationSearchDashboardsMiddlewares(stack *middleware.Stack, options Op return nil } +// SearchDashboardsAPIClient is a client that implements the SearchDashboards +// operation. +type SearchDashboardsAPIClient interface { + SearchDashboards(context.Context, *SearchDashboardsInput, ...func(*Options)) (*SearchDashboardsOutput, error) +} + +var _ SearchDashboardsAPIClient = (*Client)(nil) + +// SearchDashboardsPaginatorOptions is the paginator options for SearchDashboards +type SearchDashboardsPaginatorOptions struct { + // The maximum number of results to be returned per request. + 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 +} + +// SearchDashboardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/quicksight.SearchDashboards +type SearchDashboardsPaginator struct { + options SearchDashboardsPaginatorOptions + client SearchDashboardsAPIClient + params *SearchDashboardsInput + nextToken *string + firstPage bool +} + +// NewSearchDashboardsPaginator returns a new SearchDashboardsPaginator +func NewSearchDashboardsPaginator(client SearchDashboardsAPIClient, params *SearchDashboardsInput, optFns ...func(*SearchDashboardsPaginatorOptions)) *SearchDashboardsPaginator { + options := SearchDashboardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchDashboardsInput{} + } + + return &SearchDashboardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDashboardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchDashboards page. +func (p *SearchDashboardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDashboardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.SearchDashboards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchDashboards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/quicksight/endpoints.go b/service/quicksight/endpoints.go index 2dda9fdb79c..5700c63e4c2 100644 --- a/service/quicksight/endpoints.go +++ b/service/quicksight/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ram/api_op_GetResourcePolicies.go b/service/ram/api_op_GetResourcePolicies.go index bc18f6a908f..5ec05ebaaf7 100644 --- a/service/ram/api_op_GetResourcePolicies.go +++ b/service/ram/api_op_GetResourcePolicies.go @@ -4,6 +4,7 @@ package ram 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/awslabs/smithy-go/middleware" @@ -117,6 +118,89 @@ func addOperationGetResourcePoliciesMiddlewares(stack *middleware.Stack, options return nil } +// GetResourcePoliciesAPIClient is a client that implements the GetResourcePolicies +// operation. +type GetResourcePoliciesAPIClient interface { + GetResourcePolicies(context.Context, *GetResourcePoliciesInput, ...func(*Options)) (*GetResourcePoliciesOutput, error) +} + +var _ GetResourcePoliciesAPIClient = (*Client)(nil) + +// GetResourcePoliciesPaginatorOptions is the paginator options for +// GetResourcePolicies +type GetResourcePoliciesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetResourcePoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourcePolicies +type GetResourcePoliciesPaginator struct { + options GetResourcePoliciesPaginatorOptions + client GetResourcePoliciesAPIClient + params *GetResourcePoliciesInput + nextToken *string + firstPage bool +} + +// NewGetResourcePoliciesPaginator returns a new GetResourcePoliciesPaginator +func NewGetResourcePoliciesPaginator(client GetResourcePoliciesAPIClient, params *GetResourcePoliciesInput, optFns ...func(*GetResourcePoliciesPaginatorOptions)) *GetResourcePoliciesPaginator { + options := GetResourcePoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcePoliciesInput{} + } + + return &GetResourcePoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcePoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResourcePolicies page. +func (p *GetResourcePoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcePoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetResourcePolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourcePolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShareAssociations.go b/service/ram/api_op_GetResourceShareAssociations.go index 0e0d841d6b8..d57951f235f 100644 --- a/service/ram/api_op_GetResourceShareAssociations.go +++ b/service/ram/api_op_GetResourceShareAssociations.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -131,6 +132,90 @@ func addOperationGetResourceShareAssociationsMiddlewares(stack *middleware.Stack return nil } +// GetResourceShareAssociationsAPIClient is a client that implements the +// GetResourceShareAssociations operation. +type GetResourceShareAssociationsAPIClient interface { + GetResourceShareAssociations(context.Context, *GetResourceShareAssociationsInput, ...func(*Options)) (*GetResourceShareAssociationsOutput, error) +} + +var _ GetResourceShareAssociationsAPIClient = (*Client)(nil) + +// GetResourceShareAssociationsPaginatorOptions is the paginator options for +// GetResourceShareAssociations +type GetResourceShareAssociationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetResourceShareAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShareAssociations +type GetResourceShareAssociationsPaginator struct { + options GetResourceShareAssociationsPaginatorOptions + client GetResourceShareAssociationsAPIClient + params *GetResourceShareAssociationsInput + nextToken *string + firstPage bool +} + +// NewGetResourceShareAssociationsPaginator returns a new +// GetResourceShareAssociationsPaginator +func NewGetResourceShareAssociationsPaginator(client GetResourceShareAssociationsAPIClient, params *GetResourceShareAssociationsInput, optFns ...func(*GetResourceShareAssociationsPaginatorOptions)) *GetResourceShareAssociationsPaginator { + options := GetResourceShareAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceShareAssociationsInput{} + } + + return &GetResourceShareAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceShareAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResourceShareAssociations page. +func (p *GetResourceShareAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceShareAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetResourceShareAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShareAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShareInvitations.go b/service/ram/api_op_GetResourceShareInvitations.go index 907f5044736..cde15c7c660 100644 --- a/service/ram/api_op_GetResourceShareInvitations.go +++ b/service/ram/api_op_GetResourceShareInvitations.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -113,6 +114,90 @@ func addOperationGetResourceShareInvitationsMiddlewares(stack *middleware.Stack, return nil } +// GetResourceShareInvitationsAPIClient is a client that implements the +// GetResourceShareInvitations operation. +type GetResourceShareInvitationsAPIClient interface { + GetResourceShareInvitations(context.Context, *GetResourceShareInvitationsInput, ...func(*Options)) (*GetResourceShareInvitationsOutput, error) +} + +var _ GetResourceShareInvitationsAPIClient = (*Client)(nil) + +// GetResourceShareInvitationsPaginatorOptions is the paginator options for +// GetResourceShareInvitations +type GetResourceShareInvitationsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetResourceShareInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShareInvitations +type GetResourceShareInvitationsPaginator struct { + options GetResourceShareInvitationsPaginatorOptions + client GetResourceShareInvitationsAPIClient + params *GetResourceShareInvitationsInput + nextToken *string + firstPage bool +} + +// NewGetResourceShareInvitationsPaginator returns a new +// GetResourceShareInvitationsPaginator +func NewGetResourceShareInvitationsPaginator(client GetResourceShareInvitationsAPIClient, params *GetResourceShareInvitationsInput, optFns ...func(*GetResourceShareInvitationsPaginatorOptions)) *GetResourceShareInvitationsPaginator { + options := GetResourceShareInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceShareInvitationsInput{} + } + + return &GetResourceShareInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceShareInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResourceShareInvitations page. +func (p *GetResourceShareInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceShareInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetResourceShareInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShareInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_GetResourceShares.go b/service/ram/api_op_GetResourceShares.go index ad4ead714d1..bd8f628a535 100644 --- a/service/ram/api_op_GetResourceShares.go +++ b/service/ram/api_op_GetResourceShares.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -128,6 +129,88 @@ func addOperationGetResourceSharesMiddlewares(stack *middleware.Stack, options O return nil } +// GetResourceSharesAPIClient is a client that implements the GetResourceShares +// operation. +type GetResourceSharesAPIClient interface { + GetResourceShares(context.Context, *GetResourceSharesInput, ...func(*Options)) (*GetResourceSharesOutput, error) +} + +var _ GetResourceSharesAPIClient = (*Client)(nil) + +// GetResourceSharesPaginatorOptions is the paginator options for GetResourceShares +type GetResourceSharesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// GetResourceSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.GetResourceShares +type GetResourceSharesPaginator struct { + options GetResourceSharesPaginatorOptions + client GetResourceSharesAPIClient + params *GetResourceSharesInput + nextToken *string + firstPage bool +} + +// NewGetResourceSharesPaginator returns a new GetResourceSharesPaginator +func NewGetResourceSharesPaginator(client GetResourceSharesAPIClient, params *GetResourceSharesInput, optFns ...func(*GetResourceSharesPaginatorOptions)) *GetResourceSharesPaginator { + options := GetResourceSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourceSharesInput{} + } + + return &GetResourceSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourceSharesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResourceShares page. +func (p *GetResourceSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourceSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetResourceShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResourceShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListPendingInvitationResources.go b/service/ram/api_op_ListPendingInvitationResources.go index 1af4b003eb7..661486adaea 100644 --- a/service/ram/api_op_ListPendingInvitationResources.go +++ b/service/ram/api_op_ListPendingInvitationResources.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -116,6 +117,90 @@ func addOperationListPendingInvitationResourcesMiddlewares(stack *middleware.Sta return nil } +// ListPendingInvitationResourcesAPIClient is a client that implements the +// ListPendingInvitationResources operation. +type ListPendingInvitationResourcesAPIClient interface { + ListPendingInvitationResources(context.Context, *ListPendingInvitationResourcesInput, ...func(*Options)) (*ListPendingInvitationResourcesOutput, error) +} + +var _ ListPendingInvitationResourcesAPIClient = (*Client)(nil) + +// ListPendingInvitationResourcesPaginatorOptions is the paginator options for +// ListPendingInvitationResources +type ListPendingInvitationResourcesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListPendingInvitationResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListPendingInvitationResources +type ListPendingInvitationResourcesPaginator struct { + options ListPendingInvitationResourcesPaginatorOptions + client ListPendingInvitationResourcesAPIClient + params *ListPendingInvitationResourcesInput + nextToken *string + firstPage bool +} + +// NewListPendingInvitationResourcesPaginator returns a new +// ListPendingInvitationResourcesPaginator +func NewListPendingInvitationResourcesPaginator(client ListPendingInvitationResourcesAPIClient, params *ListPendingInvitationResourcesInput, optFns ...func(*ListPendingInvitationResourcesPaginatorOptions)) *ListPendingInvitationResourcesPaginator { + options := ListPendingInvitationResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPendingInvitationResourcesInput{} + } + + return &ListPendingInvitationResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPendingInvitationResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPendingInvitationResources page. +func (p *ListPendingInvitationResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPendingInvitationResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPendingInvitationResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPendingInvitationResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListPrincipals.go b/service/ram/api_op_ListPrincipals.go index 272d5fda66c..6a4c70b64d6 100644 --- a/service/ram/api_op_ListPrincipals.go +++ b/service/ram/api_op_ListPrincipals.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -133,6 +134,88 @@ func addOperationListPrincipalsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListPrincipalsAPIClient is a client that implements the ListPrincipals +// operation. +type ListPrincipalsAPIClient interface { + ListPrincipals(context.Context, *ListPrincipalsInput, ...func(*Options)) (*ListPrincipalsOutput, error) +} + +var _ ListPrincipalsAPIClient = (*Client)(nil) + +// ListPrincipalsPaginatorOptions is the paginator options for ListPrincipals +type ListPrincipalsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListPrincipalsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListPrincipals +type ListPrincipalsPaginator struct { + options ListPrincipalsPaginatorOptions + client ListPrincipalsAPIClient + params *ListPrincipalsInput + nextToken *string + firstPage bool +} + +// NewListPrincipalsPaginator returns a new ListPrincipalsPaginator +func NewListPrincipalsPaginator(client ListPrincipalsAPIClient, params *ListPrincipalsInput, optFns ...func(*ListPrincipalsPaginatorOptions)) *ListPrincipalsPaginator { + options := ListPrincipalsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalsInput{} + } + + return &ListPrincipalsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPrincipals page. +func (p *ListPrincipalsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPrincipals(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipals(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/api_op_ListResources.go b/service/ram/api_op_ListResources.go index 9ac08b52272..f1023d805f8 100644 --- a/service/ram/api_op_ListResources.go +++ b/service/ram/api_op_ListResources.go @@ -4,6 +4,7 @@ package ram 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/ram/types" @@ -133,6 +134,87 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + 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 +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ram.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ram/endpoints.go b/service/ram/endpoints.go index 4ee0d9f4876..42e4a077546 100644 --- a/service/ram/endpoints.go +++ b/service/ram/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/rds/api_op_DescribeCertificates.go b/service/rds/api_op_DescribeCertificates.go index 3310ed6edfc..94fbf001ce6 100644 --- a/service/rds/api_op_DescribeCertificates.go +++ b/service/rds/api_op_DescribeCertificates.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -128,6 +129,91 @@ func addOperationDescribeCertificatesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeCertificatesAPIClient is a client that implements the +// DescribeCertificates operation. +type DescribeCertificatesAPIClient interface { + DescribeCertificates(context.Context, *DescribeCertificatesInput, ...func(*Options)) (*DescribeCertificatesOutput, error) +} + +var _ DescribeCertificatesAPIClient = (*Client)(nil) + +// DescribeCertificatesPaginatorOptions is the paginator options for +// DescribeCertificates +type DescribeCertificatesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeCertificates +type DescribeCertificatesPaginator struct { + options DescribeCertificatesPaginatorOptions + client DescribeCertificatesAPIClient + params *DescribeCertificatesInput + nextToken *string + firstPage bool +} + +// NewDescribeCertificatesPaginator returns a new DescribeCertificatesPaginator +func NewDescribeCertificatesPaginator(client DescribeCertificatesAPIClient, params *DescribeCertificatesInput, optFns ...func(*DescribeCertificatesPaginatorOptions)) *DescribeCertificatesPaginator { + options := DescribeCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCertificatesInput{} + } + + return &DescribeCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCertificates page. +func (p *DescribeCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeCustomAvailabilityZones.go b/service/rds/api_op_DescribeCustomAvailabilityZones.go index 9e77268fc18..9bd1d61d78e 100644 --- a/service/rds/api_op_DescribeCustomAvailabilityZones.go +++ b/service/rds/api_op_DescribeCustomAvailabilityZones.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -127,6 +128,92 @@ func addOperationDescribeCustomAvailabilityZonesMiddlewares(stack *middleware.St return nil } +// DescribeCustomAvailabilityZonesAPIClient is a client that implements the +// DescribeCustomAvailabilityZones operation. +type DescribeCustomAvailabilityZonesAPIClient interface { + DescribeCustomAvailabilityZones(context.Context, *DescribeCustomAvailabilityZonesInput, ...func(*Options)) (*DescribeCustomAvailabilityZonesOutput, error) +} + +var _ DescribeCustomAvailabilityZonesAPIClient = (*Client)(nil) + +// DescribeCustomAvailabilityZonesPaginatorOptions is the paginator options for +// DescribeCustomAvailabilityZones +type DescribeCustomAvailabilityZonesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeCustomAvailabilityZonesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeCustomAvailabilityZones +type DescribeCustomAvailabilityZonesPaginator struct { + options DescribeCustomAvailabilityZonesPaginatorOptions + client DescribeCustomAvailabilityZonesAPIClient + params *DescribeCustomAvailabilityZonesInput + nextToken *string + firstPage bool +} + +// NewDescribeCustomAvailabilityZonesPaginator returns a new +// DescribeCustomAvailabilityZonesPaginator +func NewDescribeCustomAvailabilityZonesPaginator(client DescribeCustomAvailabilityZonesAPIClient, params *DescribeCustomAvailabilityZonesInput, optFns ...func(*DescribeCustomAvailabilityZonesPaginatorOptions)) *DescribeCustomAvailabilityZonesPaginator { + options := DescribeCustomAvailabilityZonesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCustomAvailabilityZonesInput{} + } + + return &DescribeCustomAvailabilityZonesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCustomAvailabilityZonesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCustomAvailabilityZones page. +func (p *DescribeCustomAvailabilityZonesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCustomAvailabilityZonesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeCustomAvailabilityZones(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCustomAvailabilityZones(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterBacktracks.go b/service/rds/api_op_DescribeDBClusterBacktracks.go index 47d6091cab9..421dcee61e0 100644 --- a/service/rds/api_op_DescribeDBClusterBacktracks.go +++ b/service/rds/api_op_DescribeDBClusterBacktracks.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -172,6 +173,92 @@ func addOperationDescribeDBClusterBacktracksMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterBacktracksAPIClient is a client that implements the +// DescribeDBClusterBacktracks operation. +type DescribeDBClusterBacktracksAPIClient interface { + DescribeDBClusterBacktracks(context.Context, *DescribeDBClusterBacktracksInput, ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) +} + +var _ DescribeDBClusterBacktracksAPIClient = (*Client)(nil) + +// DescribeDBClusterBacktracksPaginatorOptions is the paginator options for +// DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterBacktracksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterBacktracks +type DescribeDBClusterBacktracksPaginator struct { + options DescribeDBClusterBacktracksPaginatorOptions + client DescribeDBClusterBacktracksAPIClient + params *DescribeDBClusterBacktracksInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterBacktracksPaginator returns a new +// DescribeDBClusterBacktracksPaginator +func NewDescribeDBClusterBacktracksPaginator(client DescribeDBClusterBacktracksAPIClient, params *DescribeDBClusterBacktracksInput, optFns ...func(*DescribeDBClusterBacktracksPaginatorOptions)) *DescribeDBClusterBacktracksPaginator { + options := DescribeDBClusterBacktracksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterBacktracksInput{} + } + + return &DescribeDBClusterBacktracksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterBacktracksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterBacktracks page. +func (p *DescribeDBClusterBacktracksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterBacktracksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterBacktracks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterBacktracks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterEndpoints.go b/service/rds/api_op_DescribeDBClusterEndpoints.go index 7751024526a..314cb0fc95a 100644 --- a/service/rds/api_op_DescribeDBClusterEndpoints.go +++ b/service/rds/api_op_DescribeDBClusterEndpoints.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -136,6 +137,92 @@ func addOperationDescribeDBClusterEndpointsMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterEndpointsAPIClient is a client that implements the +// DescribeDBClusterEndpoints operation. +type DescribeDBClusterEndpointsAPIClient interface { + DescribeDBClusterEndpoints(context.Context, *DescribeDBClusterEndpointsInput, ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) +} + +var _ DescribeDBClusterEndpointsAPIClient = (*Client)(nil) + +// DescribeDBClusterEndpointsPaginatorOptions is the paginator options for +// DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterEndpoints +type DescribeDBClusterEndpointsPaginator struct { + options DescribeDBClusterEndpointsPaginatorOptions + client DescribeDBClusterEndpointsAPIClient + params *DescribeDBClusterEndpointsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterEndpointsPaginator returns a new +// DescribeDBClusterEndpointsPaginator +func NewDescribeDBClusterEndpointsPaginator(client DescribeDBClusterEndpointsAPIClient, params *DescribeDBClusterEndpointsInput, optFns ...func(*DescribeDBClusterEndpointsPaginatorOptions)) *DescribeDBClusterEndpointsPaginator { + options := DescribeDBClusterEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterEndpointsInput{} + } + + return &DescribeDBClusterEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterEndpoints page. +func (p *DescribeDBClusterEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterParameterGroups.go b/service/rds/api_op_DescribeDBClusterParameterGroups.go index 044ea92774d..2683bb90acc 100644 --- a/service/rds/api_op_DescribeDBClusterParameterGroups.go +++ b/service/rds/api_op_DescribeDBClusterParameterGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -134,6 +135,92 @@ func addOperationDescribeDBClusterParameterGroupsMiddlewares(stack *middleware.S return nil } +// DescribeDBClusterParameterGroupsAPIClient is a client that implements the +// DescribeDBClusterParameterGroups operation. +type DescribeDBClusterParameterGroupsAPIClient interface { + DescribeDBClusterParameterGroups(context.Context, *DescribeDBClusterParameterGroupsInput, ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) +} + +var _ DescribeDBClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterParameterGroups +type DescribeDBClusterParameterGroupsPaginator struct { + options DescribeDBClusterParameterGroupsPaginatorOptions + client DescribeDBClusterParameterGroupsAPIClient + params *DescribeDBClusterParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParameterGroupsPaginator returns a new +// DescribeDBClusterParameterGroupsPaginator +func NewDescribeDBClusterParameterGroupsPaginator(client DescribeDBClusterParameterGroupsAPIClient, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*DescribeDBClusterParameterGroupsPaginatorOptions)) *DescribeDBClusterParameterGroupsPaginator { + options := DescribeDBClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParameterGroupsInput{} + } + + return &DescribeDBClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterParameterGroups page. +func (p *DescribeDBClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterParameters.go b/service/rds/api_op_DescribeDBClusterParameters.go index 73244c61884..18cec9b6c33 100644 --- a/service/rds/api_op_DescribeDBClusterParameters.go +++ b/service/rds/api_op_DescribeDBClusterParameters.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -137,6 +138,92 @@ func addOperationDescribeDBClusterParametersMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterParametersAPIClient is a client that implements the +// DescribeDBClusterParameters operation. +type DescribeDBClusterParametersAPIClient interface { + DescribeDBClusterParameters(context.Context, *DescribeDBClusterParametersInput, ...func(*Options)) (*DescribeDBClusterParametersOutput, error) +} + +var _ DescribeDBClusterParametersAPIClient = (*Client)(nil) + +// DescribeDBClusterParametersPaginatorOptions is the paginator options for +// DescribeDBClusterParameters +type DescribeDBClusterParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterParameters +type DescribeDBClusterParametersPaginator struct { + options DescribeDBClusterParametersPaginatorOptions + client DescribeDBClusterParametersAPIClient + params *DescribeDBClusterParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterParametersPaginator returns a new +// DescribeDBClusterParametersPaginator +func NewDescribeDBClusterParametersPaginator(client DescribeDBClusterParametersAPIClient, params *DescribeDBClusterParametersInput, optFns ...func(*DescribeDBClusterParametersPaginatorOptions)) *DescribeDBClusterParametersPaginator { + options := DescribeDBClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterParametersInput{} + } + + return &DescribeDBClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterParameters page. +func (p *DescribeDBClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusterSnapshots.go b/service/rds/api_op_DescribeDBClusterSnapshots.go index 7748e029553..b11c3c2fe03 100644 --- a/service/rds/api_op_DescribeDBClusterSnapshots.go +++ b/service/rds/api_op_DescribeDBClusterSnapshots.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -194,6 +195,92 @@ func addOperationDescribeDBClusterSnapshotsMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBClusterSnapshotsAPIClient is a client that implements the +// DescribeDBClusterSnapshots operation. +type DescribeDBClusterSnapshotsAPIClient interface { + DescribeDBClusterSnapshots(context.Context, *DescribeDBClusterSnapshotsInput, ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) +} + +var _ DescribeDBClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusterSnapshots +type DescribeDBClusterSnapshotsPaginator struct { + options DescribeDBClusterSnapshotsPaginatorOptions + client DescribeDBClusterSnapshotsAPIClient + params *DescribeDBClusterSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClusterSnapshotsPaginator returns a new +// DescribeDBClusterSnapshotsPaginator +func NewDescribeDBClusterSnapshotsPaginator(client DescribeDBClusterSnapshotsAPIClient, params *DescribeDBClusterSnapshotsInput, optFns ...func(*DescribeDBClusterSnapshotsPaginatorOptions)) *DescribeDBClusterSnapshotsPaginator { + options := DescribeDBClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClusterSnapshotsInput{} + } + + return &DescribeDBClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClusterSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusterSnapshots page. +func (p *DescribeDBClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBClusters.go b/service/rds/api_op_DescribeDBClusters.go index adc6877852e..39feeabcbaa 100644 --- a/service/rds/api_op_DescribeDBClusters.go +++ b/service/rds/api_op_DescribeDBClusters.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -139,6 +140,91 @@ func addOperationDescribeDBClustersMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBClustersAPIClient is a client that implements the DescribeDBClusters +// operation. +type DescribeDBClustersAPIClient interface { + DescribeDBClusters(context.Context, *DescribeDBClustersInput, ...func(*Options)) (*DescribeDBClustersOutput, error) +} + +var _ DescribeDBClustersAPIClient = (*Client)(nil) + +// DescribeDBClustersPaginatorOptions is the paginator options for +// DescribeDBClusters +type DescribeDBClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBClusters +type DescribeDBClustersPaginator struct { + options DescribeDBClustersPaginatorOptions + client DescribeDBClustersAPIClient + params *DescribeDBClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBClustersPaginator returns a new DescribeDBClustersPaginator +func NewDescribeDBClustersPaginator(client DescribeDBClustersAPIClient, params *DescribeDBClustersInput, optFns ...func(*DescribeDBClustersPaginatorOptions)) *DescribeDBClustersPaginator { + options := DescribeDBClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBClustersInput{} + } + + return &DescribeDBClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBClusters page. +func (p *DescribeDBClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBEngineVersions.go b/service/rds/api_op_DescribeDBEngineVersions.go index 33cf14802cd..3102e65ff0c 100644 --- a/service/rds/api_op_DescribeDBEngineVersions.go +++ b/service/rds/api_op_DescribeDBEngineVersions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -152,6 +153,92 @@ func addOperationDescribeDBEngineVersionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeDBEngineVersionsAPIClient is a client that implements the +// DescribeDBEngineVersions operation. +type DescribeDBEngineVersionsAPIClient interface { + DescribeDBEngineVersions(context.Context, *DescribeDBEngineVersionsInput, ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) +} + +var _ DescribeDBEngineVersionsAPIClient = (*Client)(nil) + +// DescribeDBEngineVersionsPaginatorOptions is the paginator options for +// DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBEngineVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBEngineVersions +type DescribeDBEngineVersionsPaginator struct { + options DescribeDBEngineVersionsPaginatorOptions + client DescribeDBEngineVersionsAPIClient + params *DescribeDBEngineVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBEngineVersionsPaginator returns a new +// DescribeDBEngineVersionsPaginator +func NewDescribeDBEngineVersionsPaginator(client DescribeDBEngineVersionsAPIClient, params *DescribeDBEngineVersionsInput, optFns ...func(*DescribeDBEngineVersionsPaginatorOptions)) *DescribeDBEngineVersionsPaginator { + options := DescribeDBEngineVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBEngineVersionsInput{} + } + + return &DescribeDBEngineVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBEngineVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBEngineVersions page. +func (p *DescribeDBEngineVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBEngineVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBEngineVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBEngineVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go index d00f0a7ebc3..b08d6a88aaf 100644 --- a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go +++ b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -159,6 +160,91 @@ func addOperationDescribeDBInstanceAutomatedBackupsMiddlewares(stack *middleware return nil } +// DescribeDBInstanceAutomatedBackupsAPIClient is a client that implements the +// DescribeDBInstanceAutomatedBackups operation. +type DescribeDBInstanceAutomatedBackupsAPIClient interface { + DescribeDBInstanceAutomatedBackups(context.Context, *DescribeDBInstanceAutomatedBackupsInput, ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) +} + +var _ DescribeDBInstanceAutomatedBackupsAPIClient = (*Client)(nil) + +// DescribeDBInstanceAutomatedBackupsPaginatorOptions is the paginator options for +// DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + 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 +} + +// DescribeDBInstanceAutomatedBackupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBInstanceAutomatedBackups +type DescribeDBInstanceAutomatedBackupsPaginator struct { + options DescribeDBInstanceAutomatedBackupsPaginatorOptions + client DescribeDBInstanceAutomatedBackupsAPIClient + params *DescribeDBInstanceAutomatedBackupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstanceAutomatedBackupsPaginator returns a new +// DescribeDBInstanceAutomatedBackupsPaginator +func NewDescribeDBInstanceAutomatedBackupsPaginator(client DescribeDBInstanceAutomatedBackupsAPIClient, params *DescribeDBInstanceAutomatedBackupsInput, optFns ...func(*DescribeDBInstanceAutomatedBackupsPaginatorOptions)) *DescribeDBInstanceAutomatedBackupsPaginator { + options := DescribeDBInstanceAutomatedBackupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstanceAutomatedBackupsInput{} + } + + return &DescribeDBInstanceAutomatedBackupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstanceAutomatedBackupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBInstanceAutomatedBackups page. +func (p *DescribeDBInstanceAutomatedBackupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstanceAutomatedBackupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBInstanceAutomatedBackups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstanceAutomatedBackups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBInstances.go b/service/rds/api_op_DescribeDBInstances.go index 961a2f97e5e..8d12a009292 100644 --- a/service/rds/api_op_DescribeDBInstances.go +++ b/service/rds/api_op_DescribeDBInstances.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -153,6 +154,91 @@ func addOperationDescribeDBInstancesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBInstancesAPIClient is a client that implements the DescribeDBInstances +// operation. +type DescribeDBInstancesAPIClient interface { + DescribeDBInstances(context.Context, *DescribeDBInstancesInput, ...func(*Options)) (*DescribeDBInstancesOutput, error) +} + +var _ DescribeDBInstancesAPIClient = (*Client)(nil) + +// DescribeDBInstancesPaginatorOptions is the paginator options for +// DescribeDBInstances +type DescribeDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBInstances +type DescribeDBInstancesPaginator struct { + options DescribeDBInstancesPaginatorOptions + client DescribeDBInstancesAPIClient + params *DescribeDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBInstancesPaginator returns a new DescribeDBInstancesPaginator +func NewDescribeDBInstancesPaginator(client DescribeDBInstancesAPIClient, params *DescribeDBInstancesInput, optFns ...func(*DescribeDBInstancesPaginatorOptions)) *DescribeDBInstancesPaginator { + options := DescribeDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBInstancesInput{} + } + + return &DescribeDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBInstances page. +func (p *DescribeDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBLogFiles.go b/service/rds/api_op_DescribeDBLogFiles.go index 99c19fac9e7..5a2639bb091 100644 --- a/service/rds/api_op_DescribeDBLogFiles.go +++ b/service/rds/api_op_DescribeDBLogFiles.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -137,6 +138,90 @@ func addOperationDescribeDBLogFilesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBLogFilesAPIClient is a client that implements the DescribeDBLogFiles +// operation. +type DescribeDBLogFilesAPIClient interface { + DescribeDBLogFiles(context.Context, *DescribeDBLogFilesInput, ...func(*Options)) (*DescribeDBLogFilesOutput, error) +} + +var _ DescribeDBLogFilesAPIClient = (*Client)(nil) + +// DescribeDBLogFilesPaginatorOptions is the paginator options for +// DescribeDBLogFiles +type DescribeDBLogFilesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. + 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 +} + +// DescribeDBLogFilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBLogFiles +type DescribeDBLogFilesPaginator struct { + options DescribeDBLogFilesPaginatorOptions + client DescribeDBLogFilesAPIClient + params *DescribeDBLogFilesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBLogFilesPaginator returns a new DescribeDBLogFilesPaginator +func NewDescribeDBLogFilesPaginator(client DescribeDBLogFilesAPIClient, params *DescribeDBLogFilesInput, optFns ...func(*DescribeDBLogFilesPaginatorOptions)) *DescribeDBLogFilesPaginator { + options := DescribeDBLogFilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBLogFilesInput{} + } + + return &DescribeDBLogFilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBLogFilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBLogFiles page. +func (p *DescribeDBLogFilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBLogFilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBLogFiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBLogFiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBParameterGroups.go b/service/rds/api_op_DescribeDBParameterGroups.go index de187084538..2ddc1524819 100644 --- a/service/rds/api_op_DescribeDBParameterGroups.go +++ b/service/rds/api_op_DescribeDBParameterGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -129,6 +130,92 @@ func addOperationDescribeDBParameterGroupsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeDBParameterGroupsAPIClient is a client that implements the +// DescribeDBParameterGroups operation. +type DescribeDBParameterGroupsAPIClient interface { + DescribeDBParameterGroups(context.Context, *DescribeDBParameterGroupsInput, ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) +} + +var _ DescribeDBParameterGroupsAPIClient = (*Client)(nil) + +// DescribeDBParameterGroupsPaginatorOptions is the paginator options for +// DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBParameterGroups +type DescribeDBParameterGroupsPaginator struct { + options DescribeDBParameterGroupsPaginatorOptions + client DescribeDBParameterGroupsAPIClient + params *DescribeDBParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParameterGroupsPaginator returns a new +// DescribeDBParameterGroupsPaginator +func NewDescribeDBParameterGroupsPaginator(client DescribeDBParameterGroupsAPIClient, params *DescribeDBParameterGroupsInput, optFns ...func(*DescribeDBParameterGroupsPaginatorOptions)) *DescribeDBParameterGroupsPaginator { + options := DescribeDBParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParameterGroupsInput{} + } + + return &DescribeDBParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBParameterGroups page. +func (p *DescribeDBParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBParameters.go b/service/rds/api_op_DescribeDBParameters.go index 40b8445e925..3070080f84c 100644 --- a/service/rds/api_op_DescribeDBParameters.go +++ b/service/rds/api_op_DescribeDBParameters.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -132,6 +133,91 @@ func addOperationDescribeDBParametersMiddlewares(stack *middleware.Stack, option return nil } +// DescribeDBParametersAPIClient is a client that implements the +// DescribeDBParameters operation. +type DescribeDBParametersAPIClient interface { + DescribeDBParameters(context.Context, *DescribeDBParametersInput, ...func(*Options)) (*DescribeDBParametersOutput, error) +} + +var _ DescribeDBParametersAPIClient = (*Client)(nil) + +// DescribeDBParametersPaginatorOptions is the paginator options for +// DescribeDBParameters +type DescribeDBParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBParameters +type DescribeDBParametersPaginator struct { + options DescribeDBParametersPaginatorOptions + client DescribeDBParametersAPIClient + params *DescribeDBParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDBParametersPaginator returns a new DescribeDBParametersPaginator +func NewDescribeDBParametersPaginator(client DescribeDBParametersAPIClient, params *DescribeDBParametersInput, optFns ...func(*DescribeDBParametersPaginatorOptions)) *DescribeDBParametersPaginator { + options := DescribeDBParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBParametersInput{} + } + + return &DescribeDBParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBParameters page. +func (p *DescribeDBParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxies.go b/service/rds/api_op_DescribeDBProxies.go index e5ff02933ff..dfe7d238577 100644 --- a/service/rds/api_op_DescribeDBProxies.go +++ b/service/rds/api_op_DescribeDBProxies.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -121,6 +122,90 @@ func addOperationDescribeDBProxiesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeDBProxiesAPIClient is a client that implements the DescribeDBProxies +// operation. +type DescribeDBProxiesAPIClient interface { + DescribeDBProxies(context.Context, *DescribeDBProxiesInput, ...func(*Options)) (*DescribeDBProxiesOutput, error) +} + +var _ DescribeDBProxiesAPIClient = (*Client)(nil) + +// DescribeDBProxiesPaginatorOptions is the paginator options for DescribeDBProxies +type DescribeDBProxiesPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBProxiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxies +type DescribeDBProxiesPaginator struct { + options DescribeDBProxiesPaginatorOptions + client DescribeDBProxiesAPIClient + params *DescribeDBProxiesInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxiesPaginator returns a new DescribeDBProxiesPaginator +func NewDescribeDBProxiesPaginator(client DescribeDBProxiesAPIClient, params *DescribeDBProxiesInput, optFns ...func(*DescribeDBProxiesPaginatorOptions)) *DescribeDBProxiesPaginator { + options := DescribeDBProxiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxiesInput{} + } + + return &DescribeDBProxiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBProxies page. +func (p *DescribeDBProxiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBProxies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxyTargetGroups.go b/service/rds/api_op_DescribeDBProxyTargetGroups.go index 5b65c23899d..3cc9eba5dd2 100644 --- a/service/rds/api_op_DescribeDBProxyTargetGroups.go +++ b/service/rds/api_op_DescribeDBProxyTargetGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -128,6 +129,92 @@ func addOperationDescribeDBProxyTargetGroupsMiddlewares(stack *middleware.Stack, return nil } +// DescribeDBProxyTargetGroupsAPIClient is a client that implements the +// DescribeDBProxyTargetGroups operation. +type DescribeDBProxyTargetGroupsAPIClient interface { + DescribeDBProxyTargetGroups(context.Context, *DescribeDBProxyTargetGroupsInput, ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) +} + +var _ DescribeDBProxyTargetGroupsAPIClient = (*Client)(nil) + +// DescribeDBProxyTargetGroupsPaginatorOptions is the paginator options for +// DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBProxyTargetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxyTargetGroups +type DescribeDBProxyTargetGroupsPaginator struct { + options DescribeDBProxyTargetGroupsPaginatorOptions + client DescribeDBProxyTargetGroupsAPIClient + params *DescribeDBProxyTargetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxyTargetGroupsPaginator returns a new +// DescribeDBProxyTargetGroupsPaginator +func NewDescribeDBProxyTargetGroupsPaginator(client DescribeDBProxyTargetGroupsAPIClient, params *DescribeDBProxyTargetGroupsInput, optFns ...func(*DescribeDBProxyTargetGroupsPaginatorOptions)) *DescribeDBProxyTargetGroupsPaginator { + options := DescribeDBProxyTargetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxyTargetGroupsInput{} + } + + return &DescribeDBProxyTargetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBProxyTargetGroups page. +func (p *DescribeDBProxyTargetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBProxyTargetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxyTargetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBProxyTargets.go b/service/rds/api_op_DescribeDBProxyTargets.go index dd3d5be080e..2215457c2ee 100644 --- a/service/rds/api_op_DescribeDBProxyTargets.go +++ b/service/rds/api_op_DescribeDBProxyTargets.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -127,6 +128,91 @@ func addOperationDescribeDBProxyTargetsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeDBProxyTargetsAPIClient is a client that implements the +// DescribeDBProxyTargets operation. +type DescribeDBProxyTargetsAPIClient interface { + DescribeDBProxyTargets(context.Context, *DescribeDBProxyTargetsInput, ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) +} + +var _ DescribeDBProxyTargetsAPIClient = (*Client)(nil) + +// DescribeDBProxyTargetsPaginatorOptions is the paginator options for +// DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that the remaining results can be retrieved. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBProxyTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBProxyTargets +type DescribeDBProxyTargetsPaginator struct { + options DescribeDBProxyTargetsPaginatorOptions + client DescribeDBProxyTargetsAPIClient + params *DescribeDBProxyTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBProxyTargetsPaginator returns a new DescribeDBProxyTargetsPaginator +func NewDescribeDBProxyTargetsPaginator(client DescribeDBProxyTargetsAPIClient, params *DescribeDBProxyTargetsInput, optFns ...func(*DescribeDBProxyTargetsPaginatorOptions)) *DescribeDBProxyTargetsPaginator { + options := DescribeDBProxyTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBProxyTargetsInput{} + } + + return &DescribeDBProxyTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBProxyTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBProxyTargets page. +func (p *DescribeDBProxyTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBProxyTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBProxyTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBProxyTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSecurityGroups.go b/service/rds/api_op_DescribeDBSecurityGroups.go index 505bdeec534..92a0aa27974 100644 --- a/service/rds/api_op_DescribeDBSecurityGroups.go +++ b/service/rds/api_op_DescribeDBSecurityGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -126,6 +127,92 @@ func addOperationDescribeDBSecurityGroupsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeDBSecurityGroupsAPIClient is a client that implements the +// DescribeDBSecurityGroups operation. +type DescribeDBSecurityGroupsAPIClient interface { + DescribeDBSecurityGroups(context.Context, *DescribeDBSecurityGroupsInput, ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) +} + +var _ DescribeDBSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeDBSecurityGroupsPaginatorOptions is the paginator options for +// DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSecurityGroups +type DescribeDBSecurityGroupsPaginator struct { + options DescribeDBSecurityGroupsPaginatorOptions + client DescribeDBSecurityGroupsAPIClient + params *DescribeDBSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSecurityGroupsPaginator returns a new +// DescribeDBSecurityGroupsPaginator +func NewDescribeDBSecurityGroupsPaginator(client DescribeDBSecurityGroupsAPIClient, params *DescribeDBSecurityGroupsInput, optFns ...func(*DescribeDBSecurityGroupsPaginatorOptions)) *DescribeDBSecurityGroupsPaginator { + options := DescribeDBSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSecurityGroupsInput{} + } + + return &DescribeDBSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBSecurityGroups page. +func (p *DescribeDBSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSnapshots.go b/service/rds/api_op_DescribeDBSnapshots.go index 6f9598e4c31..fc6238c1605 100644 --- a/service/rds/api_op_DescribeDBSnapshots.go +++ b/service/rds/api_op_DescribeDBSnapshots.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -203,6 +204,91 @@ func addOperationDescribeDBSnapshotsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeDBSnapshotsAPIClient is a client that implements the DescribeDBSnapshots +// operation. +type DescribeDBSnapshotsAPIClient interface { + DescribeDBSnapshots(context.Context, *DescribeDBSnapshotsInput, ...func(*Options)) (*DescribeDBSnapshotsOutput, error) +} + +var _ DescribeDBSnapshotsAPIClient = (*Client)(nil) + +// DescribeDBSnapshotsPaginatorOptions is the paginator options for +// DescribeDBSnapshots +type DescribeDBSnapshotsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSnapshots +type DescribeDBSnapshotsPaginator struct { + options DescribeDBSnapshotsPaginatorOptions + client DescribeDBSnapshotsAPIClient + params *DescribeDBSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSnapshotsPaginator returns a new DescribeDBSnapshotsPaginator +func NewDescribeDBSnapshotsPaginator(client DescribeDBSnapshotsAPIClient, params *DescribeDBSnapshotsInput, optFns ...func(*DescribeDBSnapshotsPaginatorOptions)) *DescribeDBSnapshotsPaginator { + options := DescribeDBSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSnapshotsInput{} + } + + return &DescribeDBSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBSnapshots page. +func (p *DescribeDBSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeDBSubnetGroups.go b/service/rds/api_op_DescribeDBSubnetGroups.go index 98d5d1c340e..5595b4030f3 100644 --- a/service/rds/api_op_DescribeDBSubnetGroups.go +++ b/service/rds/api_op_DescribeDBSubnetGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -127,6 +128,91 @@ func addOperationDescribeDBSubnetGroupsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeDBSubnetGroupsAPIClient is a client that implements the +// DescribeDBSubnetGroups operation. +type DescribeDBSubnetGroupsAPIClient interface { + DescribeDBSubnetGroups(context.Context, *DescribeDBSubnetGroupsInput, ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) +} + +var _ DescribeDBSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeDBSubnetGroupsPaginatorOptions is the paginator options for +// DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeDBSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeDBSubnetGroups +type DescribeDBSubnetGroupsPaginator struct { + options DescribeDBSubnetGroupsPaginatorOptions + client DescribeDBSubnetGroupsAPIClient + params *DescribeDBSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeDBSubnetGroupsPaginator returns a new DescribeDBSubnetGroupsPaginator +func NewDescribeDBSubnetGroupsPaginator(client DescribeDBSubnetGroupsAPIClient, params *DescribeDBSubnetGroupsInput, optFns ...func(*DescribeDBSubnetGroupsPaginatorOptions)) *DescribeDBSubnetGroupsPaginator { + options := DescribeDBSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDBSubnetGroupsInput{} + } + + return &DescribeDBSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDBSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDBSubnetGroups page. +func (p *DescribeDBSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDBSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDBSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDBSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEngineDefaultParameters.go b/service/rds/api_op_DescribeEngineDefaultParameters.go index d7b26e601c3..77cbdcbe547 100644 --- a/service/rds/api_op_DescribeEngineDefaultParameters.go +++ b/service/rds/api_op_DescribeEngineDefaultParameters.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -122,6 +123,94 @@ func addOperationDescribeEngineDefaultParametersMiddlewares(stack *middleware.St return nil } +// DescribeEngineDefaultParametersAPIClient is a client that implements the +// DescribeEngineDefaultParameters operation. +type DescribeEngineDefaultParametersAPIClient interface { + DescribeEngineDefaultParameters(context.Context, *DescribeEngineDefaultParametersInput, ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) +} + +var _ DescribeEngineDefaultParametersAPIClient = (*Client)(nil) + +// DescribeEngineDefaultParametersPaginatorOptions is the paginator options for +// DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEngineDefaultParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEngineDefaultParameters +type DescribeEngineDefaultParametersPaginator struct { + options DescribeEngineDefaultParametersPaginatorOptions + client DescribeEngineDefaultParametersAPIClient + params *DescribeEngineDefaultParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeEngineDefaultParametersPaginator returns a new +// DescribeEngineDefaultParametersPaginator +func NewDescribeEngineDefaultParametersPaginator(client DescribeEngineDefaultParametersAPIClient, params *DescribeEngineDefaultParametersInput, optFns ...func(*DescribeEngineDefaultParametersPaginatorOptions)) *DescribeEngineDefaultParametersPaginator { + options := DescribeEngineDefaultParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEngineDefaultParametersInput{} + } + + return &DescribeEngineDefaultParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEngineDefaultParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEngineDefaultParameters page. +func (p *DescribeEngineDefaultParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEngineDefaultParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEngineDefaultParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.EngineDefaults != nil { + p.nextToken = result.EngineDefaults.Marker + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEngineDefaultParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEventSubscriptions.go b/service/rds/api_op_DescribeEventSubscriptions.go index 9103ef51c33..08a844577dd 100644 --- a/service/rds/api_op_DescribeEventSubscriptions.go +++ b/service/rds/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -128,6 +129,92 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeEvents.go b/service/rds/api_op_DescribeEvents.go index 9d14c8b26a5..bbd78a92506 100644 --- a/service/rds/api_op_DescribeEvents.go +++ b/service/rds/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -176,6 +177,90 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeExportTasks.go b/service/rds/api_op_DescribeExportTasks.go index 39d031a7315..259f15c7547 100644 --- a/service/rds/api_op_DescribeExportTasks.go +++ b/service/rds/api_op_DescribeExportTasks.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -140,6 +141,92 @@ func addOperationDescribeExportTasksMiddlewares(stack *middleware.Stack, options return nil } +// DescribeExportTasksAPIClient is a client that implements the DescribeExportTasks +// operation. +type DescribeExportTasksAPIClient interface { + DescribeExportTasks(context.Context, *DescribeExportTasksInput, ...func(*Options)) (*DescribeExportTasksOutput, error) +} + +var _ DescribeExportTasksAPIClient = (*Client)(nil) + +// DescribeExportTasksPaginatorOptions is the paginator options for +// DescribeExportTasks +type DescribeExportTasksPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified value, a pagination token called a marker is included in the + // response. You can use the marker in a later DescribeExportTasks request to + // retrieve the remaining results. Default: 100 Constraints: Minimum 20, maximum + // 100. + 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 +} + +// DescribeExportTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeExportTasks +type DescribeExportTasksPaginator struct { + options DescribeExportTasksPaginatorOptions + client DescribeExportTasksAPIClient + params *DescribeExportTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeExportTasksPaginator returns a new DescribeExportTasksPaginator +func NewDescribeExportTasksPaginator(client DescribeExportTasksAPIClient, params *DescribeExportTasksInput, optFns ...func(*DescribeExportTasksPaginatorOptions)) *DescribeExportTasksPaginator { + options := DescribeExportTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeExportTasksInput{} + } + + return &DescribeExportTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeExportTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeExportTasks page. +func (p *DescribeExportTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeExportTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeExportTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeGlobalClusters.go b/service/rds/api_op_DescribeGlobalClusters.go index ddfa8ea37f3..1bc1f5d9aba 100644 --- a/service/rds/api_op_DescribeGlobalClusters.go +++ b/service/rds/api_op_DescribeGlobalClusters.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -134,6 +135,91 @@ func addOperationDescribeGlobalClustersMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeGlobalClustersAPIClient is a client that implements the +// DescribeGlobalClusters operation. +type DescribeGlobalClustersAPIClient interface { + DescribeGlobalClusters(context.Context, *DescribeGlobalClustersInput, ...func(*Options)) (*DescribeGlobalClustersOutput, error) +} + +var _ DescribeGlobalClustersAPIClient = (*Client)(nil) + +// DescribeGlobalClustersPaginatorOptions is the paginator options for +// DescribeGlobalClusters +type DescribeGlobalClustersPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeGlobalClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeGlobalClusters +type DescribeGlobalClustersPaginator struct { + options DescribeGlobalClustersPaginatorOptions + client DescribeGlobalClustersAPIClient + params *DescribeGlobalClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeGlobalClustersPaginator returns a new DescribeGlobalClustersPaginator +func NewDescribeGlobalClustersPaginator(client DescribeGlobalClustersAPIClient, params *DescribeGlobalClustersInput, optFns ...func(*DescribeGlobalClustersPaginatorOptions)) *DescribeGlobalClustersPaginator { + options := DescribeGlobalClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeGlobalClustersInput{} + } + + return &DescribeGlobalClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeGlobalClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeGlobalClusters page. +func (p *DescribeGlobalClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeGlobalClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeGlobalClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeGlobalClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeInstallationMedia.go b/service/rds/api_op_DescribeInstallationMedia.go index 25ab296388c..3132bd4de2e 100644 --- a/service/rds/api_op_DescribeInstallationMedia.go +++ b/service/rds/api_op_DescribeInstallationMedia.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -131,6 +132,91 @@ func addOperationDescribeInstallationMediaMiddlewares(stack *middleware.Stack, o return nil } +// DescribeInstallationMediaAPIClient is a client that implements the +// DescribeInstallationMedia operation. +type DescribeInstallationMediaAPIClient interface { + DescribeInstallationMedia(context.Context, *DescribeInstallationMediaInput, ...func(*Options)) (*DescribeInstallationMediaOutput, error) +} + +var _ DescribeInstallationMediaAPIClient = (*Client)(nil) + +// DescribeInstallationMediaPaginatorOptions is the paginator options for +// DescribeInstallationMedia +type DescribeInstallationMediaPaginatorOptions struct { + // An optional pagination token provided by a previous DescribeInstallationMedia + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords. + 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 +} + +// DescribeInstallationMediaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeInstallationMedia +type DescribeInstallationMediaPaginator struct { + options DescribeInstallationMediaPaginatorOptions + client DescribeInstallationMediaAPIClient + params *DescribeInstallationMediaInput + nextToken *string + firstPage bool +} + +// NewDescribeInstallationMediaPaginator returns a new +// DescribeInstallationMediaPaginator +func NewDescribeInstallationMediaPaginator(client DescribeInstallationMediaAPIClient, params *DescribeInstallationMediaInput, optFns ...func(*DescribeInstallationMediaPaginatorOptions)) *DescribeInstallationMediaPaginator { + options := DescribeInstallationMediaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstallationMediaInput{} + } + + return &DescribeInstallationMediaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstallationMediaPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstallationMedia page. +func (p *DescribeInstallationMediaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstallationMediaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeInstallationMedia(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstallationMedia(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOptionGroupOptions.go b/service/rds/api_op_DescribeOptionGroupOptions.go index e2e36bc9cde..7c4659a7860 100644 --- a/service/rds/api_op_DescribeOptionGroupOptions.go +++ b/service/rds/api_op_DescribeOptionGroupOptions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -129,6 +130,92 @@ func addOperationDescribeOptionGroupOptionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeOptionGroupOptionsAPIClient is a client that implements the +// DescribeOptionGroupOptions operation. +type DescribeOptionGroupOptionsAPIClient interface { + DescribeOptionGroupOptions(context.Context, *DescribeOptionGroupOptionsInput, ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) +} + +var _ DescribeOptionGroupOptionsAPIClient = (*Client)(nil) + +// DescribeOptionGroupOptionsPaginatorOptions is the paginator options for +// DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOptionGroupOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOptionGroupOptions +type DescribeOptionGroupOptionsPaginator struct { + options DescribeOptionGroupOptionsPaginatorOptions + client DescribeOptionGroupOptionsAPIClient + params *DescribeOptionGroupOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOptionGroupOptionsPaginator returns a new +// DescribeOptionGroupOptionsPaginator +func NewDescribeOptionGroupOptionsPaginator(client DescribeOptionGroupOptionsAPIClient, params *DescribeOptionGroupOptionsInput, optFns ...func(*DescribeOptionGroupOptionsPaginatorOptions)) *DescribeOptionGroupOptionsPaginator { + options := DescribeOptionGroupOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOptionGroupOptionsInput{} + } + + return &DescribeOptionGroupOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOptionGroupOptions page. +func (p *DescribeOptionGroupOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOptionGroupOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOptionGroupOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOptionGroups.go b/service/rds/api_op_DescribeOptionGroups.go index 2beb1252c16..60c8462fc04 100644 --- a/service/rds/api_op_DescribeOptionGroups.go +++ b/service/rds/api_op_DescribeOptionGroups.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -133,6 +134,91 @@ func addOperationDescribeOptionGroupsMiddlewares(stack *middleware.Stack, option return nil } +// DescribeOptionGroupsAPIClient is a client that implements the +// DescribeOptionGroups operation. +type DescribeOptionGroupsAPIClient interface { + DescribeOptionGroups(context.Context, *DescribeOptionGroupsInput, ...func(*Options)) (*DescribeOptionGroupsOutput, error) +} + +var _ DescribeOptionGroupsAPIClient = (*Client)(nil) + +// DescribeOptionGroupsPaginatorOptions is the paginator options for +// DescribeOptionGroups +type DescribeOptionGroupsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOptionGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOptionGroups +type DescribeOptionGroupsPaginator struct { + options DescribeOptionGroupsPaginatorOptions + client DescribeOptionGroupsAPIClient + params *DescribeOptionGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeOptionGroupsPaginator returns a new DescribeOptionGroupsPaginator +func NewDescribeOptionGroupsPaginator(client DescribeOptionGroupsAPIClient, params *DescribeOptionGroupsInput, optFns ...func(*DescribeOptionGroupsPaginatorOptions)) *DescribeOptionGroupsPaginator { + options := DescribeOptionGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOptionGroupsInput{} + } + + return &DescribeOptionGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOptionGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOptionGroups page. +func (p *DescribeOptionGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOptionGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOptionGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOptionGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeOrderableDBInstanceOptions.go b/service/rds/api_op_DescribeOrderableDBInstanceOptions.go index 14d40eb84ff..54df6a481ad 100644 --- a/service/rds/api_op_DescribeOrderableDBInstanceOptions.go +++ b/service/rds/api_op_DescribeOrderableDBInstanceOptions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -148,6 +149,92 @@ func addOperationDescribeOrderableDBInstanceOptionsMiddlewares(stack *middleware return nil } +// DescribeOrderableDBInstanceOptionsAPIClient is a client that implements the +// DescribeOrderableDBInstanceOptions operation. +type DescribeOrderableDBInstanceOptionsAPIClient interface { + DescribeOrderableDBInstanceOptions(context.Context, *DescribeOrderableDBInstanceOptionsInput, ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) +} + +var _ DescribeOrderableDBInstanceOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableDBInstanceOptionsPaginatorOptions is the paginator options for +// DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeOrderableDBInstanceOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeOrderableDBInstanceOptions +type DescribeOrderableDBInstanceOptionsPaginator struct { + options DescribeOrderableDBInstanceOptionsPaginatorOptions + client DescribeOrderableDBInstanceOptionsAPIClient + params *DescribeOrderableDBInstanceOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableDBInstanceOptionsPaginator returns a new +// DescribeOrderableDBInstanceOptionsPaginator +func NewDescribeOrderableDBInstanceOptionsPaginator(client DescribeOrderableDBInstanceOptionsAPIClient, params *DescribeOrderableDBInstanceOptionsInput, optFns ...func(*DescribeOrderableDBInstanceOptionsPaginatorOptions)) *DescribeOrderableDBInstanceOptionsPaginator { + options := DescribeOrderableDBInstanceOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableDBInstanceOptionsInput{} + } + + return &DescribeOrderableDBInstanceOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableDBInstanceOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOrderableDBInstanceOptions page. +func (p *DescribeOrderableDBInstanceOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableDBInstanceOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOrderableDBInstanceOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableDBInstanceOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribePendingMaintenanceActions.go b/service/rds/api_op_DescribePendingMaintenanceActions.go index d7e09b4b27c..d0f557273d4 100644 --- a/service/rds/api_op_DescribePendingMaintenanceActions.go +++ b/service/rds/api_op_DescribePendingMaintenanceActions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -136,6 +137,92 @@ func addOperationDescribePendingMaintenanceActionsMiddlewares(stack *middleware. return nil } +// DescribePendingMaintenanceActionsAPIClient is a client that implements the +// DescribePendingMaintenanceActions operation. +type DescribePendingMaintenanceActionsAPIClient interface { + DescribePendingMaintenanceActions(context.Context, *DescribePendingMaintenanceActionsInput, ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) +} + +var _ DescribePendingMaintenanceActionsAPIClient = (*Client)(nil) + +// DescribePendingMaintenanceActionsPaginatorOptions is the paginator options for +// DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so that you can retrieve the remaining results. + // Default: 100 Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribePendingMaintenanceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribePendingMaintenanceActions +type DescribePendingMaintenanceActionsPaginator struct { + options DescribePendingMaintenanceActionsPaginatorOptions + client DescribePendingMaintenanceActionsAPIClient + params *DescribePendingMaintenanceActionsInput + nextToken *string + firstPage bool +} + +// NewDescribePendingMaintenanceActionsPaginator returns a new +// DescribePendingMaintenanceActionsPaginator +func NewDescribePendingMaintenanceActionsPaginator(client DescribePendingMaintenanceActionsAPIClient, params *DescribePendingMaintenanceActionsInput, optFns ...func(*DescribePendingMaintenanceActionsPaginatorOptions)) *DescribePendingMaintenanceActionsPaginator { + options := DescribePendingMaintenanceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePendingMaintenanceActionsInput{} + } + + return &DescribePendingMaintenanceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePendingMaintenanceActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePendingMaintenanceActions page. +func (p *DescribePendingMaintenanceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePendingMaintenanceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribePendingMaintenanceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePendingMaintenanceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeReservedDBInstances.go b/service/rds/api_op_DescribeReservedDBInstances.go index 8bc248876bb..a12e762e8ce 100644 --- a/service/rds/api_op_DescribeReservedDBInstances.go +++ b/service/rds/api_op_DescribeReservedDBInstances.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -157,6 +158,92 @@ func addOperationDescribeReservedDBInstancesMiddlewares(stack *middleware.Stack, return nil } +// DescribeReservedDBInstancesAPIClient is a client that implements the +// DescribeReservedDBInstances operation. +type DescribeReservedDBInstancesAPIClient interface { + DescribeReservedDBInstances(context.Context, *DescribeReservedDBInstancesInput, ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) +} + +var _ DescribeReservedDBInstancesAPIClient = (*Client)(nil) + +// DescribeReservedDBInstancesPaginatorOptions is the paginator options for +// DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReservedDBInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeReservedDBInstances +type DescribeReservedDBInstancesPaginator struct { + options DescribeReservedDBInstancesPaginatorOptions + client DescribeReservedDBInstancesAPIClient + params *DescribeReservedDBInstancesInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedDBInstancesPaginator returns a new +// DescribeReservedDBInstancesPaginator +func NewDescribeReservedDBInstancesPaginator(client DescribeReservedDBInstancesAPIClient, params *DescribeReservedDBInstancesInput, optFns ...func(*DescribeReservedDBInstancesPaginatorOptions)) *DescribeReservedDBInstancesPaginator { + options := DescribeReservedDBInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedDBInstancesInput{} + } + + return &DescribeReservedDBInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedDBInstances page. +func (p *DescribeReservedDBInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedDBInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedDBInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeReservedDBInstancesOfferings.go b/service/rds/api_op_DescribeReservedDBInstancesOfferings.go index 45a05c971e4..a8ee26d0138 100644 --- a/service/rds/api_op_DescribeReservedDBInstancesOfferings.go +++ b/service/rds/api_op_DescribeReservedDBInstancesOfferings.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -149,6 +150,92 @@ func addOperationDescribeReservedDBInstancesOfferingsMiddlewares(stack *middlewa return nil } +// DescribeReservedDBInstancesOfferingsAPIClient is a client that implements the +// DescribeReservedDBInstancesOfferings operation. +type DescribeReservedDBInstancesOfferingsAPIClient interface { + DescribeReservedDBInstancesOfferings(context.Context, *DescribeReservedDBInstancesOfferingsInput, ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) +} + +var _ DescribeReservedDBInstancesOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedDBInstancesOfferingsPaginatorOptions is the paginator options +// for DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginatorOptions struct { + // The maximum number of records to include in the response. If more than the + // MaxRecords value is available, a pagination token called a marker is included in + // the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeReservedDBInstancesOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeReservedDBInstancesOfferings +type DescribeReservedDBInstancesOfferingsPaginator struct { + options DescribeReservedDBInstancesOfferingsPaginatorOptions + client DescribeReservedDBInstancesOfferingsAPIClient + params *DescribeReservedDBInstancesOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedDBInstancesOfferingsPaginator returns a new +// DescribeReservedDBInstancesOfferingsPaginator +func NewDescribeReservedDBInstancesOfferingsPaginator(client DescribeReservedDBInstancesOfferingsAPIClient, params *DescribeReservedDBInstancesOfferingsInput, optFns ...func(*DescribeReservedDBInstancesOfferingsPaginatorOptions)) *DescribeReservedDBInstancesOfferingsPaginator { + options := DescribeReservedDBInstancesOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedDBInstancesOfferingsInput{} + } + + return &DescribeReservedDBInstancesOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedDBInstancesOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedDBInstancesOfferings page. +func (p *DescribeReservedDBInstancesOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedDBInstancesOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedDBInstancesOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedDBInstancesOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/api_op_DescribeSourceRegions.go b/service/rds/api_op_DescribeSourceRegions.go index bef92028f0d..a1dc08fc0e0 100644 --- a/service/rds/api_op_DescribeSourceRegions.go +++ b/service/rds/api_op_DescribeSourceRegions.go @@ -4,6 +4,7 @@ package rds 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/rds/types" @@ -129,6 +130,91 @@ func addOperationDescribeSourceRegionsMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeSourceRegionsAPIClient is a client that implements the +// DescribeSourceRegions operation. +type DescribeSourceRegionsAPIClient interface { + DescribeSourceRegions(context.Context, *DescribeSourceRegionsInput, ...func(*Options)) (*DescribeSourceRegionsOutput, error) +} + +var _ DescribeSourceRegionsAPIClient = (*Client)(nil) + +// DescribeSourceRegionsPaginatorOptions is the paginator options for +// DescribeSourceRegions +type DescribeSourceRegionsPaginatorOptions struct { + // The maximum number of records to include in the response. If more records exist + // than the specified MaxRecords value, a pagination token called a marker is + // included in the response so you can retrieve the remaining results. Default: 100 + // Constraints: Minimum 20, maximum 100. + 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 +} + +// DescribeSourceRegionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rds.DescribeSourceRegions +type DescribeSourceRegionsPaginator struct { + options DescribeSourceRegionsPaginatorOptions + client DescribeSourceRegionsAPIClient + params *DescribeSourceRegionsInput + nextToken *string + firstPage bool +} + +// NewDescribeSourceRegionsPaginator returns a new DescribeSourceRegionsPaginator +func NewDescribeSourceRegionsPaginator(client DescribeSourceRegionsAPIClient, params *DescribeSourceRegionsInput, optFns ...func(*DescribeSourceRegionsPaginatorOptions)) *DescribeSourceRegionsPaginator { + options := DescribeSourceRegionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSourceRegionsInput{} + } + + return &DescribeSourceRegionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSourceRegionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSourceRegions page. +func (p *DescribeSourceRegionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSourceRegionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeSourceRegions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSourceRegions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rds/endpoints.go b/service/rds/endpoints.go index 6ab7b342b67..f26ed5c066a 100644 --- a/service/rds/endpoints.go +++ b/service/rds/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/rdsdata/endpoints.go b/service/rdsdata/endpoints.go index 544946f55b7..5317768a5d1 100644 --- a/service/rdsdata/endpoints.go +++ b/service/rdsdata/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/redshift/api_op_DescribeClusterParameterGroups.go b/service/redshift/api_op_DescribeClusterParameterGroups.go index e978ef7d093..ac78e0cabca 100644 --- a/service/redshift/api_op_DescribeClusterParameterGroups.go +++ b/service/redshift/api_op_DescribeClusterParameterGroups.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -154,6 +155,93 @@ func addOperationDescribeClusterParameterGroupsMiddlewares(stack *middleware.Sta return nil } +// DescribeClusterParameterGroupsAPIClient is a client that implements the +// DescribeClusterParameterGroups operation. +type DescribeClusterParameterGroupsAPIClient interface { + DescribeClusterParameterGroups(context.Context, *DescribeClusterParameterGroupsInput, ...func(*Options)) (*DescribeClusterParameterGroupsOutput, error) +} + +var _ DescribeClusterParameterGroupsAPIClient = (*Client)(nil) + +// DescribeClusterParameterGroupsPaginatorOptions is the paginator options for +// DescribeClusterParameterGroups +type DescribeClusterParameterGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterParameterGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterParameterGroups +type DescribeClusterParameterGroupsPaginator struct { + options DescribeClusterParameterGroupsPaginatorOptions + client DescribeClusterParameterGroupsAPIClient + params *DescribeClusterParameterGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterParameterGroupsPaginator returns a new +// DescribeClusterParameterGroupsPaginator +func NewDescribeClusterParameterGroupsPaginator(client DescribeClusterParameterGroupsAPIClient, params *DescribeClusterParameterGroupsInput, optFns ...func(*DescribeClusterParameterGroupsPaginatorOptions)) *DescribeClusterParameterGroupsPaginator { + options := DescribeClusterParameterGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterParameterGroupsInput{} + } + + return &DescribeClusterParameterGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterParameterGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterParameterGroups page. +func (p *DescribeClusterParameterGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterParameterGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterParameterGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterParameterGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterParameters.go b/service/redshift/api_op_DescribeClusterParameters.go index c0e6690415e..a94bfd0861e 100644 --- a/service/redshift/api_op_DescribeClusterParameters.go +++ b/service/redshift/api_op_DescribeClusterParameters.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -143,6 +144,93 @@ func addOperationDescribeClusterParametersMiddlewares(stack *middleware.Stack, o return nil } +// DescribeClusterParametersAPIClient is a client that implements the +// DescribeClusterParameters operation. +type DescribeClusterParametersAPIClient interface { + DescribeClusterParameters(context.Context, *DescribeClusterParametersInput, ...func(*Options)) (*DescribeClusterParametersOutput, error) +} + +var _ DescribeClusterParametersAPIClient = (*Client)(nil) + +// DescribeClusterParametersPaginatorOptions is the paginator options for +// DescribeClusterParameters +type DescribeClusterParametersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterParameters +type DescribeClusterParametersPaginator struct { + options DescribeClusterParametersPaginatorOptions + client DescribeClusterParametersAPIClient + params *DescribeClusterParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterParametersPaginator returns a new +// DescribeClusterParametersPaginator +func NewDescribeClusterParametersPaginator(client DescribeClusterParametersAPIClient, params *DescribeClusterParametersInput, optFns ...func(*DescribeClusterParametersPaginatorOptions)) *DescribeClusterParametersPaginator { + options := DescribeClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterParametersInput{} + } + + return &DescribeClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterParameters page. +func (p *DescribeClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSecurityGroups.go b/service/redshift/api_op_DescribeClusterSecurityGroups.go index 9434530b73a..20c1c6508fa 100644 --- a/service/redshift/api_op_DescribeClusterSecurityGroups.go +++ b/service/redshift/api_op_DescribeClusterSecurityGroups.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -153,6 +154,93 @@ func addOperationDescribeClusterSecurityGroupsMiddlewares(stack *middleware.Stac return nil } +// DescribeClusterSecurityGroupsAPIClient is a client that implements the +// DescribeClusterSecurityGroups operation. +type DescribeClusterSecurityGroupsAPIClient interface { + DescribeClusterSecurityGroups(context.Context, *DescribeClusterSecurityGroupsInput, ...func(*Options)) (*DescribeClusterSecurityGroupsOutput, error) +} + +var _ DescribeClusterSecurityGroupsAPIClient = (*Client)(nil) + +// DescribeClusterSecurityGroupsPaginatorOptions is the paginator options for +// DescribeClusterSecurityGroups +type DescribeClusterSecurityGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterSecurityGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSecurityGroups +type DescribeClusterSecurityGroupsPaginator struct { + options DescribeClusterSecurityGroupsPaginatorOptions + client DescribeClusterSecurityGroupsAPIClient + params *DescribeClusterSecurityGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterSecurityGroupsPaginator returns a new +// DescribeClusterSecurityGroupsPaginator +func NewDescribeClusterSecurityGroupsPaginator(client DescribeClusterSecurityGroupsAPIClient, params *DescribeClusterSecurityGroupsInput, optFns ...func(*DescribeClusterSecurityGroupsPaginatorOptions)) *DescribeClusterSecurityGroupsPaginator { + options := DescribeClusterSecurityGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSecurityGroupsInput{} + } + + return &DescribeClusterSecurityGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSecurityGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterSecurityGroups page. +func (p *DescribeClusterSecurityGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSecurityGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterSecurityGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSecurityGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSnapshots.go b/service/redshift/api_op_DescribeClusterSnapshots.go index a6b19616923..6aca644e158 100644 --- a/service/redshift/api_op_DescribeClusterSnapshots.go +++ b/service/redshift/api_op_DescribeClusterSnapshots.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -201,6 +202,93 @@ func addOperationDescribeClusterSnapshotsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeClusterSnapshotsAPIClient is a client that implements the +// DescribeClusterSnapshots operation. +type DescribeClusterSnapshotsAPIClient interface { + DescribeClusterSnapshots(context.Context, *DescribeClusterSnapshotsInput, ...func(*Options)) (*DescribeClusterSnapshotsOutput, error) +} + +var _ DescribeClusterSnapshotsAPIClient = (*Client)(nil) + +// DescribeClusterSnapshotsPaginatorOptions is the paginator options for +// DescribeClusterSnapshots +type DescribeClusterSnapshotsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterSnapshotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSnapshots +type DescribeClusterSnapshotsPaginator struct { + options DescribeClusterSnapshotsPaginatorOptions + client DescribeClusterSnapshotsAPIClient + params *DescribeClusterSnapshotsInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterSnapshotsPaginator returns a new +// DescribeClusterSnapshotsPaginator +func NewDescribeClusterSnapshotsPaginator(client DescribeClusterSnapshotsAPIClient, params *DescribeClusterSnapshotsInput, optFns ...func(*DescribeClusterSnapshotsPaginatorOptions)) *DescribeClusterSnapshotsPaginator { + options := DescribeClusterSnapshotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSnapshotsInput{} + } + + return &DescribeClusterSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterSnapshots page. +func (p *DescribeClusterSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSnapshotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterSnapshots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterSubnetGroups.go b/service/redshift/api_op_DescribeClusterSubnetGroups.go index 836412de269..1faa9c86738 100644 --- a/service/redshift/api_op_DescribeClusterSubnetGroups.go +++ b/service/redshift/api_op_DescribeClusterSubnetGroups.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -148,6 +149,93 @@ func addOperationDescribeClusterSubnetGroupsMiddlewares(stack *middleware.Stack, return nil } +// DescribeClusterSubnetGroupsAPIClient is a client that implements the +// DescribeClusterSubnetGroups operation. +type DescribeClusterSubnetGroupsAPIClient interface { + DescribeClusterSubnetGroups(context.Context, *DescribeClusterSubnetGroupsInput, ...func(*Options)) (*DescribeClusterSubnetGroupsOutput, error) +} + +var _ DescribeClusterSubnetGroupsAPIClient = (*Client)(nil) + +// DescribeClusterSubnetGroupsPaginatorOptions is the paginator options for +// DescribeClusterSubnetGroups +type DescribeClusterSubnetGroupsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterSubnetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterSubnetGroups +type DescribeClusterSubnetGroupsPaginator struct { + options DescribeClusterSubnetGroupsPaginatorOptions + client DescribeClusterSubnetGroupsAPIClient + params *DescribeClusterSubnetGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterSubnetGroupsPaginator returns a new +// DescribeClusterSubnetGroupsPaginator +func NewDescribeClusterSubnetGroupsPaginator(client DescribeClusterSubnetGroupsAPIClient, params *DescribeClusterSubnetGroupsInput, optFns ...func(*DescribeClusterSubnetGroupsPaginatorOptions)) *DescribeClusterSubnetGroupsPaginator { + options := DescribeClusterSubnetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterSubnetGroupsInput{} + } + + return &DescribeClusterSubnetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterSubnetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterSubnetGroups page. +func (p *DescribeClusterSubnetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterSubnetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterSubnetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterSubnetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusterVersions.go b/service/redshift/api_op_DescribeClusterVersions.go index 79be862714c..771bbbc5188 100644 --- a/service/redshift/api_op_DescribeClusterVersions.go +++ b/service/redshift/api_op_DescribeClusterVersions.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -138,6 +139,93 @@ func addOperationDescribeClusterVersionsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeClusterVersionsAPIClient is a client that implements the +// DescribeClusterVersions operation. +type DescribeClusterVersionsAPIClient interface { + DescribeClusterVersions(context.Context, *DescribeClusterVersionsInput, ...func(*Options)) (*DescribeClusterVersionsOutput, error) +} + +var _ DescribeClusterVersionsAPIClient = (*Client)(nil) + +// DescribeClusterVersionsPaginatorOptions is the paginator options for +// DescribeClusterVersions +type DescribeClusterVersionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClusterVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusterVersions +type DescribeClusterVersionsPaginator struct { + options DescribeClusterVersionsPaginatorOptions + client DescribeClusterVersionsAPIClient + params *DescribeClusterVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeClusterVersionsPaginator returns a new +// DescribeClusterVersionsPaginator +func NewDescribeClusterVersionsPaginator(client DescribeClusterVersionsAPIClient, params *DescribeClusterVersionsInput, optFns ...func(*DescribeClusterVersionsPaginatorOptions)) *DescribeClusterVersionsPaginator { + options := DescribeClusterVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClusterVersionsInput{} + } + + return &DescribeClusterVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClusterVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusterVersions page. +func (p *DescribeClusterVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClusterVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusterVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusterVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeClusters.go b/service/redshift/api_op_DescribeClusters.go index 49fcf4ba2ee..17d39c3e0db 100644 --- a/service/redshift/api_op_DescribeClusters.go +++ b/service/redshift/api_op_DescribeClusters.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -152,6 +153,91 @@ func addOperationDescribeClustersMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeClustersAPIClient is a client that implements the DescribeClusters +// operation. +type DescribeClustersAPIClient interface { + DescribeClusters(context.Context, *DescribeClustersInput, ...func(*Options)) (*DescribeClustersOutput, error) +} + +var _ DescribeClustersAPIClient = (*Client)(nil) + +// DescribeClustersPaginatorOptions is the paginator options for DescribeClusters +type DescribeClustersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeClustersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeClusters +type DescribeClustersPaginator struct { + options DescribeClustersPaginatorOptions + client DescribeClustersAPIClient + params *DescribeClustersInput + nextToken *string + firstPage bool +} + +// NewDescribeClustersPaginator returns a new DescribeClustersPaginator +func NewDescribeClustersPaginator(client DescribeClustersAPIClient, params *DescribeClustersInput, optFns ...func(*DescribeClustersPaginatorOptions)) *DescribeClustersPaginator { + options := DescribeClustersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeClustersInput{} + } + + return &DescribeClustersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeClustersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeClusters page. +func (p *DescribeClustersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeClustersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeClusters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeClusters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeDefaultClusterParameters.go b/service/redshift/api_op_DescribeDefaultClusterParameters.go index eefc26b0910..e1eaa6fa6a4 100644 --- a/service/redshift/api_op_DescribeDefaultClusterParameters.go +++ b/service/redshift/api_op_DescribeDefaultClusterParameters.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -124,6 +125,95 @@ func addOperationDescribeDefaultClusterParametersMiddlewares(stack *middleware.S return nil } +// DescribeDefaultClusterParametersAPIClient is a client that implements the +// DescribeDefaultClusterParameters operation. +type DescribeDefaultClusterParametersAPIClient interface { + DescribeDefaultClusterParameters(context.Context, *DescribeDefaultClusterParametersInput, ...func(*Options)) (*DescribeDefaultClusterParametersOutput, error) +} + +var _ DescribeDefaultClusterParametersAPIClient = (*Client)(nil) + +// DescribeDefaultClusterParametersPaginatorOptions is the paginator options for +// DescribeDefaultClusterParameters +type DescribeDefaultClusterParametersPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeDefaultClusterParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeDefaultClusterParameters +type DescribeDefaultClusterParametersPaginator struct { + options DescribeDefaultClusterParametersPaginatorOptions + client DescribeDefaultClusterParametersAPIClient + params *DescribeDefaultClusterParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeDefaultClusterParametersPaginator returns a new +// DescribeDefaultClusterParametersPaginator +func NewDescribeDefaultClusterParametersPaginator(client DescribeDefaultClusterParametersAPIClient, params *DescribeDefaultClusterParametersInput, optFns ...func(*DescribeDefaultClusterParametersPaginatorOptions)) *DescribeDefaultClusterParametersPaginator { + options := DescribeDefaultClusterParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDefaultClusterParametersInput{} + } + + return &DescribeDefaultClusterParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDefaultClusterParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDefaultClusterParameters page. +func (p *DescribeDefaultClusterParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDefaultClusterParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeDefaultClusterParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + if result.DefaultClusterParameters != nil { + p.nextToken = result.DefaultClusterParameters.Marker + } + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDefaultClusterParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeEventSubscriptions.go b/service/redshift/api_op_DescribeEventSubscriptions.go index 800a06bebba..3a6525525f7 100644 --- a/service/redshift/api_op_DescribeEventSubscriptions.go +++ b/service/redshift/api_op_DescribeEventSubscriptions.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -148,6 +149,93 @@ func addOperationDescribeEventSubscriptionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeEventSubscriptionsAPIClient is a client that implements the +// DescribeEventSubscriptions operation. +type DescribeEventSubscriptionsAPIClient interface { + DescribeEventSubscriptions(context.Context, *DescribeEventSubscriptionsInput, ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) +} + +var _ DescribeEventSubscriptionsAPIClient = (*Client)(nil) + +// DescribeEventSubscriptionsPaginatorOptions is the paginator options for +// DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeEventSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeEventSubscriptions +type DescribeEventSubscriptionsPaginator struct { + options DescribeEventSubscriptionsPaginatorOptions + client DescribeEventSubscriptionsAPIClient + params *DescribeEventSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventSubscriptionsPaginator returns a new +// DescribeEventSubscriptionsPaginator +func NewDescribeEventSubscriptionsPaginator(client DescribeEventSubscriptionsAPIClient, params *DescribeEventSubscriptionsInput, optFns ...func(*DescribeEventSubscriptionsPaginatorOptions)) *DescribeEventSubscriptionsPaginator { + options := DescribeEventSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventSubscriptionsInput{} + } + + return &DescribeEventSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEventSubscriptions page. +func (p *DescribeEventSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEventSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEventSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeEvents.go b/service/redshift/api_op_DescribeEvents.go index 84077e3734e..d5f27b0761b 100644 --- a/service/redshift/api_op_DescribeEvents.go +++ b/service/redshift/api_op_DescribeEvents.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -174,6 +175,91 @@ func addOperationDescribeEventsMiddlewares(stack *middleware.Stack, options Opti return nil } +// DescribeEventsAPIClient is a client that implements the DescribeEvents +// operation. +type DescribeEventsAPIClient interface { + DescribeEvents(context.Context, *DescribeEventsInput, ...func(*Options)) (*DescribeEventsOutput, error) +} + +var _ DescribeEventsAPIClient = (*Client)(nil) + +// DescribeEventsPaginatorOptions is the paginator options for DescribeEvents +type DescribeEventsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeEventsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeEvents +type DescribeEventsPaginator struct { + options DescribeEventsPaginatorOptions + client DescribeEventsAPIClient + params *DescribeEventsInput + nextToken *string + firstPage bool +} + +// NewDescribeEventsPaginator returns a new DescribeEventsPaginator +func NewDescribeEventsPaginator(client DescribeEventsAPIClient, params *DescribeEventsInput, optFns ...func(*DescribeEventsPaginatorOptions)) *DescribeEventsPaginator { + options := DescribeEventsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEventsInput{} + } + + return &DescribeEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEvents page. +func (p *DescribeEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEvents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeHsmClientCertificates.go b/service/redshift/api_op_DescribeHsmClientCertificates.go index 2d9142b6182..4ecb9054db0 100644 --- a/service/redshift/api_op_DescribeHsmClientCertificates.go +++ b/service/redshift/api_op_DescribeHsmClientCertificates.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -151,6 +152,93 @@ func addOperationDescribeHsmClientCertificatesMiddlewares(stack *middleware.Stac return nil } +// DescribeHsmClientCertificatesAPIClient is a client that implements the +// DescribeHsmClientCertificates operation. +type DescribeHsmClientCertificatesAPIClient interface { + DescribeHsmClientCertificates(context.Context, *DescribeHsmClientCertificatesInput, ...func(*Options)) (*DescribeHsmClientCertificatesOutput, error) +} + +var _ DescribeHsmClientCertificatesAPIClient = (*Client)(nil) + +// DescribeHsmClientCertificatesPaginatorOptions is the paginator options for +// DescribeHsmClientCertificates +type DescribeHsmClientCertificatesPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeHsmClientCertificatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeHsmClientCertificates +type DescribeHsmClientCertificatesPaginator struct { + options DescribeHsmClientCertificatesPaginatorOptions + client DescribeHsmClientCertificatesAPIClient + params *DescribeHsmClientCertificatesInput + nextToken *string + firstPage bool +} + +// NewDescribeHsmClientCertificatesPaginator returns a new +// DescribeHsmClientCertificatesPaginator +func NewDescribeHsmClientCertificatesPaginator(client DescribeHsmClientCertificatesAPIClient, params *DescribeHsmClientCertificatesInput, optFns ...func(*DescribeHsmClientCertificatesPaginatorOptions)) *DescribeHsmClientCertificatesPaginator { + options := DescribeHsmClientCertificatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHsmClientCertificatesInput{} + } + + return &DescribeHsmClientCertificatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHsmClientCertificatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHsmClientCertificates page. +func (p *DescribeHsmClientCertificatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHsmClientCertificatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeHsmClientCertificates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHsmClientCertificates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeHsmConfigurations.go b/service/redshift/api_op_DescribeHsmConfigurations.go index 47c87d76edb..96488c5988d 100644 --- a/service/redshift/api_op_DescribeHsmConfigurations.go +++ b/service/redshift/api_op_DescribeHsmConfigurations.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -148,6 +149,93 @@ func addOperationDescribeHsmConfigurationsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeHsmConfigurationsAPIClient is a client that implements the +// DescribeHsmConfigurations operation. +type DescribeHsmConfigurationsAPIClient interface { + DescribeHsmConfigurations(context.Context, *DescribeHsmConfigurationsInput, ...func(*Options)) (*DescribeHsmConfigurationsOutput, error) +} + +var _ DescribeHsmConfigurationsAPIClient = (*Client)(nil) + +// DescribeHsmConfigurationsPaginatorOptions is the paginator options for +// DescribeHsmConfigurations +type DescribeHsmConfigurationsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeHsmConfigurationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeHsmConfigurations +type DescribeHsmConfigurationsPaginator struct { + options DescribeHsmConfigurationsPaginatorOptions + client DescribeHsmConfigurationsAPIClient + params *DescribeHsmConfigurationsInput + nextToken *string + firstPage bool +} + +// NewDescribeHsmConfigurationsPaginator returns a new +// DescribeHsmConfigurationsPaginator +func NewDescribeHsmConfigurationsPaginator(client DescribeHsmConfigurationsAPIClient, params *DescribeHsmConfigurationsInput, optFns ...func(*DescribeHsmConfigurationsPaginatorOptions)) *DescribeHsmConfigurationsPaginator { + options := DescribeHsmConfigurationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeHsmConfigurationsInput{} + } + + return &DescribeHsmConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeHsmConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeHsmConfigurations page. +func (p *DescribeHsmConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeHsmConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeHsmConfigurations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeHsmConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeNodeConfigurationOptions.go b/service/redshift/api_op_DescribeNodeConfigurationOptions.go index 3251d92e273..4e4c291ef43 100644 --- a/service/redshift/api_op_DescribeNodeConfigurationOptions.go +++ b/service/redshift/api_op_DescribeNodeConfigurationOptions.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -144,6 +145,93 @@ func addOperationDescribeNodeConfigurationOptionsMiddlewares(stack *middleware.S return nil } +// DescribeNodeConfigurationOptionsAPIClient is a client that implements the +// DescribeNodeConfigurationOptions operation. +type DescribeNodeConfigurationOptionsAPIClient interface { + DescribeNodeConfigurationOptions(context.Context, *DescribeNodeConfigurationOptionsInput, ...func(*Options)) (*DescribeNodeConfigurationOptionsOutput, error) +} + +var _ DescribeNodeConfigurationOptionsAPIClient = (*Client)(nil) + +// DescribeNodeConfigurationOptionsPaginatorOptions is the paginator options for +// DescribeNodeConfigurationOptions +type DescribeNodeConfigurationOptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 500 + // Constraints: minimum 100, maximum 500. + 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 +} + +// DescribeNodeConfigurationOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeNodeConfigurationOptions +type DescribeNodeConfigurationOptionsPaginator struct { + options DescribeNodeConfigurationOptionsPaginatorOptions + client DescribeNodeConfigurationOptionsAPIClient + params *DescribeNodeConfigurationOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeNodeConfigurationOptionsPaginator returns a new +// DescribeNodeConfigurationOptionsPaginator +func NewDescribeNodeConfigurationOptionsPaginator(client DescribeNodeConfigurationOptionsAPIClient, params *DescribeNodeConfigurationOptionsInput, optFns ...func(*DescribeNodeConfigurationOptionsPaginatorOptions)) *DescribeNodeConfigurationOptionsPaginator { + options := DescribeNodeConfigurationOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeNodeConfigurationOptionsInput{} + } + + return &DescribeNodeConfigurationOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeNodeConfigurationOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeNodeConfigurationOptions page. +func (p *DescribeNodeConfigurationOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeNodeConfigurationOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeNodeConfigurationOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeNodeConfigurationOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeOrderableClusterOptions.go b/service/redshift/api_op_DescribeOrderableClusterOptions.go index ebe621f70bc..c22dc2740ba 100644 --- a/service/redshift/api_op_DescribeOrderableClusterOptions.go +++ b/service/redshift/api_op_DescribeOrderableClusterOptions.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -138,6 +139,93 @@ func addOperationDescribeOrderableClusterOptionsMiddlewares(stack *middleware.St return nil } +// DescribeOrderableClusterOptionsAPIClient is a client that implements the +// DescribeOrderableClusterOptions operation. +type DescribeOrderableClusterOptionsAPIClient interface { + DescribeOrderableClusterOptions(context.Context, *DescribeOrderableClusterOptionsInput, ...func(*Options)) (*DescribeOrderableClusterOptionsOutput, error) +} + +var _ DescribeOrderableClusterOptionsAPIClient = (*Client)(nil) + +// DescribeOrderableClusterOptionsPaginatorOptions is the paginator options for +// DescribeOrderableClusterOptions +type DescribeOrderableClusterOptionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeOrderableClusterOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeOrderableClusterOptions +type DescribeOrderableClusterOptionsPaginator struct { + options DescribeOrderableClusterOptionsPaginatorOptions + client DescribeOrderableClusterOptionsAPIClient + params *DescribeOrderableClusterOptionsInput + nextToken *string + firstPage bool +} + +// NewDescribeOrderableClusterOptionsPaginator returns a new +// DescribeOrderableClusterOptionsPaginator +func NewDescribeOrderableClusterOptionsPaginator(client DescribeOrderableClusterOptionsAPIClient, params *DescribeOrderableClusterOptionsInput, optFns ...func(*DescribeOrderableClusterOptionsPaginatorOptions)) *DescribeOrderableClusterOptionsPaginator { + options := DescribeOrderableClusterOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOrderableClusterOptionsInput{} + } + + return &DescribeOrderableClusterOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOrderableClusterOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOrderableClusterOptions page. +func (p *DescribeOrderableClusterOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOrderableClusterOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeOrderableClusterOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOrderableClusterOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeReservedNodeOfferings.go b/service/redshift/api_op_DescribeReservedNodeOfferings.go index 5b0972d9a63..c09443cee65 100644 --- a/service/redshift/api_op_DescribeReservedNodeOfferings.go +++ b/service/redshift/api_op_DescribeReservedNodeOfferings.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -132,6 +133,93 @@ func addOperationDescribeReservedNodeOfferingsMiddlewares(stack *middleware.Stac return nil } +// DescribeReservedNodeOfferingsAPIClient is a client that implements the +// DescribeReservedNodeOfferings operation. +type DescribeReservedNodeOfferingsAPIClient interface { + DescribeReservedNodeOfferings(context.Context, *DescribeReservedNodeOfferingsInput, ...func(*Options)) (*DescribeReservedNodeOfferingsOutput, error) +} + +var _ DescribeReservedNodeOfferingsAPIClient = (*Client)(nil) + +// DescribeReservedNodeOfferingsPaginatorOptions is the paginator options for +// DescribeReservedNodeOfferings +type DescribeReservedNodeOfferingsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeReservedNodeOfferingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeReservedNodeOfferings +type DescribeReservedNodeOfferingsPaginator struct { + options DescribeReservedNodeOfferingsPaginatorOptions + client DescribeReservedNodeOfferingsAPIClient + params *DescribeReservedNodeOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedNodeOfferingsPaginator returns a new +// DescribeReservedNodeOfferingsPaginator +func NewDescribeReservedNodeOfferingsPaginator(client DescribeReservedNodeOfferingsAPIClient, params *DescribeReservedNodeOfferingsInput, optFns ...func(*DescribeReservedNodeOfferingsPaginatorOptions)) *DescribeReservedNodeOfferingsPaginator { + options := DescribeReservedNodeOfferingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedNodeOfferingsInput{} + } + + return &DescribeReservedNodeOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedNodeOfferingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedNodeOfferings page. +func (p *DescribeReservedNodeOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedNodeOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedNodeOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedNodeOfferings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeReservedNodes.go b/service/redshift/api_op_DescribeReservedNodes.go index 813efe02c7e..ed17cfee55d 100644 --- a/service/redshift/api_op_DescribeReservedNodes.go +++ b/service/redshift/api_op_DescribeReservedNodes.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -122,6 +123,92 @@ func addOperationDescribeReservedNodesMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeReservedNodesAPIClient is a client that implements the +// DescribeReservedNodes operation. +type DescribeReservedNodesAPIClient interface { + DescribeReservedNodes(context.Context, *DescribeReservedNodesInput, ...func(*Options)) (*DescribeReservedNodesOutput, error) +} + +var _ DescribeReservedNodesAPIClient = (*Client)(nil) + +// DescribeReservedNodesPaginatorOptions is the paginator options for +// DescribeReservedNodes +type DescribeReservedNodesPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeReservedNodesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeReservedNodes +type DescribeReservedNodesPaginator struct { + options DescribeReservedNodesPaginatorOptions + client DescribeReservedNodesAPIClient + params *DescribeReservedNodesInput + nextToken *string + firstPage bool +} + +// NewDescribeReservedNodesPaginator returns a new DescribeReservedNodesPaginator +func NewDescribeReservedNodesPaginator(client DescribeReservedNodesAPIClient, params *DescribeReservedNodesInput, optFns ...func(*DescribeReservedNodesPaginatorOptions)) *DescribeReservedNodesPaginator { + options := DescribeReservedNodesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeReservedNodesInput{} + } + + return &DescribeReservedNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeReservedNodesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeReservedNodes page. +func (p *DescribeReservedNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeReservedNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeReservedNodes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeReservedNodes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeScheduledActions.go b/service/redshift/api_op_DescribeScheduledActions.go index 8d19ab6b91b..ce95f43654a 100644 --- a/service/redshift/api_op_DescribeScheduledActions.go +++ b/service/redshift/api_op_DescribeScheduledActions.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -142,6 +143,93 @@ func addOperationDescribeScheduledActionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeScheduledActionsAPIClient is a client that implements the +// DescribeScheduledActions operation. +type DescribeScheduledActionsAPIClient interface { + DescribeScheduledActions(context.Context, *DescribeScheduledActionsInput, ...func(*Options)) (*DescribeScheduledActionsOutput, error) +} + +var _ DescribeScheduledActionsAPIClient = (*Client)(nil) + +// DescribeScheduledActionsPaginatorOptions is the paginator options for +// DescribeScheduledActions +type DescribeScheduledActionsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeScheduledActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeScheduledActions +type DescribeScheduledActionsPaginator struct { + options DescribeScheduledActionsPaginatorOptions + client DescribeScheduledActionsAPIClient + params *DescribeScheduledActionsInput + nextToken *string + firstPage bool +} + +// NewDescribeScheduledActionsPaginator returns a new +// DescribeScheduledActionsPaginator +func NewDescribeScheduledActionsPaginator(client DescribeScheduledActionsAPIClient, params *DescribeScheduledActionsInput, optFns ...func(*DescribeScheduledActionsPaginatorOptions)) *DescribeScheduledActionsPaginator { + options := DescribeScheduledActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeScheduledActionsInput{} + } + + return &DescribeScheduledActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeScheduledActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeScheduledActions page. +func (p *DescribeScheduledActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeScheduledActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeScheduledActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeScheduledActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/api_op_DescribeUsageLimits.go b/service/redshift/api_op_DescribeUsageLimits.go index 853d69d327b..cf20d9a5640 100644 --- a/service/redshift/api_op_DescribeUsageLimits.go +++ b/service/redshift/api_op_DescribeUsageLimits.go @@ -4,6 +4,7 @@ package redshift 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/redshift/types" @@ -158,6 +159,92 @@ func addOperationDescribeUsageLimitsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeUsageLimitsAPIClient is a client that implements the DescribeUsageLimits +// operation. +type DescribeUsageLimitsAPIClient interface { + DescribeUsageLimits(context.Context, *DescribeUsageLimitsInput, ...func(*Options)) (*DescribeUsageLimitsOutput, error) +} + +var _ DescribeUsageLimitsAPIClient = (*Client)(nil) + +// DescribeUsageLimitsPaginatorOptions is the paginator options for +// DescribeUsageLimits +type DescribeUsageLimitsPaginatorOptions struct { + // The maximum number of response records to return in each call. If the number of + // remaining response records exceeds the specified MaxRecords value, a value is + // returned in a marker field of the response. You can retrieve the next set of + // records by retrying the command with the returned marker value. Default: 100 + // Constraints: minimum 20, maximum 100. + 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 +} + +// DescribeUsageLimitsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshift.DescribeUsageLimits +type DescribeUsageLimitsPaginator struct { + options DescribeUsageLimitsPaginatorOptions + client DescribeUsageLimitsAPIClient + params *DescribeUsageLimitsInput + nextToken *string + firstPage bool +} + +// NewDescribeUsageLimitsPaginator returns a new DescribeUsageLimitsPaginator +func NewDescribeUsageLimitsPaginator(client DescribeUsageLimitsAPIClient, params *DescribeUsageLimitsInput, optFns ...func(*DescribeUsageLimitsPaginatorOptions)) *DescribeUsageLimitsPaginator { + options := DescribeUsageLimitsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsageLimitsInput{} + } + + return &DescribeUsageLimitsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsageLimitsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeUsageLimits page. +func (p *DescribeUsageLimitsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsageLimitsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxRecords = &p.options.Limit + } + + result, err := p.client.DescribeUsageLimits(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsageLimits(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshift/endpoints.go b/service/redshift/endpoints.go index 17498f956e4..cd246068554 100644 --- a/service/redshift/endpoints.go +++ b/service/redshift/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/redshiftdata/api_op_DescribeTable.go b/service/redshiftdata/api_op_DescribeTable.go index 8abefa74839..dd7e80a2c19 100644 --- a/service/redshiftdata/api_op_DescribeTable.go +++ b/service/redshiftdata/api_op_DescribeTable.go @@ -4,6 +4,7 @@ package redshiftdata 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/redshiftdata/types" @@ -159,6 +160,88 @@ func addOperationDescribeTableMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeTableAPIClient is a client that implements the DescribeTable operation. +type DescribeTableAPIClient interface { + DescribeTable(context.Context, *DescribeTableInput, ...func(*Options)) (*DescribeTableOutput, error) +} + +var _ DescribeTableAPIClient = (*Client)(nil) + +// DescribeTablePaginatorOptions is the paginator options for DescribeTable +type DescribeTablePaginatorOptions struct { + // The maximum number of tables to return in the response. If more tables exist + // than fit in one response, then NextToken is returned to page through the + // results. + 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 +} + +// DescribeTablePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.DescribeTable +type DescribeTablePaginator struct { + options DescribeTablePaginatorOptions + client DescribeTableAPIClient + params *DescribeTableInput + nextToken *string + firstPage bool +} + +// NewDescribeTablePaginator returns a new DescribeTablePaginator +func NewDescribeTablePaginator(client DescribeTableAPIClient, params *DescribeTableInput, optFns ...func(*DescribeTablePaginatorOptions)) *DescribeTablePaginator { + options := DescribeTablePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTableInput{} + } + + return &DescribeTablePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTablePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTable page. +func (p *DescribeTablePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTableOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeTable(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTable(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_GetStatementResult.go b/service/redshiftdata/api_op_GetStatementResult.go index b02af2e1a1b..e1a5e4569f5 100644 --- a/service/redshiftdata/api_op_GetStatementResult.go +++ b/service/redshiftdata/api_op_GetStatementResult.go @@ -4,6 +4,7 @@ package redshiftdata 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/redshiftdata/types" @@ -131,6 +132,81 @@ func addOperationGetStatementResultMiddlewares(stack *middleware.Stack, options return nil } +// GetStatementResultAPIClient is a client that implements the GetStatementResult +// operation. +type GetStatementResultAPIClient interface { + GetStatementResult(context.Context, *GetStatementResultInput, ...func(*Options)) (*GetStatementResultOutput, error) +} + +var _ GetStatementResultAPIClient = (*Client)(nil) + +// GetStatementResultPaginatorOptions is the paginator options for +// GetStatementResult +type GetStatementResultPaginatorOptions struct { + // 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 +} + +// GetStatementResultPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.GetStatementResult +type GetStatementResultPaginator struct { + options GetStatementResultPaginatorOptions + client GetStatementResultAPIClient + params *GetStatementResultInput + nextToken *string + firstPage bool +} + +// NewGetStatementResultPaginator returns a new GetStatementResultPaginator +func NewGetStatementResultPaginator(client GetStatementResultAPIClient, params *GetStatementResultInput, optFns ...func(*GetStatementResultPaginatorOptions)) *GetStatementResultPaginator { + options := GetStatementResultPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetStatementResultInput{} + } + + return &GetStatementResultPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetStatementResultPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetStatementResult page. +func (p *GetStatementResultPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetStatementResultOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetStatementResult(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetStatementResult(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListDatabases.go b/service/redshiftdata/api_op_ListDatabases.go index 0728252a8d1..66559e82430 100644 --- a/service/redshiftdata/api_op_ListDatabases.go +++ b/service/redshiftdata/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package redshiftdata 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/awslabs/smithy-go/middleware" @@ -145,6 +146,88 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // The maximum number of databases to return in the response. If more databases + // exist than fit in one response, then NextToken is returned to page through the + // results. + 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 +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListSchemas.go b/service/redshiftdata/api_op_ListSchemas.go index d2d22e6519b..35a86638cf4 100644 --- a/service/redshiftdata/api_op_ListSchemas.go +++ b/service/redshiftdata/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package redshiftdata 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/awslabs/smithy-go/middleware" @@ -152,6 +153,88 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return nil } +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + // The maximum number of schemas to return in the response. If more schemas exist + // than fit in one response, then NextToken is returned to page through the + // results. + 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 +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListStatements.go b/service/redshiftdata/api_op_ListStatements.go index 1de33c6eeb0..cb43a79cdba 100644 --- a/service/redshiftdata/api_op_ListStatements.go +++ b/service/redshiftdata/api_op_ListStatements.go @@ -4,6 +4,7 @@ package redshiftdata 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/redshiftdata/types" @@ -148,6 +149,89 @@ func addOperationListStatementsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListStatementsAPIClient is a client that implements the ListStatements +// operation. +type ListStatementsAPIClient interface { + ListStatements(context.Context, *ListStatementsInput, ...func(*Options)) (*ListStatementsOutput, error) +} + +var _ ListStatementsAPIClient = (*Client)(nil) + +// ListStatementsPaginatorOptions is the paginator options for ListStatements +type ListStatementsPaginatorOptions struct { + // The maximum number of SQL statements to return in the response. If more SQL + // statements exist than fit in one response, then NextToken is returned to page + // through the results. + 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 +} + +// ListStatementsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListStatements +type ListStatementsPaginator struct { + options ListStatementsPaginatorOptions + client ListStatementsAPIClient + params *ListStatementsInput + nextToken *string + firstPage bool +} + +// NewListStatementsPaginator returns a new ListStatementsPaginator +func NewListStatementsPaginator(client ListStatementsAPIClient, params *ListStatementsInput, optFns ...func(*ListStatementsPaginatorOptions)) *ListStatementsPaginator { + options := ListStatementsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStatementsInput{} + } + + return &ListStatementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStatementsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStatements page. +func (p *ListStatementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStatementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListStatements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStatements(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/api_op_ListTables.go b/service/redshiftdata/api_op_ListTables.go index ac2f2e593c4..d2647341369 100644 --- a/service/redshiftdata/api_op_ListTables.go +++ b/service/redshiftdata/api_op_ListTables.go @@ -4,6 +4,7 @@ package redshiftdata 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/redshiftdata/types" @@ -166,6 +167,88 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // The maximum number of tables to return in the response. If more tables exist + // than fit in one response, then NextToken is returned to page through the + // results. + 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 +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/redshiftdata.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/redshiftdata/endpoints.go b/service/redshiftdata/endpoints.go index 1caafc4ef06..e12c4adbc13 100644 --- a/service/redshiftdata/endpoints.go +++ b/service/redshiftdata/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/rekognition/api_op_DescribeProjectVersions.go b/service/rekognition/api_op_DescribeProjectVersions.go index 3df4d5f955e..bc54f0f4a3e 100644 --- a/service/rekognition/api_op_DescribeProjectVersions.go +++ b/service/rekognition/api_op_DescribeProjectVersions.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -132,6 +133,91 @@ func addOperationDescribeProjectVersionsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeProjectVersionsAPIClient is a client that implements the +// DescribeProjectVersions operation. +type DescribeProjectVersionsAPIClient interface { + DescribeProjectVersions(context.Context, *DescribeProjectVersionsInput, ...func(*Options)) (*DescribeProjectVersionsOutput, error) +} + +var _ DescribeProjectVersionsAPIClient = (*Client)(nil) + +// DescribeProjectVersionsPaginatorOptions is the paginator options for +// DescribeProjectVersions +type DescribeProjectVersionsPaginatorOptions struct { + // The maximum number of results to return per paginated call. The largest value + // you can specify is 100. If you specify a value greater than 100, a + // ValidationException error occurs. The default value is 100. + 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 +} + +// DescribeProjectVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.DescribeProjectVersions +type DescribeProjectVersionsPaginator struct { + options DescribeProjectVersionsPaginatorOptions + client DescribeProjectVersionsAPIClient + params *DescribeProjectVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeProjectVersionsPaginator returns a new +// DescribeProjectVersionsPaginator +func NewDescribeProjectVersionsPaginator(client DescribeProjectVersionsAPIClient, params *DescribeProjectVersionsInput, optFns ...func(*DescribeProjectVersionsPaginatorOptions)) *DescribeProjectVersionsPaginator { + options := DescribeProjectVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProjectVersionsInput{} + } + + return &DescribeProjectVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProjectVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeProjectVersions page. +func (p *DescribeProjectVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProjectVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeProjectVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProjectVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_DescribeProjects.go b/service/rekognition/api_op_DescribeProjects.go index a37b46799fd..8c48658e041 100644 --- a/service/rekognition/api_op_DescribeProjects.go +++ b/service/rekognition/api_op_DescribeProjects.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -114,6 +115,89 @@ func addOperationDescribeProjectsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeProjectsAPIClient is a client that implements the DescribeProjects +// operation. +type DescribeProjectsAPIClient interface { + DescribeProjects(context.Context, *DescribeProjectsInput, ...func(*Options)) (*DescribeProjectsOutput, error) +} + +var _ DescribeProjectsAPIClient = (*Client)(nil) + +// DescribeProjectsPaginatorOptions is the paginator options for DescribeProjects +type DescribeProjectsPaginatorOptions struct { + // The maximum number of results to return per paginated call. The largest value + // you can specify is 100. If you specify a value greater than 100, a + // ValidationException error occurs. The default value is 100. + 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 +} + +// DescribeProjectsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.DescribeProjects +type DescribeProjectsPaginator struct { + options DescribeProjectsPaginatorOptions + client DescribeProjectsAPIClient + params *DescribeProjectsInput + nextToken *string + firstPage bool +} + +// NewDescribeProjectsPaginator returns a new DescribeProjectsPaginator +func NewDescribeProjectsPaginator(client DescribeProjectsAPIClient, params *DescribeProjectsInput, optFns ...func(*DescribeProjectsPaginatorOptions)) *DescribeProjectsPaginator { + options := DescribeProjectsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProjectsInput{} + } + + return &DescribeProjectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProjectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeProjects page. +func (p *DescribeProjectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProjectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeProjects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProjects(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetCelebrityRecognition.go b/service/rekognition/api_op_GetCelebrityRecognition.go index c2492c693d4..6b451e87886 100644 --- a/service/rekognition/api_op_GetCelebrityRecognition.go +++ b/service/rekognition/api_op_GetCelebrityRecognition.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -169,6 +170,91 @@ func addOperationGetCelebrityRecognitionMiddlewares(stack *middleware.Stack, opt return nil } +// GetCelebrityRecognitionAPIClient is a client that implements the +// GetCelebrityRecognition operation. +type GetCelebrityRecognitionAPIClient interface { + GetCelebrityRecognition(context.Context, *GetCelebrityRecognitionInput, ...func(*Options)) (*GetCelebrityRecognitionOutput, error) +} + +var _ GetCelebrityRecognitionAPIClient = (*Client)(nil) + +// GetCelebrityRecognitionPaginatorOptions is the paginator options for +// GetCelebrityRecognition +type GetCelebrityRecognitionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetCelebrityRecognitionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetCelebrityRecognition +type GetCelebrityRecognitionPaginator struct { + options GetCelebrityRecognitionPaginatorOptions + client GetCelebrityRecognitionAPIClient + params *GetCelebrityRecognitionInput + nextToken *string + firstPage bool +} + +// NewGetCelebrityRecognitionPaginator returns a new +// GetCelebrityRecognitionPaginator +func NewGetCelebrityRecognitionPaginator(client GetCelebrityRecognitionAPIClient, params *GetCelebrityRecognitionInput, optFns ...func(*GetCelebrityRecognitionPaginatorOptions)) *GetCelebrityRecognitionPaginator { + options := GetCelebrityRecognitionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCelebrityRecognitionInput{} + } + + return &GetCelebrityRecognitionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCelebrityRecognitionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCelebrityRecognition page. +func (p *GetCelebrityRecognitionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCelebrityRecognitionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCelebrityRecognition(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCelebrityRecognition(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetContentModeration.go b/service/rekognition/api_op_GetContentModeration.go index 278b95a2b40..7663516e8d3 100644 --- a/service/rekognition/api_op_GetContentModeration.go +++ b/service/rekognition/api_op_GetContentModeration.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -164,6 +165,90 @@ func addOperationGetContentModerationMiddlewares(stack *middleware.Stack, option return nil } +// GetContentModerationAPIClient is a client that implements the +// GetContentModeration operation. +type GetContentModerationAPIClient interface { + GetContentModeration(context.Context, *GetContentModerationInput, ...func(*Options)) (*GetContentModerationOutput, error) +} + +var _ GetContentModerationAPIClient = (*Client)(nil) + +// GetContentModerationPaginatorOptions is the paginator options for +// GetContentModeration +type GetContentModerationPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetContentModerationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetContentModeration +type GetContentModerationPaginator struct { + options GetContentModerationPaginatorOptions + client GetContentModerationAPIClient + params *GetContentModerationInput + nextToken *string + firstPage bool +} + +// NewGetContentModerationPaginator returns a new GetContentModerationPaginator +func NewGetContentModerationPaginator(client GetContentModerationAPIClient, params *GetContentModerationInput, optFns ...func(*GetContentModerationPaginatorOptions)) *GetContentModerationPaginator { + options := GetContentModerationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetContentModerationInput{} + } + + return &GetContentModerationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetContentModerationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetContentModeration page. +func (p *GetContentModerationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetContentModerationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetContentModeration(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetContentModeration(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetFaceDetection.go b/service/rekognition/api_op_GetFaceDetection.go index 6efc42ae00d..bea98ededbe 100644 --- a/service/rekognition/api_op_GetFaceDetection.go +++ b/service/rekognition/api_op_GetFaceDetection.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -147,6 +148,89 @@ func addOperationGetFaceDetectionMiddlewares(stack *middleware.Stack, options Op return nil } +// GetFaceDetectionAPIClient is a client that implements the GetFaceDetection +// operation. +type GetFaceDetectionAPIClient interface { + GetFaceDetection(context.Context, *GetFaceDetectionInput, ...func(*Options)) (*GetFaceDetectionOutput, error) +} + +var _ GetFaceDetectionAPIClient = (*Client)(nil) + +// GetFaceDetectionPaginatorOptions is the paginator options for GetFaceDetection +type GetFaceDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetFaceDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetFaceDetection +type GetFaceDetectionPaginator struct { + options GetFaceDetectionPaginatorOptions + client GetFaceDetectionAPIClient + params *GetFaceDetectionInput + nextToken *string + firstPage bool +} + +// NewGetFaceDetectionPaginator returns a new GetFaceDetectionPaginator +func NewGetFaceDetectionPaginator(client GetFaceDetectionAPIClient, params *GetFaceDetectionInput, optFns ...func(*GetFaceDetectionPaginatorOptions)) *GetFaceDetectionPaginator { + options := GetFaceDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFaceDetectionInput{} + } + + return &GetFaceDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFaceDetectionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetFaceDetection page. +func (p *GetFaceDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFaceDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetFaceDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFaceDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetFaceSearch.go b/service/rekognition/api_op_GetFaceSearch.go index 5fb6bb51117..aadbdeeb62f 100644 --- a/service/rekognition/api_op_GetFaceSearch.go +++ b/service/rekognition/api_op_GetFaceSearch.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -163,6 +164,88 @@ func addOperationGetFaceSearchMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetFaceSearchAPIClient is a client that implements the GetFaceSearch operation. +type GetFaceSearchAPIClient interface { + GetFaceSearch(context.Context, *GetFaceSearchInput, ...func(*Options)) (*GetFaceSearchOutput, error) +} + +var _ GetFaceSearchAPIClient = (*Client)(nil) + +// GetFaceSearchPaginatorOptions is the paginator options for GetFaceSearch +type GetFaceSearchPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetFaceSearchPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetFaceSearch +type GetFaceSearchPaginator struct { + options GetFaceSearchPaginatorOptions + client GetFaceSearchAPIClient + params *GetFaceSearchInput + nextToken *string + firstPage bool +} + +// NewGetFaceSearchPaginator returns a new GetFaceSearchPaginator +func NewGetFaceSearchPaginator(client GetFaceSearchAPIClient, params *GetFaceSearchInput, optFns ...func(*GetFaceSearchPaginatorOptions)) *GetFaceSearchPaginator { + options := GetFaceSearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFaceSearchInput{} + } + + return &GetFaceSearchPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFaceSearchPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetFaceSearch page. +func (p *GetFaceSearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFaceSearchOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetFaceSearch(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFaceSearch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetLabelDetection.go b/service/rekognition/api_op_GetLabelDetection.go index 9c9b52c3d5c..d13fba34c60 100644 --- a/service/rekognition/api_op_GetLabelDetection.go +++ b/service/rekognition/api_op_GetLabelDetection.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -161,6 +162,89 @@ func addOperationGetLabelDetectionMiddlewares(stack *middleware.Stack, options O return nil } +// GetLabelDetectionAPIClient is a client that implements the GetLabelDetection +// operation. +type GetLabelDetectionAPIClient interface { + GetLabelDetection(context.Context, *GetLabelDetectionInput, ...func(*Options)) (*GetLabelDetectionOutput, error) +} + +var _ GetLabelDetectionAPIClient = (*Client)(nil) + +// GetLabelDetectionPaginatorOptions is the paginator options for GetLabelDetection +type GetLabelDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetLabelDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetLabelDetection +type GetLabelDetectionPaginator struct { + options GetLabelDetectionPaginatorOptions + client GetLabelDetectionAPIClient + params *GetLabelDetectionInput + nextToken *string + firstPage bool +} + +// NewGetLabelDetectionPaginator returns a new GetLabelDetectionPaginator +func NewGetLabelDetectionPaginator(client GetLabelDetectionAPIClient, params *GetLabelDetectionInput, optFns ...func(*GetLabelDetectionPaginatorOptions)) *GetLabelDetectionPaginator { + options := GetLabelDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetLabelDetectionInput{} + } + + return &GetLabelDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetLabelDetectionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetLabelDetection page. +func (p *GetLabelDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetLabelDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetLabelDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetLabelDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetPersonTracking.go b/service/rekognition/api_op_GetPersonTracking.go index 34a29230f09..bfeb4145f72 100644 --- a/service/rekognition/api_op_GetPersonTracking.go +++ b/service/rekognition/api_op_GetPersonTracking.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -161,6 +162,89 @@ func addOperationGetPersonTrackingMiddlewares(stack *middleware.Stack, options O return nil } +// GetPersonTrackingAPIClient is a client that implements the GetPersonTracking +// operation. +type GetPersonTrackingAPIClient interface { + GetPersonTracking(context.Context, *GetPersonTrackingInput, ...func(*Options)) (*GetPersonTrackingOutput, error) +} + +var _ GetPersonTrackingAPIClient = (*Client)(nil) + +// GetPersonTrackingPaginatorOptions is the paginator options for GetPersonTracking +type GetPersonTrackingPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. If you specify a value greater than 1000, a maximum of 1000 + // results is returned. The default value is 1000. + 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 +} + +// GetPersonTrackingPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetPersonTracking +type GetPersonTrackingPaginator struct { + options GetPersonTrackingPaginatorOptions + client GetPersonTrackingAPIClient + params *GetPersonTrackingInput + nextToken *string + firstPage bool +} + +// NewGetPersonTrackingPaginator returns a new GetPersonTrackingPaginator +func NewGetPersonTrackingPaginator(client GetPersonTrackingAPIClient, params *GetPersonTrackingInput, optFns ...func(*GetPersonTrackingPaginatorOptions)) *GetPersonTrackingPaginator { + options := GetPersonTrackingPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetPersonTrackingInput{} + } + + return &GetPersonTrackingPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetPersonTrackingPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetPersonTracking page. +func (p *GetPersonTrackingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetPersonTrackingOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetPersonTracking(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetPersonTracking(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetSegmentDetection.go b/service/rekognition/api_op_GetSegmentDetection.go index b2c32d85697..75a24896062 100644 --- a/service/rekognition/api_op_GetSegmentDetection.go +++ b/service/rekognition/api_op_GetSegmentDetection.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -169,6 +170,89 @@ func addOperationGetSegmentDetectionMiddlewares(stack *middleware.Stack, options return nil } +// GetSegmentDetectionAPIClient is a client that implements the GetSegmentDetection +// operation. +type GetSegmentDetectionAPIClient interface { + GetSegmentDetection(context.Context, *GetSegmentDetectionInput, ...func(*Options)) (*GetSegmentDetectionOutput, error) +} + +var _ GetSegmentDetectionAPIClient = (*Client)(nil) + +// GetSegmentDetectionPaginatorOptions is the paginator options for +// GetSegmentDetection +type GetSegmentDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. + 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 +} + +// GetSegmentDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetSegmentDetection +type GetSegmentDetectionPaginator struct { + options GetSegmentDetectionPaginatorOptions + client GetSegmentDetectionAPIClient + params *GetSegmentDetectionInput + nextToken *string + firstPage bool +} + +// NewGetSegmentDetectionPaginator returns a new GetSegmentDetectionPaginator +func NewGetSegmentDetectionPaginator(client GetSegmentDetectionAPIClient, params *GetSegmentDetectionInput, optFns ...func(*GetSegmentDetectionPaginatorOptions)) *GetSegmentDetectionPaginator { + options := GetSegmentDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSegmentDetectionInput{} + } + + return &GetSegmentDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSegmentDetectionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSegmentDetection page. +func (p *GetSegmentDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSegmentDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetSegmentDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSegmentDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_GetTextDetection.go b/service/rekognition/api_op_GetTextDetection.go index c210ebf4883..660297f6412 100644 --- a/service/rekognition/api_op_GetTextDetection.go +++ b/service/rekognition/api_op_GetTextDetection.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -153,6 +154,88 @@ func addOperationGetTextDetectionMiddlewares(stack *middleware.Stack, options Op return nil } +// GetTextDetectionAPIClient is a client that implements the GetTextDetection +// operation. +type GetTextDetectionAPIClient interface { + GetTextDetection(context.Context, *GetTextDetectionInput, ...func(*Options)) (*GetTextDetectionOutput, error) +} + +var _ GetTextDetectionAPIClient = (*Client)(nil) + +// GetTextDetectionPaginatorOptions is the paginator options for GetTextDetection +type GetTextDetectionPaginatorOptions struct { + // Maximum number of results to return per paginated call. The largest value you + // can specify is 1000. + 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 +} + +// GetTextDetectionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.GetTextDetection +type GetTextDetectionPaginator struct { + options GetTextDetectionPaginatorOptions + client GetTextDetectionAPIClient + params *GetTextDetectionInput + nextToken *string + firstPage bool +} + +// NewGetTextDetectionPaginator returns a new GetTextDetectionPaginator +func NewGetTextDetectionPaginator(client GetTextDetectionAPIClient, params *GetTextDetectionInput, optFns ...func(*GetTextDetectionPaginatorOptions)) *GetTextDetectionPaginator { + options := GetTextDetectionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTextDetectionInput{} + } + + return &GetTextDetectionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTextDetectionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTextDetection page. +func (p *GetTextDetectionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTextDetectionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetTextDetection(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTextDetection(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListCollections.go b/service/rekognition/api_op_ListCollections.go index e86e0ea86e0..4155fa45bae 100644 --- a/service/rekognition/api_op_ListCollections.go +++ b/service/rekognition/api_op_ListCollections.go @@ -4,6 +4,7 @@ package rekognition 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/awslabs/smithy-go/middleware" @@ -115,6 +116,87 @@ func addOperationListCollectionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListCollectionsAPIClient is a client that implements the ListCollections +// operation. +type ListCollectionsAPIClient interface { + ListCollections(context.Context, *ListCollectionsInput, ...func(*Options)) (*ListCollectionsOutput, error) +} + +var _ ListCollectionsAPIClient = (*Client)(nil) + +// ListCollectionsPaginatorOptions is the paginator options for ListCollections +type ListCollectionsPaginatorOptions struct { + // Maximum number of collection IDs 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 +} + +// ListCollectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListCollections +type ListCollectionsPaginator struct { + options ListCollectionsPaginatorOptions + client ListCollectionsAPIClient + params *ListCollectionsInput + nextToken *string + firstPage bool +} + +// NewListCollectionsPaginator returns a new ListCollectionsPaginator +func NewListCollectionsPaginator(client ListCollectionsAPIClient, params *ListCollectionsInput, optFns ...func(*ListCollectionsPaginatorOptions)) *ListCollectionsPaginator { + options := ListCollectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCollectionsInput{} + } + + return &ListCollectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCollectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCollections page. +func (p *ListCollectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCollectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCollections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCollections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListFaces.go b/service/rekognition/api_op_ListFaces.go index c93f13f0b4e..c60021b2022 100644 --- a/service/rekognition/api_op_ListFaces.go +++ b/service/rekognition/api_op_ListFaces.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -124,6 +125,86 @@ func addOperationListFacesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFacesAPIClient is a client that implements the ListFaces operation. +type ListFacesAPIClient interface { + ListFaces(context.Context, *ListFacesInput, ...func(*Options)) (*ListFacesOutput, error) +} + +var _ ListFacesAPIClient = (*Client)(nil) + +// ListFacesPaginatorOptions is the paginator options for ListFaces +type ListFacesPaginatorOptions struct { + // Maximum number of faces 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 +} + +// ListFacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListFaces +type ListFacesPaginator struct { + options ListFacesPaginatorOptions + client ListFacesAPIClient + params *ListFacesInput + nextToken *string + firstPage bool +} + +// NewListFacesPaginator returns a new ListFacesPaginator +func NewListFacesPaginator(client ListFacesAPIClient, params *ListFacesInput, optFns ...func(*ListFacesPaginatorOptions)) *ListFacesPaginator { + options := ListFacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFacesInput{} + } + + return &ListFacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFaces page. +func (p *ListFacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/api_op_ListStreamProcessors.go b/service/rekognition/api_op_ListStreamProcessors.go index 72609bda70c..3e145818724 100644 --- a/service/rekognition/api_op_ListStreamProcessors.go +++ b/service/rekognition/api_op_ListStreamProcessors.go @@ -4,6 +4,7 @@ package rekognition 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/rekognition/types" @@ -112,6 +113,89 @@ func addOperationListStreamProcessorsMiddlewares(stack *middleware.Stack, option return nil } +// ListStreamProcessorsAPIClient is a client that implements the +// ListStreamProcessors operation. +type ListStreamProcessorsAPIClient interface { + ListStreamProcessors(context.Context, *ListStreamProcessorsInput, ...func(*Options)) (*ListStreamProcessorsOutput, error) +} + +var _ ListStreamProcessorsAPIClient = (*Client)(nil) + +// ListStreamProcessorsPaginatorOptions is the paginator options for +// ListStreamProcessors +type ListStreamProcessorsPaginatorOptions struct { + // Maximum number of stream processors you want Amazon Rekognition Video to return + // in the response. The default is 1000. + 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 +} + +// ListStreamProcessorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/rekognition.ListStreamProcessors +type ListStreamProcessorsPaginator struct { + options ListStreamProcessorsPaginatorOptions + client ListStreamProcessorsAPIClient + params *ListStreamProcessorsInput + nextToken *string + firstPage bool +} + +// NewListStreamProcessorsPaginator returns a new ListStreamProcessorsPaginator +func NewListStreamProcessorsPaginator(client ListStreamProcessorsAPIClient, params *ListStreamProcessorsInput, optFns ...func(*ListStreamProcessorsPaginatorOptions)) *ListStreamProcessorsPaginator { + options := ListStreamProcessorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStreamProcessorsInput{} + } + + return &ListStreamProcessorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStreamProcessorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStreamProcessors page. +func (p *ListStreamProcessorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStreamProcessorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListStreamProcessors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStreamProcessors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/rekognition/endpoints.go b/service/rekognition/endpoints.go index d3f454c9d14..e9efcfadad6 100644 --- a/service/rekognition/endpoints.go +++ b/service/rekognition/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/resourcegroups/api_op_ListGroupResources.go b/service/resourcegroups/api_op_ListGroupResources.go index 6ccb2513527..e483eef6e18 100644 --- a/service/resourcegroups/api_op_ListGroupResources.go +++ b/service/resourcegroups/api_op_ListGroupResources.go @@ -4,6 +4,7 @@ package resourcegroups 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/resourcegroups/types" @@ -158,6 +159,96 @@ func addOperationListGroupResourcesMiddlewares(stack *middleware.Stack, options return nil } +// ListGroupResourcesAPIClient is a client that implements the ListGroupResources +// operation. +type ListGroupResourcesAPIClient interface { + ListGroupResources(context.Context, *ListGroupResourcesInput, ...func(*Options)) (*ListGroupResourcesOutput, error) +} + +var _ ListGroupResourcesAPIClient = (*Client)(nil) + +// ListGroupResourcesPaginatorOptions is the paginator options for +// ListGroupResources +type ListGroupResourcesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListGroupResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.ListGroupResources +type ListGroupResourcesPaginator struct { + options ListGroupResourcesPaginatorOptions + client ListGroupResourcesAPIClient + params *ListGroupResourcesInput + nextToken *string + firstPage bool +} + +// NewListGroupResourcesPaginator returns a new ListGroupResourcesPaginator +func NewListGroupResourcesPaginator(client ListGroupResourcesAPIClient, params *ListGroupResourcesInput, optFns ...func(*ListGroupResourcesPaginatorOptions)) *ListGroupResourcesPaginator { + options := ListGroupResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupResourcesInput{} + } + + return &ListGroupResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroupResources page. +func (p *ListGroupResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroupResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/api_op_ListGroups.go b/service/resourcegroups/api_op_ListGroups.go index 46d14f995c4..f46e5865f0e 100644 --- a/service/resourcegroups/api_op_ListGroups.go +++ b/service/resourcegroups/api_op_ListGroups.go @@ -4,6 +4,7 @@ package resourcegroups 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/resourcegroups/types" @@ -142,6 +143,94 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/api_op_SearchResources.go b/service/resourcegroups/api_op_SearchResources.go index 0879d2619e5..3fdf4ca41ff 100644 --- a/service/resourcegroups/api_op_SearchResources.go +++ b/service/resourcegroups/api_op_SearchResources.go @@ -4,6 +4,7 @@ package resourcegroups 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/resourcegroups/types" @@ -136,6 +137,95 @@ func addOperationSearchResourcesMiddlewares(stack *middleware.Stack, options Opt return nil } +// SearchResourcesAPIClient is a client that implements the SearchResources +// operation. +type SearchResourcesAPIClient interface { + SearchResources(context.Context, *SearchResourcesInput, ...func(*Options)) (*SearchResourcesOutput, error) +} + +var _ SearchResourcesAPIClient = (*Client)(nil) + +// SearchResourcesPaginatorOptions is the paginator options for SearchResources +type SearchResourcesPaginatorOptions struct { + // The total number of results that you want included on each page of the response. + // If you do not include this parameter, it defaults to a value that is specific to + // the operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (is not null). Include + // that value as the NextToken request parameter in the next call to the operation + // to get the next part of the results. Note that the service might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// SearchResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroups.SearchResources +type SearchResourcesPaginator struct { + options SearchResourcesPaginatorOptions + client SearchResourcesAPIClient + params *SearchResourcesInput + nextToken *string + firstPage bool +} + +// NewSearchResourcesPaginator returns a new SearchResourcesPaginator +func NewSearchResourcesPaginator(client SearchResourcesAPIClient, params *SearchResourcesInput, optFns ...func(*SearchResourcesPaginatorOptions)) *SearchResourcesPaginator { + options := SearchResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchResourcesInput{} + } + + return &SearchResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchResources page. +func (p *SearchResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.SearchResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroups/endpoints.go b/service/resourcegroups/endpoints.go index 5b635e7febc..4bd5e382ec5 100644 --- a/service/resourcegroups/endpoints.go +++ b/service/resourcegroups/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go b/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go index e28dd971c67..2dfcdb64fec 100644 --- a/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go +++ b/service/resourcegroupstaggingapi/api_op_GetComplianceSummary.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi 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/resourcegroupstaggingapi/types" @@ -158,6 +159,88 @@ func addOperationGetComplianceSummaryMiddlewares(stack *middleware.Stack, option return nil } +// GetComplianceSummaryAPIClient is a client that implements the +// GetComplianceSummary operation. +type GetComplianceSummaryAPIClient interface { + GetComplianceSummary(context.Context, *GetComplianceSummaryInput, ...func(*Options)) (*GetComplianceSummaryOutput, error) +} + +var _ GetComplianceSummaryAPIClient = (*Client)(nil) + +// GetComplianceSummaryPaginatorOptions is the paginator options for +// GetComplianceSummary +type GetComplianceSummaryPaginatorOptions struct { + // A limit that restricts the number of results that are returned per page. + 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 +} + +// GetComplianceSummaryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetComplianceSummary +type GetComplianceSummaryPaginator struct { + options GetComplianceSummaryPaginatorOptions + client GetComplianceSummaryAPIClient + params *GetComplianceSummaryInput + nextToken *string + firstPage bool +} + +// NewGetComplianceSummaryPaginator returns a new GetComplianceSummaryPaginator +func NewGetComplianceSummaryPaginator(client GetComplianceSummaryAPIClient, params *GetComplianceSummaryInput, optFns ...func(*GetComplianceSummaryPaginatorOptions)) *GetComplianceSummaryPaginator { + options := GetComplianceSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetComplianceSummaryInput{} + } + + return &GetComplianceSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetComplianceSummaryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetComplianceSummary page. +func (p *GetComplianceSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetComplianceSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetComplianceSummary(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetComplianceSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetResources.go b/service/resourcegroupstaggingapi/api_op_GetResources.go index 63e6a457dd6..2f4d2e98522 100644 --- a/service/resourcegroupstaggingapi/api_op_GetResources.go +++ b/service/resourcegroupstaggingapi/api_op_GetResources.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi 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/resourcegroupstaggingapi/types" @@ -221,6 +222,88 @@ func addOperationGetResourcesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetResourcesAPIClient is a client that implements the GetResources operation. +type GetResourcesAPIClient interface { + GetResources(context.Context, *GetResourcesInput, ...func(*Options)) (*GetResourcesOutput, error) +} + +var _ GetResourcesAPIClient = (*Client)(nil) + +// GetResourcesPaginatorOptions is the paginator options for GetResources +type GetResourcesPaginatorOptions struct { + // A limit that restricts the number of resources returned by GetResources in + // paginated output. You can set ResourcesPerPage to a minimum of 1 item and the + // maximum of 100 items. + 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 +} + +// GetResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetResources +type GetResourcesPaginator struct { + options GetResourcesPaginatorOptions + client GetResourcesAPIClient + params *GetResourcesInput + nextToken *string + firstPage bool +} + +// NewGetResourcesPaginator returns a new GetResourcesPaginator +func NewGetResourcesPaginator(client GetResourcesAPIClient, params *GetResourcesInput, optFns ...func(*GetResourcesPaginatorOptions)) *GetResourcesPaginator { + options := GetResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetResourcesInput{} + } + + return &GetResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetResources page. +func (p *GetResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + if p.options.Limit > 0 { + params.ResourcesPerPage = &p.options.Limit + } + + result, err := p.client.GetResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetTagKeys.go b/service/resourcegroupstaggingapi/api_op_GetTagKeys.go index c6c38f2926c..6079a284525 100644 --- a/service/resourcegroupstaggingapi/api_op_GetTagKeys.go +++ b/service/resourcegroupstaggingapi/api_op_GetTagKeys.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi 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/awslabs/smithy-go/middleware" @@ -106,6 +107,79 @@ func addOperationGetTagKeysMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetTagKeysAPIClient is a client that implements the GetTagKeys operation. +type GetTagKeysAPIClient interface { + GetTagKeys(context.Context, *GetTagKeysInput, ...func(*Options)) (*GetTagKeysOutput, error) +} + +var _ GetTagKeysAPIClient = (*Client)(nil) + +// GetTagKeysPaginatorOptions is the paginator options for GetTagKeys +type GetTagKeysPaginatorOptions struct { + // 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 +} + +// GetTagKeysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetTagKeys +type GetTagKeysPaginator struct { + options GetTagKeysPaginatorOptions + client GetTagKeysAPIClient + params *GetTagKeysInput + nextToken *string + firstPage bool +} + +// NewGetTagKeysPaginator returns a new GetTagKeysPaginator +func NewGetTagKeysPaginator(client GetTagKeysAPIClient, params *GetTagKeysInput, optFns ...func(*GetTagKeysPaginatorOptions)) *GetTagKeysPaginator { + options := GetTagKeysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTagKeysInput{} + } + + return &GetTagKeysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagKeysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTagKeys page. +func (p *GetTagKeysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagKeysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + result, err := p.client.GetTagKeys(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTagKeys(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/api_op_GetTagValues.go b/service/resourcegroupstaggingapi/api_op_GetTagValues.go index 7de25a898b6..9f301aa40bd 100644 --- a/service/resourcegroupstaggingapi/api_op_GetTagValues.go +++ b/service/resourcegroupstaggingapi/api_op_GetTagValues.go @@ -4,6 +4,7 @@ package resourcegroupstaggingapi 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/awslabs/smithy-go/middleware" @@ -117,6 +118,79 @@ func addOperationGetTagValuesMiddlewares(stack *middleware.Stack, options Option return nil } +// GetTagValuesAPIClient is a client that implements the GetTagValues operation. +type GetTagValuesAPIClient interface { + GetTagValues(context.Context, *GetTagValuesInput, ...func(*Options)) (*GetTagValuesOutput, error) +} + +var _ GetTagValuesAPIClient = (*Client)(nil) + +// GetTagValuesPaginatorOptions is the paginator options for GetTagValues +type GetTagValuesPaginatorOptions struct { + // 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 +} + +// GetTagValuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi.GetTagValues +type GetTagValuesPaginator struct { + options GetTagValuesPaginatorOptions + client GetTagValuesAPIClient + params *GetTagValuesInput + nextToken *string + firstPage bool +} + +// NewGetTagValuesPaginator returns a new GetTagValuesPaginator +func NewGetTagValuesPaginator(client GetTagValuesAPIClient, params *GetTagValuesInput, optFns ...func(*GetTagValuesPaginatorOptions)) *GetTagValuesPaginator { + options := GetTagValuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTagValuesInput{} + } + + return &GetTagValuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTagValuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTagValues page. +func (p *GetTagValuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTagValuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PaginationToken = p.nextToken + result, err := p.client.GetTagValues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PaginationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTagValues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/resourcegroupstaggingapi/endpoints.go b/service/resourcegroupstaggingapi/endpoints.go index 2d956fca17b..060f638dc4a 100644 --- a/service/resourcegroupstaggingapi/endpoints.go +++ b/service/resourcegroupstaggingapi/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/robomaker/api_op_ListDeploymentJobs.go b/service/robomaker/api_op_ListDeploymentJobs.go index bbcf01d12e9..3ac4a213ef5 100644 --- a/service/robomaker/api_op_ListDeploymentJobs.go +++ b/service/robomaker/api_op_ListDeploymentJobs.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -126,6 +127,93 @@ func addOperationListDeploymentJobsMiddlewares(stack *middleware.Stack, options return nil } +// ListDeploymentJobsAPIClient is a client that implements the ListDeploymentJobs +// operation. +type ListDeploymentJobsAPIClient interface { + ListDeploymentJobs(context.Context, *ListDeploymentJobsInput, ...func(*Options)) (*ListDeploymentJobsOutput, error) +} + +var _ ListDeploymentJobsAPIClient = (*Client)(nil) + +// ListDeploymentJobsPaginatorOptions is the paginator options for +// ListDeploymentJobs +type ListDeploymentJobsPaginatorOptions struct { + // When this parameter is used, ListDeploymentJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListDeploymentJobs request + // with the returned nextToken value. This value can be between 1 and 200. If this + // parameter is not used, then ListDeploymentJobs returns up to 200 results and a + // nextToken value if applicable. + 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 +} + +// ListDeploymentJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListDeploymentJobs +type ListDeploymentJobsPaginator struct { + options ListDeploymentJobsPaginatorOptions + client ListDeploymentJobsAPIClient + params *ListDeploymentJobsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentJobsPaginator returns a new ListDeploymentJobsPaginator +func NewListDeploymentJobsPaginator(client ListDeploymentJobsAPIClient, params *ListDeploymentJobsInput, optFns ...func(*ListDeploymentJobsPaginatorOptions)) *ListDeploymentJobsPaginator { + options := ListDeploymentJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentJobsInput{} + } + + return &ListDeploymentJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeploymentJobs page. +func (p *ListDeploymentJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDeploymentJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeploymentJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListFleets.go b/service/robomaker/api_op_ListFleets.go index 38bfb198906..56badf769ec 100644 --- a/service/robomaker/api_op_ListFleets.go +++ b/service/robomaker/api_op_ListFleets.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -126,6 +127,91 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // When this parameter is used, ListFleets only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListFleets request with the + // returned nextToken value. This value can be between 1 and 200. If this parameter + // is not used, then ListFleets returns up to 200 results and a nextToken value if + // applicable. + 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 +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListRobotApplications.go b/service/robomaker/api_op_ListRobotApplications.go index 9753cd71f37..ecaec6d1292 100644 --- a/service/robomaker/api_op_ListRobotApplications.go +++ b/service/robomaker/api_op_ListRobotApplications.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -127,6 +128,93 @@ func addOperationListRobotApplicationsMiddlewares(stack *middleware.Stack, optio return nil } +// ListRobotApplicationsAPIClient is a client that implements the +// ListRobotApplications operation. +type ListRobotApplicationsAPIClient interface { + ListRobotApplications(context.Context, *ListRobotApplicationsInput, ...func(*Options)) (*ListRobotApplicationsOutput, error) +} + +var _ ListRobotApplicationsAPIClient = (*Client)(nil) + +// ListRobotApplicationsPaginatorOptions is the paginator options for +// ListRobotApplications +type ListRobotApplicationsPaginatorOptions struct { + // When this parameter is used, ListRobotApplications only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListRobotApplications request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then ListRobotApplications + // returns up to 100 results and a nextToken value if applicable. + 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 +} + +// ListRobotApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListRobotApplications +type ListRobotApplicationsPaginator struct { + options ListRobotApplicationsPaginatorOptions + client ListRobotApplicationsAPIClient + params *ListRobotApplicationsInput + nextToken *string + firstPage bool +} + +// NewListRobotApplicationsPaginator returns a new ListRobotApplicationsPaginator +func NewListRobotApplicationsPaginator(client ListRobotApplicationsAPIClient, params *ListRobotApplicationsInput, optFns ...func(*ListRobotApplicationsPaginatorOptions)) *ListRobotApplicationsPaginator { + options := ListRobotApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRobotApplicationsInput{} + } + + return &ListRobotApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRobotApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRobotApplications page. +func (p *ListRobotApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRobotApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRobotApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListRobots.go b/service/robomaker/api_op_ListRobots.go index 08840a925f7..9a2b2527869 100644 --- a/service/robomaker/api_op_ListRobots.go +++ b/service/robomaker/api_op_ListRobots.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -126,6 +127,91 @@ func addOperationListRobotsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListRobotsAPIClient is a client that implements the ListRobots operation. +type ListRobotsAPIClient interface { + ListRobots(context.Context, *ListRobotsInput, ...func(*Options)) (*ListRobotsOutput, error) +} + +var _ ListRobotsAPIClient = (*Client)(nil) + +// ListRobotsPaginatorOptions is the paginator options for ListRobots +type ListRobotsPaginatorOptions struct { + // When this parameter is used, ListRobots only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListRobots request with the + // returned nextToken value. This value can be between 1 and 200. If this parameter + // is not used, then ListRobots returns up to 200 results and a nextToken value if + // applicable. + 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 +} + +// ListRobotsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListRobots +type ListRobotsPaginator struct { + options ListRobotsPaginatorOptions + client ListRobotsAPIClient + params *ListRobotsInput + nextToken *string + firstPage bool +} + +// NewListRobotsPaginator returns a new ListRobotsPaginator +func NewListRobotsPaginator(client ListRobotsAPIClient, params *ListRobotsInput, optFns ...func(*ListRobotsPaginatorOptions)) *ListRobotsPaginator { + options := ListRobotsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRobotsInput{} + } + + return &ListRobotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRobotsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRobots page. +func (p *ListRobotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRobotsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRobots(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRobots(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationApplications.go b/service/robomaker/api_op_ListSimulationApplications.go index cc3b2164529..020f3b6f768 100644 --- a/service/robomaker/api_op_ListSimulationApplications.go +++ b/service/robomaker/api_op_ListSimulationApplications.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -129,6 +130,95 @@ func addOperationListSimulationApplicationsMiddlewares(stack *middleware.Stack, return nil } +// ListSimulationApplicationsAPIClient is a client that implements the +// ListSimulationApplications operation. +type ListSimulationApplicationsAPIClient interface { + ListSimulationApplications(context.Context, *ListSimulationApplicationsInput, ...func(*Options)) (*ListSimulationApplicationsOutput, error) +} + +var _ ListSimulationApplicationsAPIClient = (*Client)(nil) + +// ListSimulationApplicationsPaginatorOptions is the paginator options for +// ListSimulationApplications +type ListSimulationApplicationsPaginatorOptions struct { + // When this parameter is used, ListSimulationApplications only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListSimulationApplications request with the returned nextToken value. This value + // can be between 1 and 100. If this parameter is not used, then + // ListSimulationApplications returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListSimulationApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationApplications +type ListSimulationApplicationsPaginator struct { + options ListSimulationApplicationsPaginatorOptions + client ListSimulationApplicationsAPIClient + params *ListSimulationApplicationsInput + nextToken *string + firstPage bool +} + +// NewListSimulationApplicationsPaginator returns a new +// ListSimulationApplicationsPaginator +func NewListSimulationApplicationsPaginator(client ListSimulationApplicationsAPIClient, params *ListSimulationApplicationsInput, optFns ...func(*ListSimulationApplicationsPaginatorOptions)) *ListSimulationApplicationsPaginator { + options := ListSimulationApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationApplicationsInput{} + } + + return &ListSimulationApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSimulationApplications page. +func (p *ListSimulationApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSimulationApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationJobBatches.go b/service/robomaker/api_op_ListSimulationJobBatches.go index 51c82d19d12..43688c0c4ab 100644 --- a/service/robomaker/api_op_ListSimulationJobBatches.go +++ b/service/robomaker/api_op_ListSimulationJobBatches.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -120,6 +121,92 @@ func addOperationListSimulationJobBatchesMiddlewares(stack *middleware.Stack, op return nil } +// ListSimulationJobBatchesAPIClient is a client that implements the +// ListSimulationJobBatches operation. +type ListSimulationJobBatchesAPIClient interface { + ListSimulationJobBatches(context.Context, *ListSimulationJobBatchesInput, ...func(*Options)) (*ListSimulationJobBatchesOutput, error) +} + +var _ ListSimulationJobBatchesAPIClient = (*Client)(nil) + +// ListSimulationJobBatchesPaginatorOptions is the paginator options for +// ListSimulationJobBatches +type ListSimulationJobBatchesPaginatorOptions struct { + // When this parameter is used, ListSimulationJobBatches only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListSimulationJobBatches request with the returned nextToken value. + 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 +} + +// ListSimulationJobBatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationJobBatches +type ListSimulationJobBatchesPaginator struct { + options ListSimulationJobBatchesPaginatorOptions + client ListSimulationJobBatchesAPIClient + params *ListSimulationJobBatchesInput + nextToken *string + firstPage bool +} + +// NewListSimulationJobBatchesPaginator returns a new +// ListSimulationJobBatchesPaginator +func NewListSimulationJobBatchesPaginator(client ListSimulationJobBatchesAPIClient, params *ListSimulationJobBatchesInput, optFns ...func(*ListSimulationJobBatchesPaginatorOptions)) *ListSimulationJobBatchesPaginator { + options := ListSimulationJobBatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationJobBatchesInput{} + } + + return &ListSimulationJobBatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationJobBatchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSimulationJobBatches page. +func (p *ListSimulationJobBatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobBatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSimulationJobBatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationJobBatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListSimulationJobs.go b/service/robomaker/api_op_ListSimulationJobs.go index 18c4f171614..58516d638c6 100644 --- a/service/robomaker/api_op_ListSimulationJobs.go +++ b/service/robomaker/api_op_ListSimulationJobs.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -128,6 +129,93 @@ func addOperationListSimulationJobsMiddlewares(stack *middleware.Stack, options return nil } +// ListSimulationJobsAPIClient is a client that implements the ListSimulationJobs +// operation. +type ListSimulationJobsAPIClient interface { + ListSimulationJobs(context.Context, *ListSimulationJobsInput, ...func(*Options)) (*ListSimulationJobsOutput, error) +} + +var _ ListSimulationJobsAPIClient = (*Client)(nil) + +// ListSimulationJobsPaginatorOptions is the paginator options for +// ListSimulationJobs +type ListSimulationJobsPaginatorOptions struct { + // When this parameter is used, ListSimulationJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListSimulationJobs request + // with the returned nextToken value. This value can be between 1 and 1000. If this + // parameter is not used, then ListSimulationJobs returns up to 1000 results and a + // nextToken value if applicable. + 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 +} + +// ListSimulationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListSimulationJobs +type ListSimulationJobsPaginator struct { + options ListSimulationJobsPaginatorOptions + client ListSimulationJobsAPIClient + params *ListSimulationJobsInput + nextToken *string + firstPage bool +} + +// NewListSimulationJobsPaginator returns a new ListSimulationJobsPaginator +func NewListSimulationJobsPaginator(client ListSimulationJobsAPIClient, params *ListSimulationJobsInput, optFns ...func(*ListSimulationJobsPaginatorOptions)) *ListSimulationJobsPaginator { + options := ListSimulationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSimulationJobsInput{} + } + + return &ListSimulationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSimulationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSimulationJobs page. +func (p *ListSimulationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSimulationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSimulationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSimulationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldExportJobs.go b/service/robomaker/api_op_ListWorldExportJobs.go index ddac24122b7..a3f1fb703bb 100644 --- a/service/robomaker/api_op_ListWorldExportJobs.go +++ b/service/robomaker/api_op_ListWorldExportJobs.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -123,6 +124,93 @@ func addOperationListWorldExportJobsMiddlewares(stack *middleware.Stack, options return nil } +// ListWorldExportJobsAPIClient is a client that implements the ListWorldExportJobs +// operation. +type ListWorldExportJobsAPIClient interface { + ListWorldExportJobs(context.Context, *ListWorldExportJobsInput, ...func(*Options)) (*ListWorldExportJobsOutput, error) +} + +var _ ListWorldExportJobsAPIClient = (*Client)(nil) + +// ListWorldExportJobsPaginatorOptions is the paginator options for +// ListWorldExportJobs +type ListWorldExportJobsPaginatorOptions struct { + // When this parameter is used, ListWorldExportJobs only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListWorldExportJobs + // request with the returned nextToken value. This value can be between 1 and 100. + // If this parameter is not used, then ListWorldExportJobs returns up to 100 + // results and a nextToken value if applicable. + 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 +} + +// ListWorldExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldExportJobs +type ListWorldExportJobsPaginator struct { + options ListWorldExportJobsPaginatorOptions + client ListWorldExportJobsAPIClient + params *ListWorldExportJobsInput + nextToken *string + firstPage bool +} + +// NewListWorldExportJobsPaginator returns a new ListWorldExportJobsPaginator +func NewListWorldExportJobsPaginator(client ListWorldExportJobsAPIClient, params *ListWorldExportJobsInput, optFns ...func(*ListWorldExportJobsPaginatorOptions)) *ListWorldExportJobsPaginator { + options := ListWorldExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldExportJobsInput{} + } + + return &ListWorldExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldExportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorldExportJobs page. +func (p *ListWorldExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorldExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldGenerationJobs.go b/service/robomaker/api_op_ListWorldGenerationJobs.go index 6ecc5c71ee7..538e151641f 100644 --- a/service/robomaker/api_op_ListWorldGenerationJobs.go +++ b/service/robomaker/api_op_ListWorldGenerationJobs.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -125,6 +126,94 @@ func addOperationListWorldGenerationJobsMiddlewares(stack *middleware.Stack, opt return nil } +// ListWorldGenerationJobsAPIClient is a client that implements the +// ListWorldGenerationJobs operation. +type ListWorldGenerationJobsAPIClient interface { + ListWorldGenerationJobs(context.Context, *ListWorldGenerationJobsInput, ...func(*Options)) (*ListWorldGenerationJobsOutput, error) +} + +var _ ListWorldGenerationJobsAPIClient = (*Client)(nil) + +// ListWorldGenerationJobsPaginatorOptions is the paginator options for +// ListWorldGenerationJobs +type ListWorldGenerationJobsPaginatorOptions struct { + // When this parameter is used, ListWorldGeneratorJobs only returns maxResults + // results in a single page along with a nextToken response element. The remaining + // results of the initial request can be seen by sending another + // ListWorldGeneratorJobs request with the returned nextToken value. This value can + // be between 1 and 100. If this parameter is not used, then ListWorldGeneratorJobs + // returns up to 100 results and a nextToken value if applicable. + 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 +} + +// ListWorldGenerationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldGenerationJobs +type ListWorldGenerationJobsPaginator struct { + options ListWorldGenerationJobsPaginatorOptions + client ListWorldGenerationJobsAPIClient + params *ListWorldGenerationJobsInput + nextToken *string + firstPage bool +} + +// NewListWorldGenerationJobsPaginator returns a new +// ListWorldGenerationJobsPaginator +func NewListWorldGenerationJobsPaginator(client ListWorldGenerationJobsAPIClient, params *ListWorldGenerationJobsInput, optFns ...func(*ListWorldGenerationJobsPaginatorOptions)) *ListWorldGenerationJobsPaginator { + options := ListWorldGenerationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldGenerationJobsInput{} + } + + return &ListWorldGenerationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldGenerationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorldGenerationJobs page. +func (p *ListWorldGenerationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldGenerationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorldGenerationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldGenerationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorldTemplates.go b/service/robomaker/api_op_ListWorldTemplates.go index d4a4f1b24f1..374a16af92e 100644 --- a/service/robomaker/api_op_ListWorldTemplates.go +++ b/service/robomaker/api_op_ListWorldTemplates.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -118,6 +119,93 @@ func addOperationListWorldTemplatesMiddlewares(stack *middleware.Stack, options return nil } +// ListWorldTemplatesAPIClient is a client that implements the ListWorldTemplates +// operation. +type ListWorldTemplatesAPIClient interface { + ListWorldTemplates(context.Context, *ListWorldTemplatesInput, ...func(*Options)) (*ListWorldTemplatesOutput, error) +} + +var _ ListWorldTemplatesAPIClient = (*Client)(nil) + +// ListWorldTemplatesPaginatorOptions is the paginator options for +// ListWorldTemplates +type ListWorldTemplatesPaginatorOptions struct { + // When this parameter is used, ListWorldTemplates only returns maxResults results + // in a single page along with a nextToken response element. The remaining results + // of the initial request can be seen by sending another ListWorldTemplates request + // with the returned nextToken value. This value can be between 1 and 100. If this + // parameter is not used, then ListWorldTemplates returns up to 100 results and a + // nextToken value if applicable. + 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 +} + +// ListWorldTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorldTemplates +type ListWorldTemplatesPaginator struct { + options ListWorldTemplatesPaginatorOptions + client ListWorldTemplatesAPIClient + params *ListWorldTemplatesInput + nextToken *string + firstPage bool +} + +// NewListWorldTemplatesPaginator returns a new ListWorldTemplatesPaginator +func NewListWorldTemplatesPaginator(client ListWorldTemplatesAPIClient, params *ListWorldTemplatesInput, optFns ...func(*ListWorldTemplatesPaginatorOptions)) *ListWorldTemplatesPaginator { + options := ListWorldTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldTemplatesInput{} + } + + return &ListWorldTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorldTemplates page. +func (p *ListWorldTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorldTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorldTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/api_op_ListWorlds.go b/service/robomaker/api_op_ListWorlds.go index cdce19ea84e..4f54fc7aa65 100644 --- a/service/robomaker/api_op_ListWorlds.go +++ b/service/robomaker/api_op_ListWorlds.go @@ -4,6 +4,7 @@ package robomaker 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/robomaker/types" @@ -121,6 +122,91 @@ func addOperationListWorldsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListWorldsAPIClient is a client that implements the ListWorlds operation. +type ListWorldsAPIClient interface { + ListWorlds(context.Context, *ListWorldsInput, ...func(*Options)) (*ListWorldsOutput, error) +} + +var _ ListWorldsAPIClient = (*Client)(nil) + +// ListWorldsPaginatorOptions is the paginator options for ListWorlds +type ListWorldsPaginatorOptions struct { + // When this parameter is used, ListWorlds only returns maxResults results in a + // single page along with a nextToken response element. The remaining results of + // the initial request can be seen by sending another ListWorlds request with the + // returned nextToken value. This value can be between 1 and 100. If this parameter + // is not used, then ListWorlds returns up to 100 results and a nextToken value if + // applicable. + 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 +} + +// ListWorldsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/robomaker.ListWorlds +type ListWorldsPaginator struct { + options ListWorldsPaginatorOptions + client ListWorldsAPIClient + params *ListWorldsInput + nextToken *string + firstPage bool +} + +// NewListWorldsPaginator returns a new ListWorldsPaginator +func NewListWorldsPaginator(client ListWorldsAPIClient, params *ListWorldsInput, optFns ...func(*ListWorldsPaginatorOptions)) *ListWorldsPaginator { + options := ListWorldsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorldsInput{} + } + + return &ListWorldsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorldsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorlds page. +func (p *ListWorldsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorldsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorlds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorlds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/robomaker/endpoints.go b/service/robomaker/endpoints.go index f9948cd2a8a..1650c1ca409 100644 --- a/service/robomaker/endpoints.go +++ b/service/robomaker/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/route53/endpoints.go b/service/route53/endpoints.go index cd3270b7896..4b184e9aa56 100644 --- a/service/route53/endpoints.go +++ b/service/route53/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/route53domains/api_op_ListDomains.go b/service/route53domains/api_op_ListDomains.go index 52a1281f3d2..df26e5d917c 100644 --- a/service/route53domains/api_op_ListDomains.go +++ b/service/route53domains/api_op_ListDomains.go @@ -4,6 +4,7 @@ package route53domains 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/route53domains/types" @@ -116,6 +117,86 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // Number of domains to be returned. Default: 20 + 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 +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53domains.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53domains/api_op_ListOperations.go b/service/route53domains/api_op_ListOperations.go index 4efeaa90727..e4b01052cdd 100644 --- a/service/route53domains/api_op_ListOperations.go +++ b/service/route53domains/api_op_ListOperations.go @@ -4,6 +4,7 @@ package route53domains 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/route53domains/types" @@ -123,6 +124,87 @@ func addOperationListOperationsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListOperationsAPIClient is a client that implements the ListOperations +// operation. +type ListOperationsAPIClient interface { + ListOperations(context.Context, *ListOperationsInput, ...func(*Options)) (*ListOperationsOutput, error) +} + +var _ ListOperationsAPIClient = (*Client)(nil) + +// ListOperationsPaginatorOptions is the paginator options for ListOperations +type ListOperationsPaginatorOptions struct { + // Number of domains to be returned. Default: 20 + 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 +} + +// ListOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53domains.ListOperations +type ListOperationsPaginator struct { + options ListOperationsPaginatorOptions + client ListOperationsAPIClient + params *ListOperationsInput + nextToken *string + firstPage bool +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOperationsInput{} + } + + return &ListOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOperationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOperations page. +func (p *ListOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53domains/endpoints.go b/service/route53domains/endpoints.go index 2b03abc2b42..b032b87dd12 100644 --- a/service/route53domains/endpoints.go +++ b/service/route53domains/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go b/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go index 78d0c52c992..e79d7caba70 100644 --- a/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go +++ b/service/route53resolver/api_op_ListResolverEndpointIpAddresses.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -127,6 +128,91 @@ func addOperationListResolverEndpointIpAddressesMiddlewares(stack *middleware.St return nil } +// ListResolverEndpointIpAddressesAPIClient is a client that implements the +// ListResolverEndpointIpAddresses operation. +type ListResolverEndpointIpAddressesAPIClient interface { + ListResolverEndpointIpAddresses(context.Context, *ListResolverEndpointIpAddressesInput, ...func(*Options)) (*ListResolverEndpointIpAddressesOutput, error) +} + +var _ ListResolverEndpointIpAddressesAPIClient = (*Client)(nil) + +// ListResolverEndpointIpAddressesPaginatorOptions is the paginator options for +// ListResolverEndpointIpAddresses +type ListResolverEndpointIpAddressesPaginatorOptions struct { + // The maximum number of IP addresses that you want to return in the response to a + // ListResolverEndpointIpAddresses request. If you don't specify a value for + // MaxResults, Resolver returns up to 100 IP addresses. + 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 +} + +// ListResolverEndpointIpAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverEndpointIpAddresses +type ListResolverEndpointIpAddressesPaginator struct { + options ListResolverEndpointIpAddressesPaginatorOptions + client ListResolverEndpointIpAddressesAPIClient + params *ListResolverEndpointIpAddressesInput + nextToken *string + firstPage bool +} + +// NewListResolverEndpointIpAddressesPaginator returns a new +// ListResolverEndpointIpAddressesPaginator +func NewListResolverEndpointIpAddressesPaginator(client ListResolverEndpointIpAddressesAPIClient, params *ListResolverEndpointIpAddressesInput, optFns ...func(*ListResolverEndpointIpAddressesPaginatorOptions)) *ListResolverEndpointIpAddressesPaginator { + options := ListResolverEndpointIpAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverEndpointIpAddressesInput{} + } + + return &ListResolverEndpointIpAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverEndpointIpAddressesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverEndpointIpAddresses page. +func (p *ListResolverEndpointIpAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverEndpointIpAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverEndpointIpAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverEndpointIpAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverEndpoints.go b/service/route53resolver/api_op_ListResolverEndpoints.go index e2bc6a22759..6945432bf3d 100644 --- a/service/route53resolver/api_op_ListResolverEndpoints.go +++ b/service/route53resolver/api_op_ListResolverEndpoints.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -123,6 +124,90 @@ func addOperationListResolverEndpointsMiddlewares(stack *middleware.Stack, optio return nil } +// ListResolverEndpointsAPIClient is a client that implements the +// ListResolverEndpoints operation. +type ListResolverEndpointsAPIClient interface { + ListResolverEndpoints(context.Context, *ListResolverEndpointsInput, ...func(*Options)) (*ListResolverEndpointsOutput, error) +} + +var _ ListResolverEndpointsAPIClient = (*Client)(nil) + +// ListResolverEndpointsPaginatorOptions is the paginator options for +// ListResolverEndpoints +type ListResolverEndpointsPaginatorOptions struct { + // The maximum number of Resolver endpoints that you want to return in the response + // to a ListResolverEndpoints request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 Resolver endpoints. + 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 +} + +// ListResolverEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverEndpoints +type ListResolverEndpointsPaginator struct { + options ListResolverEndpointsPaginatorOptions + client ListResolverEndpointsAPIClient + params *ListResolverEndpointsInput + nextToken *string + firstPage bool +} + +// NewListResolverEndpointsPaginator returns a new ListResolverEndpointsPaginator +func NewListResolverEndpointsPaginator(client ListResolverEndpointsAPIClient, params *ListResolverEndpointsInput, optFns ...func(*ListResolverEndpointsPaginatorOptions)) *ListResolverEndpointsPaginator { + options := ListResolverEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverEndpointsInput{} + } + + return &ListResolverEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverEndpoints page. +func (p *ListResolverEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go b/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go index 72e5c927a9b..bf3a88d7d09 100644 --- a/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go +++ b/service/route53resolver/api_op_ListResolverQueryLogConfigAssociations.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -197,6 +198,92 @@ func addOperationListResolverQueryLogConfigAssociationsMiddlewares(stack *middle return nil } +// ListResolverQueryLogConfigAssociationsAPIClient is a client that implements the +// ListResolverQueryLogConfigAssociations operation. +type ListResolverQueryLogConfigAssociationsAPIClient interface { + ListResolverQueryLogConfigAssociations(context.Context, *ListResolverQueryLogConfigAssociationsInput, ...func(*Options)) (*ListResolverQueryLogConfigAssociationsOutput, error) +} + +var _ ListResolverQueryLogConfigAssociationsAPIClient = (*Client)(nil) + +// ListResolverQueryLogConfigAssociationsPaginatorOptions is the paginator options +// for ListResolverQueryLogConfigAssociations +type ListResolverQueryLogConfigAssociationsPaginatorOptions struct { + // The maximum number of query logging associations that you want to return in the + // response to a ListResolverQueryLogConfigAssociations request. If you don't + // specify a value for MaxResults, Resolver returns up to 100 query logging + // associations. + 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 +} + +// ListResolverQueryLogConfigAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverQueryLogConfigAssociations +type ListResolverQueryLogConfigAssociationsPaginator struct { + options ListResolverQueryLogConfigAssociationsPaginatorOptions + client ListResolverQueryLogConfigAssociationsAPIClient + params *ListResolverQueryLogConfigAssociationsInput + nextToken *string + firstPage bool +} + +// NewListResolverQueryLogConfigAssociationsPaginator returns a new +// ListResolverQueryLogConfigAssociationsPaginator +func NewListResolverQueryLogConfigAssociationsPaginator(client ListResolverQueryLogConfigAssociationsAPIClient, params *ListResolverQueryLogConfigAssociationsInput, optFns ...func(*ListResolverQueryLogConfigAssociationsPaginatorOptions)) *ListResolverQueryLogConfigAssociationsPaginator { + options := ListResolverQueryLogConfigAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverQueryLogConfigAssociationsInput{} + } + + return &ListResolverQueryLogConfigAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverQueryLogConfigAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverQueryLogConfigAssociations page. +func (p *ListResolverQueryLogConfigAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverQueryLogConfigAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverQueryLogConfigAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverQueryLogConfigAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverQueryLogConfigs.go b/service/route53resolver/api_op_ListResolverQueryLogConfigs.go index b423bd3b9bf..1dc0ab7560c 100644 --- a/service/route53resolver/api_op_ListResolverQueryLogConfigs.go +++ b/service/route53resolver/api_op_ListResolverQueryLogConfigs.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -200,6 +201,91 @@ func addOperationListResolverQueryLogConfigsMiddlewares(stack *middleware.Stack, return nil } +// ListResolverQueryLogConfigsAPIClient is a client that implements the +// ListResolverQueryLogConfigs operation. +type ListResolverQueryLogConfigsAPIClient interface { + ListResolverQueryLogConfigs(context.Context, *ListResolverQueryLogConfigsInput, ...func(*Options)) (*ListResolverQueryLogConfigsOutput, error) +} + +var _ ListResolverQueryLogConfigsAPIClient = (*Client)(nil) + +// ListResolverQueryLogConfigsPaginatorOptions is the paginator options for +// ListResolverQueryLogConfigs +type ListResolverQueryLogConfigsPaginatorOptions struct { + // The maximum number of query logging configurations that you want to return in + // the response to a ListResolverQueryLogConfigs request. If you don't specify a + // value for MaxResults, Resolver returns up to 100 query logging configurations. + 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 +} + +// ListResolverQueryLogConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverQueryLogConfigs +type ListResolverQueryLogConfigsPaginator struct { + options ListResolverQueryLogConfigsPaginatorOptions + client ListResolverQueryLogConfigsAPIClient + params *ListResolverQueryLogConfigsInput + nextToken *string + firstPage bool +} + +// NewListResolverQueryLogConfigsPaginator returns a new +// ListResolverQueryLogConfigsPaginator +func NewListResolverQueryLogConfigsPaginator(client ListResolverQueryLogConfigsAPIClient, params *ListResolverQueryLogConfigsInput, optFns ...func(*ListResolverQueryLogConfigsPaginatorOptions)) *ListResolverQueryLogConfigsPaginator { + options := ListResolverQueryLogConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverQueryLogConfigsInput{} + } + + return &ListResolverQueryLogConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverQueryLogConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverQueryLogConfigs page. +func (p *ListResolverQueryLogConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverQueryLogConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverQueryLogConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverQueryLogConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverRuleAssociations.go b/service/route53resolver/api_op_ListResolverRuleAssociations.go index 0ade2e0f003..6d49b09642e 100644 --- a/service/route53resolver/api_op_ListResolverRuleAssociations.go +++ b/service/route53resolver/api_op_ListResolverRuleAssociations.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -125,6 +126,91 @@ func addOperationListResolverRuleAssociationsMiddlewares(stack *middleware.Stack return nil } +// ListResolverRuleAssociationsAPIClient is a client that implements the +// ListResolverRuleAssociations operation. +type ListResolverRuleAssociationsAPIClient interface { + ListResolverRuleAssociations(context.Context, *ListResolverRuleAssociationsInput, ...func(*Options)) (*ListResolverRuleAssociationsOutput, error) +} + +var _ ListResolverRuleAssociationsAPIClient = (*Client)(nil) + +// ListResolverRuleAssociationsPaginatorOptions is the paginator options for +// ListResolverRuleAssociations +type ListResolverRuleAssociationsPaginatorOptions struct { + // The maximum number of rule associations that you want to return in the response + // to a ListResolverRuleAssociations request. If you don't specify a value for + // MaxResults, Resolver returns up to 100 rule associations. + 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 +} + +// ListResolverRuleAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverRuleAssociations +type ListResolverRuleAssociationsPaginator struct { + options ListResolverRuleAssociationsPaginatorOptions + client ListResolverRuleAssociationsAPIClient + params *ListResolverRuleAssociationsInput + nextToken *string + firstPage bool +} + +// NewListResolverRuleAssociationsPaginator returns a new +// ListResolverRuleAssociationsPaginator +func NewListResolverRuleAssociationsPaginator(client ListResolverRuleAssociationsAPIClient, params *ListResolverRuleAssociationsInput, optFns ...func(*ListResolverRuleAssociationsPaginatorOptions)) *ListResolverRuleAssociationsPaginator { + options := ListResolverRuleAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverRuleAssociationsInput{} + } + + return &ListResolverRuleAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverRuleAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverRuleAssociations page. +func (p *ListResolverRuleAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverRuleAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverRuleAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverRuleAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListResolverRules.go b/service/route53resolver/api_op_ListResolverRules.go index 06a40465c4c..a8c321d8fe1 100644 --- a/service/route53resolver/api_op_ListResolverRules.go +++ b/service/route53resolver/api_op_ListResolverRules.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -123,6 +124,89 @@ func addOperationListResolverRulesMiddlewares(stack *middleware.Stack, options O return nil } +// ListResolverRulesAPIClient is a client that implements the ListResolverRules +// operation. +type ListResolverRulesAPIClient interface { + ListResolverRules(context.Context, *ListResolverRulesInput, ...func(*Options)) (*ListResolverRulesOutput, error) +} + +var _ ListResolverRulesAPIClient = (*Client)(nil) + +// ListResolverRulesPaginatorOptions is the paginator options for ListResolverRules +type ListResolverRulesPaginatorOptions struct { + // The maximum number of Resolver rules that you want to return in the response to + // a ListResolverRules request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 Resolver rules. + 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 +} + +// ListResolverRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListResolverRules +type ListResolverRulesPaginator struct { + options ListResolverRulesPaginatorOptions + client ListResolverRulesAPIClient + params *ListResolverRulesInput + nextToken *string + firstPage bool +} + +// NewListResolverRulesPaginator returns a new ListResolverRulesPaginator +func NewListResolverRulesPaginator(client ListResolverRulesAPIClient, params *ListResolverRulesInput, optFns ...func(*ListResolverRulesPaginatorOptions)) *ListResolverRulesPaginator { + options := ListResolverRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResolverRulesInput{} + } + + return &ListResolverRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResolverRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResolverRules page. +func (p *ListResolverRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResolverRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResolverRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResolverRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/api_op_ListTagsForResource.go b/service/route53resolver/api_op_ListTagsForResource.go index f8d72cc58ba..4871abcb7d2 100644 --- a/service/route53resolver/api_op_ListTagsForResource.go +++ b/service/route53resolver/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package route53resolver 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/route53resolver/types" @@ -121,6 +122,90 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // The maximum number of tags that you want to return in the response to a + // ListTagsForResource request. If you don't specify a value for MaxResults, + // Resolver returns up to 100 tags. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/route53resolver.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/route53resolver/endpoints.go b/service/route53resolver/endpoints.go index dbab2bd947f..a4e154ec8a8 100644 --- a/service/route53resolver/endpoints.go +++ b/service/route53resolver/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/s3/api_op_ListObjectsV2.go b/service/s3/api_op_ListObjectsV2.go index c21212cad0c..f7deeccc3e5 100644 --- a/service/s3/api_op_ListObjectsV2.go +++ b/service/s3/api_op_ListObjectsV2.go @@ -4,6 +4,7 @@ package s3 import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations" @@ -266,6 +267,88 @@ func addOperationListObjectsV2Middlewares(stack *middleware.Stack, options Optio return nil } +// ListObjectsV2APIClient is a client that implements the ListObjectsV2 operation. +type ListObjectsV2APIClient interface { + ListObjectsV2(context.Context, *ListObjectsV2Input, ...func(*Options)) (*ListObjectsV2Output, error) +} + +var _ ListObjectsV2APIClient = (*Client)(nil) + +// ListObjectsV2PaginatorOptions is the paginator options for ListObjectsV2 +type ListObjectsV2PaginatorOptions struct { + // Sets the maximum number of keys returned in the response. By default the API + // returns up to 1,000 key names. The response might contain fewer keys but will + // never contain more. + 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 +} + +// ListObjectsV2Paginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3.ListObjectsV2 +type ListObjectsV2Paginator struct { + options ListObjectsV2PaginatorOptions + client ListObjectsV2APIClient + params *ListObjectsV2Input + nextToken *string + firstPage bool +} + +// NewListObjectsV2Paginator returns a new ListObjectsV2Paginator +func NewListObjectsV2Paginator(client ListObjectsV2APIClient, params *ListObjectsV2Input, optFns ...func(*ListObjectsV2PaginatorOptions)) *ListObjectsV2Paginator { + options := ListObjectsV2PaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListObjectsV2Input{} + } + + return &ListObjectsV2Paginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListObjectsV2Paginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListObjectsV2 page. +func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListObjectsV2Output, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.ContinuationToken = p.nextToken + if p.options.Limit > 0 { + params.MaxKeys = p.options.Limit + } + + result, err := p.client.ListObjectsV2(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextContinuationToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListObjectsV2(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3control/api_op_ListAccessPoints.go b/service/s3control/api_op_ListAccessPoints.go index b7bdc4b4871..60f7aa26a50 100644 --- a/service/s3control/api_op_ListAccessPoints.go +++ b/service/s3control/api_op_ListAccessPoints.go @@ -207,6 +207,90 @@ func addEndpointPrefix_opListAccessPointsMiddleware(stack *middleware.Stack) err return stack.Serialize.Insert(&endpointPrefix_opListAccessPointsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListAccessPointsAPIClient is a client that implements the ListAccessPoints +// operation. +type ListAccessPointsAPIClient interface { + ListAccessPoints(context.Context, *ListAccessPointsInput, ...func(*Options)) (*ListAccessPointsOutput, error) +} + +var _ ListAccessPointsAPIClient = (*Client)(nil) + +// ListAccessPointsPaginatorOptions is the paginator options for ListAccessPoints +type ListAccessPointsPaginatorOptions struct { + // The maximum number of access points that you want to include in the list. If the + // specified bucket has more than this number of access points, then the response + // will include a continuation token in the NextToken field that you can use to + // retrieve the next page of access points. + 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 +} + +// ListAccessPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListAccessPoints +type ListAccessPointsPaginator struct { + options ListAccessPointsPaginatorOptions + client ListAccessPointsAPIClient + params *ListAccessPointsInput + nextToken *string + firstPage bool +} + +// NewListAccessPointsPaginator returns a new ListAccessPointsPaginator +func NewListAccessPointsPaginator(client ListAccessPointsAPIClient, params *ListAccessPointsInput, optFns ...func(*ListAccessPointsPaginatorOptions)) *ListAccessPointsPaginator { + options := ListAccessPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccessPointsInput{} + } + + return &ListAccessPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccessPointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccessPoints page. +func (p *ListAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAccessPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccessPoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3control/api_op_ListJobs.go b/service/s3control/api_op_ListJobs.go index 05b616d29af..162bfc9837c 100644 --- a/service/s3control/api_op_ListJobs.go +++ b/service/s3control/api_op_ListJobs.go @@ -198,6 +198,89 @@ func addEndpointPrefix_opListJobsMiddleware(stack *middleware.Stack) error { return stack.Serialize.Insert(&endpointPrefix_opListJobsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions struct { + // The maximum number of jobs that Amazon S3 will include in the List Jobs + // response. If there are more jobs than this number, the response will include a + // pagination token in the NextToken field to enable you to retrieve the next page + // of results. + 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3control/api_op_ListRegionalBuckets.go b/service/s3control/api_op_ListRegionalBuckets.go index 677100542e8..7cb6525b362 100644 --- a/service/s3control/api_op_ListRegionalBuckets.go +++ b/service/s3control/api_op_ListRegionalBuckets.go @@ -179,6 +179,88 @@ func addEndpointPrefix_opListRegionalBucketsMiddleware(stack *middleware.Stack) return stack.Serialize.Insert(&endpointPrefix_opListRegionalBucketsMiddleware{}, `OperationSerializer`, middleware.After) } +// ListRegionalBucketsAPIClient is a client that implements the ListRegionalBuckets +// operation. +type ListRegionalBucketsAPIClient interface { + ListRegionalBuckets(context.Context, *ListRegionalBucketsInput, ...func(*Options)) (*ListRegionalBucketsOutput, error) +} + +var _ ListRegionalBucketsAPIClient = (*Client)(nil) + +// ListRegionalBucketsPaginatorOptions is the paginator options for +// ListRegionalBuckets +type ListRegionalBucketsPaginatorOptions struct { + // + 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 +} + +// ListRegionalBucketsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3control.ListRegionalBuckets +type ListRegionalBucketsPaginator struct { + options ListRegionalBucketsPaginatorOptions + client ListRegionalBucketsAPIClient + params *ListRegionalBucketsInput + nextToken *string + firstPage bool +} + +// NewListRegionalBucketsPaginator returns a new ListRegionalBucketsPaginator +func NewListRegionalBucketsPaginator(client ListRegionalBucketsAPIClient, params *ListRegionalBucketsInput, optFns ...func(*ListRegionalBucketsPaginatorOptions)) *ListRegionalBucketsPaginator { + options := ListRegionalBucketsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRegionalBucketsInput{} + } + + return &ListRegionalBucketsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRegionalBucketsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRegionalBuckets page. +func (p *ListRegionalBucketsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegionalBucketsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListRegionalBuckets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRegionalBuckets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3control/go.sum b/service/s3control/go.sum index d62e77529fa..ae15bbd55b5 100644 --- a/service/s3control/go.sum +++ b/service/s3control/go.sum @@ -1,12 +1,3 @@ -github.com/aws/aws-sdk-go-v2 v0.28.1-0.20201027160747-2592e9547fe4/go.mod h1:P9h1Cf+uOpElAT533QXKOzrpFaOlm8JMorThJNUfQ6Q= -github.com/aws/aws-sdk-go-v2 v0.29.0 h1:V/KKvuMO2hwHRg2SXJc5aasBHhD1AWbS6KMWg/Ueq1w= -github.com/aws/aws-sdk-go-v2 v0.29.0/go.mod h1:4d1/Ee0vCwCF7BfG1hCT3zu82493cRy5+VZ8JHvMPf0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1-0.20201027184009-8eb8fc303e7c h1:Cm++f8Gc+n+R7LRF2/uYSxSRw+dIS3lepE7qCHsZzYE= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1-0.20201027184009-8eb8fc303e7c/go.mod h1:/45/g9thJEPyLQ5x6wj5tlXz+i6uLWLlJkHABYdYFH0= -github.com/aws/aws-sdk-go-v2/service/internal/s3shared v0.3.1 h1:5dV7pN0xCrnecvbn7+qkK1XbsYwSqbDoSCzVeaW2LJE= -github.com/awslabs/smithy-go v0.2.1/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= -github.com/awslabs/smithy-go v0.2.2-0.20201026231331-345290040c23/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= -github.com/awslabs/smithy-go v0.3.0/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/awslabs/smithy-go v0.3.1-0.20201104233911-38864709e183/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4 h1:Aj5dOF+lDoEhU92no7YZF0IokuWGjiNrcm/DGIG3iII= github.com/awslabs/smithy-go v0.3.1-0.20201108010311-62c2a93810b4/go.mod h1:hPOQwnmBLHsUphH13tVSjQhTAFma0/0XoZGbBcOuABI= @@ -19,6 +10,5 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/s3outposts/api_op_ListEndpoints.go b/service/s3outposts/api_op_ListEndpoints.go index ffc90a18ee6..73f98a5880c 100644 --- a/service/s3outposts/api_op_ListEndpoints.go +++ b/service/s3outposts/api_op_ListEndpoints.go @@ -4,6 +4,7 @@ package s3outposts 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/s3outposts/types" @@ -116,6 +117,86 @@ func addOperationListEndpointsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListEndpointsAPIClient is a client that implements the ListEndpoints operation. +type ListEndpointsAPIClient interface { + ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error) +} + +var _ ListEndpointsAPIClient = (*Client)(nil) + +// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints +type ListEndpointsPaginatorOptions struct { + // The max number of endpoints that can be returned on the request. + 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 +} + +// ListEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/s3outposts.ListEndpoints +type ListEndpointsPaginator struct { + options ListEndpointsPaginatorOptions + client ListEndpointsAPIClient + params *ListEndpointsInput + nextToken *string + firstPage bool +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsInput{} + } + + return &ListEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEndpoints page. +func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/s3outposts/endpoints.go b/service/s3outposts/endpoints.go index b14c4e4a02b..ac77080a3cd 100644 --- a/service/s3outposts/endpoints.go +++ b/service/s3outposts/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sagemaker/api_op_ListAlgorithms.go b/service/sagemaker/api_op_ListAlgorithms.go index c450c47fe82..2c4374b3337 100644 --- a/service/sagemaker/api_op_ListAlgorithms.go +++ b/service/sagemaker/api_op_ListAlgorithms.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -129,6 +130,87 @@ func addOperationListAlgorithmsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListAlgorithmsAPIClient is a client that implements the ListAlgorithms +// operation. +type ListAlgorithmsAPIClient interface { + ListAlgorithms(context.Context, *ListAlgorithmsInput, ...func(*Options)) (*ListAlgorithmsOutput, error) +} + +var _ ListAlgorithmsAPIClient = (*Client)(nil) + +// ListAlgorithmsPaginatorOptions is the paginator options for ListAlgorithms +type ListAlgorithmsPaginatorOptions struct { + // The maximum number of algorithms to return in the response. + 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 +} + +// ListAlgorithmsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListAlgorithms +type ListAlgorithmsPaginator struct { + options ListAlgorithmsPaginatorOptions + client ListAlgorithmsAPIClient + params *ListAlgorithmsInput + nextToken *string + firstPage bool +} + +// NewListAlgorithmsPaginator returns a new ListAlgorithmsPaginator +func NewListAlgorithmsPaginator(client ListAlgorithmsAPIClient, params *ListAlgorithmsInput, optFns ...func(*ListAlgorithmsPaginatorOptions)) *ListAlgorithmsPaginator { + options := ListAlgorithmsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAlgorithmsInput{} + } + + return &ListAlgorithmsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAlgorithmsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAlgorithms page. +func (p *ListAlgorithmsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAlgorithmsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAlgorithms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAlgorithms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListApps.go b/service/sagemaker/api_op_ListApps.go index b62b756bc55..ee446397925 100644 --- a/service/sagemaker/api_op_ListApps.go +++ b/service/sagemaker/api_op_ListApps.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -119,6 +120,86 @@ func addOperationListAppsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListAppsAPIClient is a client that implements the ListApps operation. +type ListAppsAPIClient interface { + ListApps(context.Context, *ListAppsInput, ...func(*Options)) (*ListAppsOutput, error) +} + +var _ ListAppsAPIClient = (*Client)(nil) + +// ListAppsPaginatorOptions is the paginator options for ListApps +type ListAppsPaginatorOptions struct { + // Returns a list up to a specified limit. + 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 +} + +// ListAppsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListApps +type ListAppsPaginator struct { + options ListAppsPaginatorOptions + client ListAppsAPIClient + params *ListAppsInput + nextToken *string + firstPage bool +} + +// NewListAppsPaginator returns a new ListAppsPaginator +func NewListAppsPaginator(client ListAppsAPIClient, params *ListAppsInput, optFns ...func(*ListAppsPaginatorOptions)) *ListAppsPaginator { + options := ListAppsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAppsInput{} + } + + return &ListAppsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAppsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApps page. +func (p *ListAppsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAppsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListApps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListAutoMLJobs.go b/service/sagemaker/api_op_ListAutoMLJobs.go index 8baa35e2539..1a4a0cdcec2 100644 --- a/service/sagemaker/api_op_ListAutoMLJobs.go +++ b/service/sagemaker/api_op_ListAutoMLJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -134,6 +135,87 @@ func addOperationListAutoMLJobsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListAutoMLJobsAPIClient is a client that implements the ListAutoMLJobs +// operation. +type ListAutoMLJobsAPIClient interface { + ListAutoMLJobs(context.Context, *ListAutoMLJobsInput, ...func(*Options)) (*ListAutoMLJobsOutput, error) +} + +var _ ListAutoMLJobsAPIClient = (*Client)(nil) + +// ListAutoMLJobsPaginatorOptions is the paginator options for ListAutoMLJobs +type ListAutoMLJobsPaginatorOptions struct { + // Request a list of jobs up to a specified limit. + 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 +} + +// ListAutoMLJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListAutoMLJobs +type ListAutoMLJobsPaginator struct { + options ListAutoMLJobsPaginatorOptions + client ListAutoMLJobsAPIClient + params *ListAutoMLJobsInput + nextToken *string + firstPage bool +} + +// NewListAutoMLJobsPaginator returns a new ListAutoMLJobsPaginator +func NewListAutoMLJobsPaginator(client ListAutoMLJobsAPIClient, params *ListAutoMLJobsInput, optFns ...func(*ListAutoMLJobsPaginatorOptions)) *ListAutoMLJobsPaginator { + options := ListAutoMLJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAutoMLJobsInput{} + } + + return &ListAutoMLJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAutoMLJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAutoMLJobs page. +func (p *ListAutoMLJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAutoMLJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAutoMLJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAutoMLJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go b/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go index 5237b618a34..5a6b0fff6e7 100644 --- a/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go +++ b/service/sagemaker/api_op_ListCandidatesForAutoMLJob.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -129,6 +130,89 @@ func addOperationListCandidatesForAutoMLJobMiddlewares(stack *middleware.Stack, return nil } +// ListCandidatesForAutoMLJobAPIClient is a client that implements the +// ListCandidatesForAutoMLJob operation. +type ListCandidatesForAutoMLJobAPIClient interface { + ListCandidatesForAutoMLJob(context.Context, *ListCandidatesForAutoMLJobInput, ...func(*Options)) (*ListCandidatesForAutoMLJobOutput, error) +} + +var _ ListCandidatesForAutoMLJobAPIClient = (*Client)(nil) + +// ListCandidatesForAutoMLJobPaginatorOptions is the paginator options for +// ListCandidatesForAutoMLJob +type ListCandidatesForAutoMLJobPaginatorOptions struct { + // List the job's Candidates up to a specified limit. + 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 +} + +// ListCandidatesForAutoMLJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCandidatesForAutoMLJob +type ListCandidatesForAutoMLJobPaginator struct { + options ListCandidatesForAutoMLJobPaginatorOptions + client ListCandidatesForAutoMLJobAPIClient + params *ListCandidatesForAutoMLJobInput + nextToken *string + firstPage bool +} + +// NewListCandidatesForAutoMLJobPaginator returns a new +// ListCandidatesForAutoMLJobPaginator +func NewListCandidatesForAutoMLJobPaginator(client ListCandidatesForAutoMLJobAPIClient, params *ListCandidatesForAutoMLJobInput, optFns ...func(*ListCandidatesForAutoMLJobPaginatorOptions)) *ListCandidatesForAutoMLJobPaginator { + options := ListCandidatesForAutoMLJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCandidatesForAutoMLJobInput{} + } + + return &ListCandidatesForAutoMLJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCandidatesForAutoMLJobPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCandidatesForAutoMLJob page. +func (p *ListCandidatesForAutoMLJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCandidatesForAutoMLJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListCandidatesForAutoMLJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCandidatesForAutoMLJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCodeRepositories.go b/service/sagemaker/api_op_ListCodeRepositories.go index fe692d00449..a40170b9219 100644 --- a/service/sagemaker/api_op_ListCodeRepositories.go +++ b/service/sagemaker/api_op_ListCodeRepositories.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -152,6 +153,88 @@ func addOperationListCodeRepositoriesMiddlewares(stack *middleware.Stack, option return nil } +// ListCodeRepositoriesAPIClient is a client that implements the +// ListCodeRepositories operation. +type ListCodeRepositoriesAPIClient interface { + ListCodeRepositories(context.Context, *ListCodeRepositoriesInput, ...func(*Options)) (*ListCodeRepositoriesOutput, error) +} + +var _ ListCodeRepositoriesAPIClient = (*Client)(nil) + +// ListCodeRepositoriesPaginatorOptions is the paginator options for +// ListCodeRepositories +type ListCodeRepositoriesPaginatorOptions struct { + // The maximum number of Git repositories to return in the response. + 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 +} + +// ListCodeRepositoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCodeRepositories +type ListCodeRepositoriesPaginator struct { + options ListCodeRepositoriesPaginatorOptions + client ListCodeRepositoriesAPIClient + params *ListCodeRepositoriesInput + nextToken *string + firstPage bool +} + +// NewListCodeRepositoriesPaginator returns a new ListCodeRepositoriesPaginator +func NewListCodeRepositoriesPaginator(client ListCodeRepositoriesAPIClient, params *ListCodeRepositoriesInput, optFns ...func(*ListCodeRepositoriesPaginatorOptions)) *ListCodeRepositoriesPaginator { + options := ListCodeRepositoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCodeRepositoriesInput{} + } + + return &ListCodeRepositoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCodeRepositoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCodeRepositories page. +func (p *ListCodeRepositoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCodeRepositoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCodeRepositories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCodeRepositories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListCompilationJobs.go b/service/sagemaker/api_op_ListCompilationJobs.go index ab0896e8176..13bfbad0112 100644 --- a/service/sagemaker/api_op_ListCompilationJobs.go +++ b/service/sagemaker/api_op_ListCompilationJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -145,6 +146,88 @@ func addOperationListCompilationJobsMiddlewares(stack *middleware.Stack, options return nil } +// ListCompilationJobsAPIClient is a client that implements the ListCompilationJobs +// operation. +type ListCompilationJobsAPIClient interface { + ListCompilationJobs(context.Context, *ListCompilationJobsInput, ...func(*Options)) (*ListCompilationJobsOutput, error) +} + +var _ ListCompilationJobsAPIClient = (*Client)(nil) + +// ListCompilationJobsPaginatorOptions is the paginator options for +// ListCompilationJobs +type ListCompilationJobsPaginatorOptions struct { + // The maximum number of model compilation jobs to return in the response. + 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 +} + +// ListCompilationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListCompilationJobs +type ListCompilationJobsPaginator struct { + options ListCompilationJobsPaginatorOptions + client ListCompilationJobsAPIClient + params *ListCompilationJobsInput + nextToken *string + firstPage bool +} + +// NewListCompilationJobsPaginator returns a new ListCompilationJobsPaginator +func NewListCompilationJobsPaginator(client ListCompilationJobsAPIClient, params *ListCompilationJobsInput, optFns ...func(*ListCompilationJobsPaginatorOptions)) *ListCompilationJobsPaginator { + options := ListCompilationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCompilationJobsInput{} + } + + return &ListCompilationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCompilationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCompilationJobs page. +func (p *ListCompilationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCompilationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCompilationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCompilationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListDomains.go b/service/sagemaker/api_op_ListDomains.go index 04160053ba6..db8d32d15f0 100644 --- a/service/sagemaker/api_op_ListDomains.go +++ b/service/sagemaker/api_op_ListDomains.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -107,6 +108,86 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // Returns a list up to a specified limit. + 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 +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListEndpointConfigs.go b/service/sagemaker/api_op_ListEndpointConfigs.go index 613648e49cb..00cbf6c3d9e 100644 --- a/service/sagemaker/api_op_ListEndpointConfigs.go +++ b/service/sagemaker/api_op_ListEndpointConfigs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -129,6 +130,88 @@ func addOperationListEndpointConfigsMiddlewares(stack *middleware.Stack, options return nil } +// ListEndpointConfigsAPIClient is a client that implements the ListEndpointConfigs +// operation. +type ListEndpointConfigsAPIClient interface { + ListEndpointConfigs(context.Context, *ListEndpointConfigsInput, ...func(*Options)) (*ListEndpointConfigsOutput, error) +} + +var _ ListEndpointConfigsAPIClient = (*Client)(nil) + +// ListEndpointConfigsPaginatorOptions is the paginator options for +// ListEndpointConfigs +type ListEndpointConfigsPaginatorOptions struct { + // The maximum number of training jobs to return in the response. + 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 +} + +// ListEndpointConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListEndpointConfigs +type ListEndpointConfigsPaginator struct { + options ListEndpointConfigsPaginatorOptions + client ListEndpointConfigsAPIClient + params *ListEndpointConfigsInput + nextToken *string + firstPage bool +} + +// NewListEndpointConfigsPaginator returns a new ListEndpointConfigsPaginator +func NewListEndpointConfigsPaginator(client ListEndpointConfigsAPIClient, params *ListEndpointConfigsInput, optFns ...func(*ListEndpointConfigsPaginatorOptions)) *ListEndpointConfigsPaginator { + options := ListEndpointConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointConfigsInput{} + } + + return &ListEndpointConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEndpointConfigs page. +func (p *ListEndpointConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEndpointConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpointConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListEndpoints.go b/service/sagemaker/api_op_ListEndpoints.go index 9d99985bca4..7d391c346b2 100644 --- a/service/sagemaker/api_op_ListEndpoints.go +++ b/service/sagemaker/api_op_ListEndpoints.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -140,6 +141,86 @@ func addOperationListEndpointsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListEndpointsAPIClient is a client that implements the ListEndpoints operation. +type ListEndpointsAPIClient interface { + ListEndpoints(context.Context, *ListEndpointsInput, ...func(*Options)) (*ListEndpointsOutput, error) +} + +var _ ListEndpointsAPIClient = (*Client)(nil) + +// ListEndpointsPaginatorOptions is the paginator options for ListEndpoints +type ListEndpointsPaginatorOptions struct { + // The maximum number of endpoints to return in the response. + 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 +} + +// ListEndpointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListEndpoints +type ListEndpointsPaginator struct { + options ListEndpointsPaginatorOptions + client ListEndpointsAPIClient + params *ListEndpointsInput + nextToken *string + firstPage bool +} + +// NewListEndpointsPaginator returns a new ListEndpointsPaginator +func NewListEndpointsPaginator(client ListEndpointsAPIClient, params *ListEndpointsInput, optFns ...func(*ListEndpointsPaginatorOptions)) *ListEndpointsPaginator { + options := ListEndpointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsInput{} + } + + return &ListEndpointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEndpoints page. +func (p *ListEndpointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListEndpoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListExperiments.go b/service/sagemaker/api_op_ListExperiments.go index 8f9a57d6742..0c4bbd663e5 100644 --- a/service/sagemaker/api_op_ListExperiments.go +++ b/service/sagemaker/api_op_ListExperiments.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -122,6 +123,88 @@ func addOperationListExperimentsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListExperimentsAPIClient is a client that implements the ListExperiments +// operation. +type ListExperimentsAPIClient interface { + ListExperiments(context.Context, *ListExperimentsInput, ...func(*Options)) (*ListExperimentsOutput, error) +} + +var _ ListExperimentsAPIClient = (*Client)(nil) + +// ListExperimentsPaginatorOptions is the paginator options for ListExperiments +type ListExperimentsPaginatorOptions struct { + // The maximum number of experiments to return in the response. The default value + // is 10. + 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 +} + +// ListExperimentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListExperiments +type ListExperimentsPaginator struct { + options ListExperimentsPaginatorOptions + client ListExperimentsAPIClient + params *ListExperimentsInput + nextToken *string + firstPage bool +} + +// NewListExperimentsPaginator returns a new ListExperimentsPaginator +func NewListExperimentsPaginator(client ListExperimentsAPIClient, params *ListExperimentsInput, optFns ...func(*ListExperimentsPaginatorOptions)) *ListExperimentsPaginator { + options := ListExperimentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExperimentsInput{} + } + + return &ListExperimentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExperimentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListExperiments page. +func (p *ListExperimentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExperimentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListExperiments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExperiments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListFlowDefinitions.go b/service/sagemaker/api_op_ListFlowDefinitions.go index caed1c01e18..513aa15f7cc 100644 --- a/service/sagemaker/api_op_ListFlowDefinitions.go +++ b/service/sagemaker/api_op_ListFlowDefinitions.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -122,6 +123,90 @@ func addOperationListFlowDefinitionsMiddlewares(stack *middleware.Stack, options return nil } +// ListFlowDefinitionsAPIClient is a client that implements the ListFlowDefinitions +// operation. +type ListFlowDefinitionsAPIClient interface { + ListFlowDefinitions(context.Context, *ListFlowDefinitionsInput, ...func(*Options)) (*ListFlowDefinitionsOutput, error) +} + +var _ ListFlowDefinitionsAPIClient = (*Client)(nil) + +// ListFlowDefinitionsPaginatorOptions is the paginator options for +// ListFlowDefinitions +type ListFlowDefinitionsPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken will be provided + // in the output that you can use to resume pagination. + 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 +} + +// ListFlowDefinitionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListFlowDefinitions +type ListFlowDefinitionsPaginator struct { + options ListFlowDefinitionsPaginatorOptions + client ListFlowDefinitionsAPIClient + params *ListFlowDefinitionsInput + nextToken *string + firstPage bool +} + +// NewListFlowDefinitionsPaginator returns a new ListFlowDefinitionsPaginator +func NewListFlowDefinitionsPaginator(client ListFlowDefinitionsAPIClient, params *ListFlowDefinitionsInput, optFns ...func(*ListFlowDefinitionsPaginatorOptions)) *ListFlowDefinitionsPaginator { + options := ListFlowDefinitionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFlowDefinitionsInput{} + } + + return &ListFlowDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFlowDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFlowDefinitions page. +func (p *ListFlowDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFlowDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFlowDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFlowDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListHumanTaskUis.go b/service/sagemaker/api_op_ListHumanTaskUis.go index 598462a637e..088413e00c8 100644 --- a/service/sagemaker/api_op_ListHumanTaskUis.go +++ b/service/sagemaker/api_op_ListHumanTaskUis.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -122,6 +123,89 @@ func addOperationListHumanTaskUisMiddlewares(stack *middleware.Stack, options Op return nil } +// ListHumanTaskUisAPIClient is a client that implements the ListHumanTaskUis +// operation. +type ListHumanTaskUisAPIClient interface { + ListHumanTaskUis(context.Context, *ListHumanTaskUisInput, ...func(*Options)) (*ListHumanTaskUisOutput, error) +} + +var _ ListHumanTaskUisAPIClient = (*Client)(nil) + +// ListHumanTaskUisPaginatorOptions is the paginator options for ListHumanTaskUis +type ListHumanTaskUisPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken will be provided + // in the output that you can use to resume pagination. + 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 +} + +// ListHumanTaskUisPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListHumanTaskUis +type ListHumanTaskUisPaginator struct { + options ListHumanTaskUisPaginatorOptions + client ListHumanTaskUisAPIClient + params *ListHumanTaskUisInput + nextToken *string + firstPage bool +} + +// NewListHumanTaskUisPaginator returns a new ListHumanTaskUisPaginator +func NewListHumanTaskUisPaginator(client ListHumanTaskUisAPIClient, params *ListHumanTaskUisInput, optFns ...func(*ListHumanTaskUisPaginatorOptions)) *ListHumanTaskUisPaginator { + options := ListHumanTaskUisPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHumanTaskUisInput{} + } + + return &ListHumanTaskUisPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHumanTaskUisPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHumanTaskUis page. +func (p *ListHumanTaskUisPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHumanTaskUisOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHumanTaskUis(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHumanTaskUis(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListHyperParameterTuningJobs.go b/service/sagemaker/api_op_ListHyperParameterTuningJobs.go index af09562d6ca..32629e9f038 100644 --- a/service/sagemaker/api_op_ListHyperParameterTuningJobs.go +++ b/service/sagemaker/api_op_ListHyperParameterTuningJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -143,6 +144,89 @@ func addOperationListHyperParameterTuningJobsMiddlewares(stack *middleware.Stack return nil } +// ListHyperParameterTuningJobsAPIClient is a client that implements the +// ListHyperParameterTuningJobs operation. +type ListHyperParameterTuningJobsAPIClient interface { + ListHyperParameterTuningJobs(context.Context, *ListHyperParameterTuningJobsInput, ...func(*Options)) (*ListHyperParameterTuningJobsOutput, error) +} + +var _ ListHyperParameterTuningJobsAPIClient = (*Client)(nil) + +// ListHyperParameterTuningJobsPaginatorOptions is the paginator options for +// ListHyperParameterTuningJobs +type ListHyperParameterTuningJobsPaginatorOptions struct { + // The maximum number of tuning jobs to return. The default value is 10. + 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 +} + +// ListHyperParameterTuningJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListHyperParameterTuningJobs +type ListHyperParameterTuningJobsPaginator struct { + options ListHyperParameterTuningJobsPaginatorOptions + client ListHyperParameterTuningJobsAPIClient + params *ListHyperParameterTuningJobsInput + nextToken *string + firstPage bool +} + +// NewListHyperParameterTuningJobsPaginator returns a new +// ListHyperParameterTuningJobsPaginator +func NewListHyperParameterTuningJobsPaginator(client ListHyperParameterTuningJobsAPIClient, params *ListHyperParameterTuningJobsInput, optFns ...func(*ListHyperParameterTuningJobsPaginatorOptions)) *ListHyperParameterTuningJobsPaginator { + options := ListHyperParameterTuningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHyperParameterTuningJobsInput{} + } + + return &ListHyperParameterTuningJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHyperParameterTuningJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHyperParameterTuningJobs page. +func (p *ListHyperParameterTuningJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHyperParameterTuningJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListHyperParameterTuningJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHyperParameterTuningJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListImageVersions.go b/service/sagemaker/api_op_ListImageVersions.go index 4c81b2977b9..2009ac60d76 100644 --- a/service/sagemaker/api_op_ListImageVersions.go +++ b/service/sagemaker/api_op_ListImageVersions.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -135,6 +136,88 @@ func addOperationListImageVersionsMiddlewares(stack *middleware.Stack, options O return nil } +// ListImageVersionsAPIClient is a client that implements the ListImageVersions +// operation. +type ListImageVersionsAPIClient interface { + ListImageVersions(context.Context, *ListImageVersionsInput, ...func(*Options)) (*ListImageVersionsOutput, error) +} + +var _ ListImageVersionsAPIClient = (*Client)(nil) + +// ListImageVersionsPaginatorOptions is the paginator options for ListImageVersions +type ListImageVersionsPaginatorOptions struct { + // The maximum number of versions to return in the response. The default value is + // 10. + 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 +} + +// ListImageVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListImageVersions +type ListImageVersionsPaginator struct { + options ListImageVersionsPaginatorOptions + client ListImageVersionsAPIClient + params *ListImageVersionsInput + nextToken *string + firstPage bool +} + +// NewListImageVersionsPaginator returns a new ListImageVersionsPaginator +func NewListImageVersionsPaginator(client ListImageVersionsAPIClient, params *ListImageVersionsInput, optFns ...func(*ListImageVersionsPaginatorOptions)) *ListImageVersionsPaginator { + options := ListImageVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImageVersionsInput{} + } + + return &ListImageVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImageVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImageVersions page. +func (p *ListImageVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImageVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListImageVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImageVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListImages.go b/service/sagemaker/api_op_ListImages.go index 981f09874fa..70b271900f6 100644 --- a/service/sagemaker/api_op_ListImages.go +++ b/service/sagemaker/api_op_ListImages.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -130,6 +131,86 @@ func addOperationListImagesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListImagesAPIClient is a client that implements the ListImages operation. +type ListImagesAPIClient interface { + ListImages(context.Context, *ListImagesInput, ...func(*Options)) (*ListImagesOutput, error) +} + +var _ ListImagesAPIClient = (*Client)(nil) + +// ListImagesPaginatorOptions is the paginator options for ListImages +type ListImagesPaginatorOptions struct { + // The maximum number of images to return in the response. The default value is 10. + 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 +} + +// ListImagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListImages +type ListImagesPaginator struct { + options ListImagesPaginatorOptions + client ListImagesAPIClient + params *ListImagesInput + nextToken *string + firstPage bool +} + +// NewListImagesPaginator returns a new ListImagesPaginator +func NewListImagesPaginator(client ListImagesAPIClient, params *ListImagesInput, optFns ...func(*ListImagesPaginatorOptions)) *ListImagesPaginator { + options := ListImagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImagesInput{} + } + + return &ListImagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImages page. +func (p *ListImagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListImages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListLabelingJobs.go b/service/sagemaker/api_op_ListLabelingJobs.go index d258e247ed1..3e6fb9ea1f0 100644 --- a/service/sagemaker/api_op_ListLabelingJobs.go +++ b/service/sagemaker/api_op_ListLabelingJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -138,6 +139,87 @@ func addOperationListLabelingJobsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListLabelingJobsAPIClient is a client that implements the ListLabelingJobs +// operation. +type ListLabelingJobsAPIClient interface { + ListLabelingJobs(context.Context, *ListLabelingJobsInput, ...func(*Options)) (*ListLabelingJobsOutput, error) +} + +var _ ListLabelingJobsAPIClient = (*Client)(nil) + +// ListLabelingJobsPaginatorOptions is the paginator options for ListLabelingJobs +type ListLabelingJobsPaginatorOptions struct { + // The maximum number of labeling jobs to return in each page of the response. + 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 +} + +// ListLabelingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListLabelingJobs +type ListLabelingJobsPaginator struct { + options ListLabelingJobsPaginatorOptions + client ListLabelingJobsAPIClient + params *ListLabelingJobsInput + nextToken *string + firstPage bool +} + +// NewListLabelingJobsPaginator returns a new ListLabelingJobsPaginator +func NewListLabelingJobsPaginator(client ListLabelingJobsAPIClient, params *ListLabelingJobsInput, optFns ...func(*ListLabelingJobsPaginatorOptions)) *ListLabelingJobsPaginator { + options := ListLabelingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLabelingJobsInput{} + } + + return &ListLabelingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLabelingJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLabelingJobs page. +func (p *ListLabelingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLabelingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLabelingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLabelingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go b/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go index 96a325e6dd1..4da78d0ecae 100644 --- a/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go +++ b/service/sagemaker/api_op_ListLabelingJobsForWorkteam.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -138,6 +139,89 @@ func addOperationListLabelingJobsForWorkteamMiddlewares(stack *middleware.Stack, return nil } +// ListLabelingJobsForWorkteamAPIClient is a client that implements the +// ListLabelingJobsForWorkteam operation. +type ListLabelingJobsForWorkteamAPIClient interface { + ListLabelingJobsForWorkteam(context.Context, *ListLabelingJobsForWorkteamInput, ...func(*Options)) (*ListLabelingJobsForWorkteamOutput, error) +} + +var _ ListLabelingJobsForWorkteamAPIClient = (*Client)(nil) + +// ListLabelingJobsForWorkteamPaginatorOptions is the paginator options for +// ListLabelingJobsForWorkteam +type ListLabelingJobsForWorkteamPaginatorOptions struct { + // The maximum number of labeling jobs to return in each page of the response. + 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 +} + +// ListLabelingJobsForWorkteamPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListLabelingJobsForWorkteam +type ListLabelingJobsForWorkteamPaginator struct { + options ListLabelingJobsForWorkteamPaginatorOptions + client ListLabelingJobsForWorkteamAPIClient + params *ListLabelingJobsForWorkteamInput + nextToken *string + firstPage bool +} + +// NewListLabelingJobsForWorkteamPaginator returns a new +// ListLabelingJobsForWorkteamPaginator +func NewListLabelingJobsForWorkteamPaginator(client ListLabelingJobsForWorkteamAPIClient, params *ListLabelingJobsForWorkteamInput, optFns ...func(*ListLabelingJobsForWorkteamPaginatorOptions)) *ListLabelingJobsForWorkteamPaginator { + options := ListLabelingJobsForWorkteamPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLabelingJobsForWorkteamInput{} + } + + return &ListLabelingJobsForWorkteamPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLabelingJobsForWorkteamPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLabelingJobsForWorkteam page. +func (p *ListLabelingJobsForWorkteamPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLabelingJobsForWorkteamOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLabelingJobsForWorkteam(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLabelingJobsForWorkteam(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListModelPackages.go b/service/sagemaker/api_op_ListModelPackages.go index 1a7d6ffeb32..0f786268058 100644 --- a/service/sagemaker/api_op_ListModelPackages.go +++ b/service/sagemaker/api_op_ListModelPackages.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -129,6 +130,87 @@ func addOperationListModelPackagesMiddlewares(stack *middleware.Stack, options O return nil } +// ListModelPackagesAPIClient is a client that implements the ListModelPackages +// operation. +type ListModelPackagesAPIClient interface { + ListModelPackages(context.Context, *ListModelPackagesInput, ...func(*Options)) (*ListModelPackagesOutput, error) +} + +var _ ListModelPackagesAPIClient = (*Client)(nil) + +// ListModelPackagesPaginatorOptions is the paginator options for ListModelPackages +type ListModelPackagesPaginatorOptions struct { + // The maximum number of model packages to return in the response. + 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 +} + +// ListModelPackagesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListModelPackages +type ListModelPackagesPaginator struct { + options ListModelPackagesPaginatorOptions + client ListModelPackagesAPIClient + params *ListModelPackagesInput + nextToken *string + firstPage bool +} + +// NewListModelPackagesPaginator returns a new ListModelPackagesPaginator +func NewListModelPackagesPaginator(client ListModelPackagesAPIClient, params *ListModelPackagesInput, optFns ...func(*ListModelPackagesPaginatorOptions)) *ListModelPackagesPaginator { + options := ListModelPackagesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListModelPackagesInput{} + } + + return &ListModelPackagesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListModelPackagesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListModelPackages page. +func (p *ListModelPackagesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelPackagesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListModelPackages(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListModelPackages(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListModels.go b/service/sagemaker/api_op_ListModels.go index 6b59d36d139..0ce43b9a66c 100644 --- a/service/sagemaker/api_op_ListModels.go +++ b/service/sagemaker/api_op_ListModels.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -128,6 +129,86 @@ func addOperationListModelsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListModelsAPIClient is a client that implements the ListModels operation. +type ListModelsAPIClient interface { + ListModels(context.Context, *ListModelsInput, ...func(*Options)) (*ListModelsOutput, error) +} + +var _ ListModelsAPIClient = (*Client)(nil) + +// ListModelsPaginatorOptions is the paginator options for ListModels +type ListModelsPaginatorOptions struct { + // The maximum number of models to return in the response. + 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 +} + +// ListModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListModels +type ListModelsPaginator struct { + options ListModelsPaginatorOptions + client ListModelsAPIClient + params *ListModelsInput + nextToken *string + firstPage bool +} + +// NewListModelsPaginator returns a new ListModelsPaginator +func NewListModelsPaginator(client ListModelsAPIClient, params *ListModelsInput, optFns ...func(*ListModelsPaginatorOptions)) *ListModelsPaginator { + options := ListModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListModelsInput{} + } + + return &ListModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListModels page. +func (p *ListModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListMonitoringExecutions.go b/service/sagemaker/api_op_ListMonitoringExecutions.go index c71bb9a24d2..ed8e18dffdb 100644 --- a/service/sagemaker/api_op_ListMonitoringExecutions.go +++ b/service/sagemaker/api_op_ListMonitoringExecutions.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -145,6 +146,89 @@ func addOperationListMonitoringExecutionsMiddlewares(stack *middleware.Stack, op return nil } +// ListMonitoringExecutionsAPIClient is a client that implements the +// ListMonitoringExecutions operation. +type ListMonitoringExecutionsAPIClient interface { + ListMonitoringExecutions(context.Context, *ListMonitoringExecutionsInput, ...func(*Options)) (*ListMonitoringExecutionsOutput, error) +} + +var _ ListMonitoringExecutionsAPIClient = (*Client)(nil) + +// ListMonitoringExecutionsPaginatorOptions is the paginator options for +// ListMonitoringExecutions +type ListMonitoringExecutionsPaginatorOptions struct { + // The maximum number of jobs to return in the response. The default value is 10. + 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 +} + +// ListMonitoringExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListMonitoringExecutions +type ListMonitoringExecutionsPaginator struct { + options ListMonitoringExecutionsPaginatorOptions + client ListMonitoringExecutionsAPIClient + params *ListMonitoringExecutionsInput + nextToken *string + firstPage bool +} + +// NewListMonitoringExecutionsPaginator returns a new +// ListMonitoringExecutionsPaginator +func NewListMonitoringExecutionsPaginator(client ListMonitoringExecutionsAPIClient, params *ListMonitoringExecutionsInput, optFns ...func(*ListMonitoringExecutionsPaginatorOptions)) *ListMonitoringExecutionsPaginator { + options := ListMonitoringExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMonitoringExecutionsInput{} + } + + return &ListMonitoringExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMonitoringExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMonitoringExecutions page. +func (p *ListMonitoringExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMonitoringExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMonitoringExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMonitoringExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListMonitoringSchedules.go b/service/sagemaker/api_op_ListMonitoringSchedules.go index 21bb3f64ec1..ca554cdaeeb 100644 --- a/service/sagemaker/api_op_ListMonitoringSchedules.go +++ b/service/sagemaker/api_op_ListMonitoringSchedules.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -141,6 +142,89 @@ func addOperationListMonitoringSchedulesMiddlewares(stack *middleware.Stack, opt return nil } +// ListMonitoringSchedulesAPIClient is a client that implements the +// ListMonitoringSchedules operation. +type ListMonitoringSchedulesAPIClient interface { + ListMonitoringSchedules(context.Context, *ListMonitoringSchedulesInput, ...func(*Options)) (*ListMonitoringSchedulesOutput, error) +} + +var _ ListMonitoringSchedulesAPIClient = (*Client)(nil) + +// ListMonitoringSchedulesPaginatorOptions is the paginator options for +// ListMonitoringSchedules +type ListMonitoringSchedulesPaginatorOptions struct { + // The maximum number of jobs to return in the response. The default value is 10. + 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 +} + +// ListMonitoringSchedulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListMonitoringSchedules +type ListMonitoringSchedulesPaginator struct { + options ListMonitoringSchedulesPaginatorOptions + client ListMonitoringSchedulesAPIClient + params *ListMonitoringSchedulesInput + nextToken *string + firstPage bool +} + +// NewListMonitoringSchedulesPaginator returns a new +// ListMonitoringSchedulesPaginator +func NewListMonitoringSchedulesPaginator(client ListMonitoringSchedulesAPIClient, params *ListMonitoringSchedulesInput, optFns ...func(*ListMonitoringSchedulesPaginatorOptions)) *ListMonitoringSchedulesPaginator { + options := ListMonitoringSchedulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMonitoringSchedulesInput{} + } + + return &ListMonitoringSchedulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMonitoringSchedulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMonitoringSchedules page. +func (p *ListMonitoringSchedulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMonitoringSchedulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMonitoringSchedules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMonitoringSchedules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go b/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go index 14260e0df57..9617eee22ec 100644 --- a/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go +++ b/service/sagemaker/api_op_ListNotebookInstanceLifecycleConfigs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -137,6 +138,89 @@ func addOperationListNotebookInstanceLifecycleConfigsMiddlewares(stack *middlewa return nil } +// ListNotebookInstanceLifecycleConfigsAPIClient is a client that implements the +// ListNotebookInstanceLifecycleConfigs operation. +type ListNotebookInstanceLifecycleConfigsAPIClient interface { + ListNotebookInstanceLifecycleConfigs(context.Context, *ListNotebookInstanceLifecycleConfigsInput, ...func(*Options)) (*ListNotebookInstanceLifecycleConfigsOutput, error) +} + +var _ ListNotebookInstanceLifecycleConfigsAPIClient = (*Client)(nil) + +// ListNotebookInstanceLifecycleConfigsPaginatorOptions is the paginator options +// for ListNotebookInstanceLifecycleConfigs +type ListNotebookInstanceLifecycleConfigsPaginatorOptions struct { + // The maximum number of lifecycle configurations to return in the response. + 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 +} + +// ListNotebookInstanceLifecycleConfigsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListNotebookInstanceLifecycleConfigs +type ListNotebookInstanceLifecycleConfigsPaginator struct { + options ListNotebookInstanceLifecycleConfigsPaginatorOptions + client ListNotebookInstanceLifecycleConfigsAPIClient + params *ListNotebookInstanceLifecycleConfigsInput + nextToken *string + firstPage bool +} + +// NewListNotebookInstanceLifecycleConfigsPaginator returns a new +// ListNotebookInstanceLifecycleConfigsPaginator +func NewListNotebookInstanceLifecycleConfigsPaginator(client ListNotebookInstanceLifecycleConfigsAPIClient, params *ListNotebookInstanceLifecycleConfigsInput, optFns ...func(*ListNotebookInstanceLifecycleConfigsPaginatorOptions)) *ListNotebookInstanceLifecycleConfigsPaginator { + options := ListNotebookInstanceLifecycleConfigsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookInstanceLifecycleConfigsInput{} + } + + return &ListNotebookInstanceLifecycleConfigsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookInstanceLifecycleConfigsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNotebookInstanceLifecycleConfigs page. +func (p *ListNotebookInstanceLifecycleConfigsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookInstanceLifecycleConfigsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNotebookInstanceLifecycleConfigs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookInstanceLifecycleConfigs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListNotebookInstances.go b/service/sagemaker/api_op_ListNotebookInstances.go index 79b01a92e08..a16dc50a1c9 100644 --- a/service/sagemaker/api_op_ListNotebookInstances.go +++ b/service/sagemaker/api_op_ListNotebookInstances.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -158,6 +159,88 @@ func addOperationListNotebookInstancesMiddlewares(stack *middleware.Stack, optio return nil } +// ListNotebookInstancesAPIClient is a client that implements the +// ListNotebookInstances operation. +type ListNotebookInstancesAPIClient interface { + ListNotebookInstances(context.Context, *ListNotebookInstancesInput, ...func(*Options)) (*ListNotebookInstancesOutput, error) +} + +var _ ListNotebookInstancesAPIClient = (*Client)(nil) + +// ListNotebookInstancesPaginatorOptions is the paginator options for +// ListNotebookInstances +type ListNotebookInstancesPaginatorOptions struct { + // The maximum number of notebook instances 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 +} + +// ListNotebookInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListNotebookInstances +type ListNotebookInstancesPaginator struct { + options ListNotebookInstancesPaginatorOptions + client ListNotebookInstancesAPIClient + params *ListNotebookInstancesInput + nextToken *string + firstPage bool +} + +// NewListNotebookInstancesPaginator returns a new ListNotebookInstancesPaginator +func NewListNotebookInstancesPaginator(client ListNotebookInstancesAPIClient, params *ListNotebookInstancesInput, optFns ...func(*ListNotebookInstancesPaginatorOptions)) *ListNotebookInstancesPaginator { + options := ListNotebookInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotebookInstancesInput{} + } + + return &ListNotebookInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotebookInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNotebookInstances page. +func (p *ListNotebookInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotebookInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNotebookInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNotebookInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListProcessingJobs.go b/service/sagemaker/api_op_ListProcessingJobs.go index ec12bf95431..603e725b87f 100644 --- a/service/sagemaker/api_op_ListProcessingJobs.go +++ b/service/sagemaker/api_op_ListProcessingJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -136,6 +137,88 @@ func addOperationListProcessingJobsMiddlewares(stack *middleware.Stack, options return nil } +// ListProcessingJobsAPIClient is a client that implements the ListProcessingJobs +// operation. +type ListProcessingJobsAPIClient interface { + ListProcessingJobs(context.Context, *ListProcessingJobsInput, ...func(*Options)) (*ListProcessingJobsOutput, error) +} + +var _ ListProcessingJobsAPIClient = (*Client)(nil) + +// ListProcessingJobsPaginatorOptions is the paginator options for +// ListProcessingJobs +type ListProcessingJobsPaginatorOptions struct { + // The maximum number of processing jobs to return in the response. + 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 +} + +// ListProcessingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListProcessingJobs +type ListProcessingJobsPaginator struct { + options ListProcessingJobsPaginatorOptions + client ListProcessingJobsAPIClient + params *ListProcessingJobsInput + nextToken *string + firstPage bool +} + +// NewListProcessingJobsPaginator returns a new ListProcessingJobsPaginator +func NewListProcessingJobsPaginator(client ListProcessingJobsAPIClient, params *ListProcessingJobsInput, optFns ...func(*ListProcessingJobsPaginatorOptions)) *ListProcessingJobsPaginator { + options := ListProcessingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProcessingJobsInput{} + } + + return &ListProcessingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProcessingJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProcessingJobs page. +func (p *ListProcessingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProcessingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProcessingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProcessingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListSubscribedWorkteams.go b/service/sagemaker/api_op_ListSubscribedWorkteams.go index 74cbeb90ed5..d46d922c707 100644 --- a/service/sagemaker/api_op_ListSubscribedWorkteams.go +++ b/service/sagemaker/api_op_ListSubscribedWorkteams.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -116,6 +117,89 @@ func addOperationListSubscribedWorkteamsMiddlewares(stack *middleware.Stack, opt return nil } +// ListSubscribedWorkteamsAPIClient is a client that implements the +// ListSubscribedWorkteams operation. +type ListSubscribedWorkteamsAPIClient interface { + ListSubscribedWorkteams(context.Context, *ListSubscribedWorkteamsInput, ...func(*Options)) (*ListSubscribedWorkteamsOutput, error) +} + +var _ ListSubscribedWorkteamsAPIClient = (*Client)(nil) + +// ListSubscribedWorkteamsPaginatorOptions is the paginator options for +// ListSubscribedWorkteams +type ListSubscribedWorkteamsPaginatorOptions struct { + // The maximum number of work teams to return in each page of the response. + 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 +} + +// ListSubscribedWorkteamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListSubscribedWorkteams +type ListSubscribedWorkteamsPaginator struct { + options ListSubscribedWorkteamsPaginatorOptions + client ListSubscribedWorkteamsAPIClient + params *ListSubscribedWorkteamsInput + nextToken *string + firstPage bool +} + +// NewListSubscribedWorkteamsPaginator returns a new +// ListSubscribedWorkteamsPaginator +func NewListSubscribedWorkteamsPaginator(client ListSubscribedWorkteamsAPIClient, params *ListSubscribedWorkteamsInput, optFns ...func(*ListSubscribedWorkteamsPaginatorOptions)) *ListSubscribedWorkteamsPaginator { + options := ListSubscribedWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscribedWorkteamsInput{} + } + + return &ListSubscribedWorkteamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscribedWorkteamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSubscribedWorkteams page. +func (p *ListSubscribedWorkteamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscribedWorkteamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSubscribedWorkteams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscribedWorkteams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTags.go b/service/sagemaker/api_op_ListTags.go index 5f966ab2f49..b4bbf29e5c3 100644 --- a/service/sagemaker/api_op_ListTags.go +++ b/service/sagemaker/api_op_ListTags.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -116,6 +117,86 @@ func addOperationListTagsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListTagsAPIClient is a client that implements the ListTags operation. +type ListTagsAPIClient interface { + ListTags(context.Context, *ListTagsInput, ...func(*Options)) (*ListTagsOutput, error) +} + +var _ ListTagsAPIClient = (*Client)(nil) + +// ListTagsPaginatorOptions is the paginator options for ListTags +type ListTagsPaginatorOptions struct { + // Maximum number of tags 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 +} + +// ListTagsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTags +type ListTagsPaginator struct { + options ListTagsPaginatorOptions + client ListTagsAPIClient + params *ListTagsInput + nextToken *string + firstPage bool +} + +// NewListTagsPaginator returns a new ListTagsPaginator +func NewListTagsPaginator(client ListTagsAPIClient, params *ListTagsInput, optFns ...func(*ListTagsPaginatorOptions)) *ListTagsPaginator { + options := ListTagsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsInput{} + } + + return &ListTagsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTags page. +func (p *ListTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTags(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTags(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrainingJobs.go b/service/sagemaker/api_op_ListTrainingJobs.go index 34ebca55c72..22f42f263f2 100644 --- a/service/sagemaker/api_op_ListTrainingJobs.go +++ b/service/sagemaker/api_op_ListTrainingJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -140,6 +141,87 @@ func addOperationListTrainingJobsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListTrainingJobsAPIClient is a client that implements the ListTrainingJobs +// operation. +type ListTrainingJobsAPIClient interface { + ListTrainingJobs(context.Context, *ListTrainingJobsInput, ...func(*Options)) (*ListTrainingJobsOutput, error) +} + +var _ ListTrainingJobsAPIClient = (*Client)(nil) + +// ListTrainingJobsPaginatorOptions is the paginator options for ListTrainingJobs +type ListTrainingJobsPaginatorOptions struct { + // The maximum number of training jobs to return in the response. + 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 +} + +// ListTrainingJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrainingJobs +type ListTrainingJobsPaginator struct { + options ListTrainingJobsPaginatorOptions + client ListTrainingJobsAPIClient + params *ListTrainingJobsInput + nextToken *string + firstPage bool +} + +// NewListTrainingJobsPaginator returns a new ListTrainingJobsPaginator +func NewListTrainingJobsPaginator(client ListTrainingJobsAPIClient, params *ListTrainingJobsInput, optFns ...func(*ListTrainingJobsPaginatorOptions)) *ListTrainingJobsPaginator { + options := ListTrainingJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrainingJobsInput{} + } + + return &ListTrainingJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrainingJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTrainingJobs page. +func (p *ListTrainingJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrainingJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTrainingJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrainingJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go b/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go index 0751818fa63..c0309c6e971 100644 --- a/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go +++ b/service/sagemaker/api_op_ListTrainingJobsForHyperParameterTuningJob.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -132,6 +133,89 @@ func addOperationListTrainingJobsForHyperParameterTuningJobMiddlewares(stack *mi return nil } +// ListTrainingJobsForHyperParameterTuningJobAPIClient is a client that implements +// the ListTrainingJobsForHyperParameterTuningJob operation. +type ListTrainingJobsForHyperParameterTuningJobAPIClient interface { + ListTrainingJobsForHyperParameterTuningJob(context.Context, *ListTrainingJobsForHyperParameterTuningJobInput, ...func(*Options)) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) +} + +var _ ListTrainingJobsForHyperParameterTuningJobAPIClient = (*Client)(nil) + +// ListTrainingJobsForHyperParameterTuningJobPaginatorOptions is the paginator +// options for ListTrainingJobsForHyperParameterTuningJob +type ListTrainingJobsForHyperParameterTuningJobPaginatorOptions struct { + // The maximum number of training jobs to return. The default value is 10. + 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 +} + +// ListTrainingJobsForHyperParameterTuningJobPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrainingJobsForHyperParameterTuningJob +type ListTrainingJobsForHyperParameterTuningJobPaginator struct { + options ListTrainingJobsForHyperParameterTuningJobPaginatorOptions + client ListTrainingJobsForHyperParameterTuningJobAPIClient + params *ListTrainingJobsForHyperParameterTuningJobInput + nextToken *string + firstPage bool +} + +// NewListTrainingJobsForHyperParameterTuningJobPaginator returns a new +// ListTrainingJobsForHyperParameterTuningJobPaginator +func NewListTrainingJobsForHyperParameterTuningJobPaginator(client ListTrainingJobsForHyperParameterTuningJobAPIClient, params *ListTrainingJobsForHyperParameterTuningJobInput, optFns ...func(*ListTrainingJobsForHyperParameterTuningJobPaginatorOptions)) *ListTrainingJobsForHyperParameterTuningJobPaginator { + options := ListTrainingJobsForHyperParameterTuningJobPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrainingJobsForHyperParameterTuningJobInput{} + } + + return &ListTrainingJobsForHyperParameterTuningJobPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrainingJobsForHyperParameterTuningJobPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTrainingJobsForHyperParameterTuningJob page. +func (p *ListTrainingJobsForHyperParameterTuningJobPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTrainingJobsForHyperParameterTuningJob(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrainingJobsForHyperParameterTuningJob(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTransformJobs.go b/service/sagemaker/api_op_ListTransformJobs.go index 8576f65cd0f..d02d20d13bb 100644 --- a/service/sagemaker/api_op_ListTransformJobs.go +++ b/service/sagemaker/api_op_ListTransformJobs.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -137,6 +138,88 @@ func addOperationListTransformJobsMiddlewares(stack *middleware.Stack, options O return nil } +// ListTransformJobsAPIClient is a client that implements the ListTransformJobs +// operation. +type ListTransformJobsAPIClient interface { + ListTransformJobs(context.Context, *ListTransformJobsInput, ...func(*Options)) (*ListTransformJobsOutput, error) +} + +var _ ListTransformJobsAPIClient = (*Client)(nil) + +// ListTransformJobsPaginatorOptions is the paginator options for ListTransformJobs +type ListTransformJobsPaginatorOptions struct { + // The maximum number of transform jobs to return in the response. The default + // value is 10. + 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 +} + +// ListTransformJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTransformJobs +type ListTransformJobsPaginator struct { + options ListTransformJobsPaginatorOptions + client ListTransformJobsAPIClient + params *ListTransformJobsInput + nextToken *string + firstPage bool +} + +// NewListTransformJobsPaginator returns a new ListTransformJobsPaginator +func NewListTransformJobsPaginator(client ListTransformJobsAPIClient, params *ListTransformJobsInput, optFns ...func(*ListTransformJobsPaginatorOptions)) *ListTransformJobsPaginator { + options := ListTransformJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTransformJobsInput{} + } + + return &ListTransformJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTransformJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTransformJobs page. +func (p *ListTransformJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTransformJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTransformJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTransformJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrialComponents.go b/service/sagemaker/api_op_ListTrialComponents.go index 005ea420a73..dc97f8a0647 100644 --- a/service/sagemaker/api_op_ListTrialComponents.go +++ b/service/sagemaker/api_op_ListTrialComponents.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -142,6 +143,89 @@ func addOperationListTrialComponentsMiddlewares(stack *middleware.Stack, options return nil } +// ListTrialComponentsAPIClient is a client that implements the ListTrialComponents +// operation. +type ListTrialComponentsAPIClient interface { + ListTrialComponents(context.Context, *ListTrialComponentsInput, ...func(*Options)) (*ListTrialComponentsOutput, error) +} + +var _ ListTrialComponentsAPIClient = (*Client)(nil) + +// ListTrialComponentsPaginatorOptions is the paginator options for +// ListTrialComponents +type ListTrialComponentsPaginatorOptions struct { + // The maximum number of components to return in the response. The default value is + // 10. + 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 +} + +// ListTrialComponentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrialComponents +type ListTrialComponentsPaginator struct { + options ListTrialComponentsPaginatorOptions + client ListTrialComponentsAPIClient + params *ListTrialComponentsInput + nextToken *string + firstPage bool +} + +// NewListTrialComponentsPaginator returns a new ListTrialComponentsPaginator +func NewListTrialComponentsPaginator(client ListTrialComponentsAPIClient, params *ListTrialComponentsInput, optFns ...func(*ListTrialComponentsPaginatorOptions)) *ListTrialComponentsPaginator { + options := ListTrialComponentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrialComponentsInput{} + } + + return &ListTrialComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrialComponentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTrialComponents page. +func (p *ListTrialComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrialComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTrialComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrialComponents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListTrials.go b/service/sagemaker/api_op_ListTrials.go index d2cb5ba0a08..56a4cbaae11 100644 --- a/service/sagemaker/api_op_ListTrials.go +++ b/service/sagemaker/api_op_ListTrials.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -130,6 +131,86 @@ func addOperationListTrialsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTrialsAPIClient is a client that implements the ListTrials operation. +type ListTrialsAPIClient interface { + ListTrials(context.Context, *ListTrialsInput, ...func(*Options)) (*ListTrialsOutput, error) +} + +var _ ListTrialsAPIClient = (*Client)(nil) + +// ListTrialsPaginatorOptions is the paginator options for ListTrials +type ListTrialsPaginatorOptions struct { + // The maximum number of trials to return in the response. The default value is 10. + 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 +} + +// ListTrialsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListTrials +type ListTrialsPaginator struct { + options ListTrialsPaginatorOptions + client ListTrialsAPIClient + params *ListTrialsInput + nextToken *string + firstPage bool +} + +// NewListTrialsPaginator returns a new ListTrialsPaginator +func NewListTrialsPaginator(client ListTrialsAPIClient, params *ListTrialsInput, optFns ...func(*ListTrialsPaginatorOptions)) *ListTrialsPaginator { + options := ListTrialsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTrialsInput{} + } + + return &ListTrialsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTrialsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTrials page. +func (p *ListTrialsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTrialsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTrials(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTrials(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListUserProfiles.go b/service/sagemaker/api_op_ListUserProfiles.go index ac55318f76b..e316b25e11c 100644 --- a/service/sagemaker/api_op_ListUserProfiles.go +++ b/service/sagemaker/api_op_ListUserProfiles.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -119,6 +120,87 @@ func addOperationListUserProfilesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListUserProfilesAPIClient is a client that implements the ListUserProfiles +// operation. +type ListUserProfilesAPIClient interface { + ListUserProfiles(context.Context, *ListUserProfilesInput, ...func(*Options)) (*ListUserProfilesOutput, error) +} + +var _ ListUserProfilesAPIClient = (*Client)(nil) + +// ListUserProfilesPaginatorOptions is the paginator options for ListUserProfiles +type ListUserProfilesPaginatorOptions struct { + // Returns a list up to a specified limit. + 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 +} + +// ListUserProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListUserProfiles +type ListUserProfilesPaginator struct { + options ListUserProfilesPaginatorOptions + client ListUserProfilesAPIClient + params *ListUserProfilesInput + nextToken *string + firstPage bool +} + +// NewListUserProfilesPaginator returns a new ListUserProfilesPaginator +func NewListUserProfilesPaginator(client ListUserProfilesAPIClient, params *ListUserProfilesInput, optFns ...func(*ListUserProfilesPaginatorOptions)) *ListUserProfilesPaginator { + options := ListUserProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUserProfilesInput{} + } + + return &ListUserProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUserProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUserProfiles page. +func (p *ListUserProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUserProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUserProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUserProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListWorkforces.go b/service/sagemaker/api_op_ListWorkforces.go index 07881d2263d..0c5f1aa4212 100644 --- a/service/sagemaker/api_op_ListWorkforces.go +++ b/service/sagemaker/api_op_ListWorkforces.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -117,6 +118,87 @@ func addOperationListWorkforcesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListWorkforcesAPIClient is a client that implements the ListWorkforces +// operation. +type ListWorkforcesAPIClient interface { + ListWorkforces(context.Context, *ListWorkforcesInput, ...func(*Options)) (*ListWorkforcesOutput, error) +} + +var _ ListWorkforcesAPIClient = (*Client)(nil) + +// ListWorkforcesPaginatorOptions is the paginator options for ListWorkforces +type ListWorkforcesPaginatorOptions struct { + // The maximum number of workforces returned in the response. + 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 +} + +// ListWorkforcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListWorkforces +type ListWorkforcesPaginator struct { + options ListWorkforcesPaginatorOptions + client ListWorkforcesAPIClient + params *ListWorkforcesInput + nextToken *string + firstPage bool +} + +// NewListWorkforcesPaginator returns a new ListWorkforcesPaginator +func NewListWorkforcesPaginator(client ListWorkforcesAPIClient, params *ListWorkforcesInput, optFns ...func(*ListWorkforcesPaginatorOptions)) *ListWorkforcesPaginator { + options := ListWorkforcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkforcesInput{} + } + + return &ListWorkforcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkforcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkforces page. +func (p *ListWorkforcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkforcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkforces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkforces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_ListWorkteams.go b/service/sagemaker/api_op_ListWorkteams.go index 0bd6ff4d887..9ca425e252c 100644 --- a/service/sagemaker/api_op_ListWorkteams.go +++ b/service/sagemaker/api_op_ListWorkteams.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -122,6 +123,86 @@ func addOperationListWorkteamsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListWorkteamsAPIClient is a client that implements the ListWorkteams operation. +type ListWorkteamsAPIClient interface { + ListWorkteams(context.Context, *ListWorkteamsInput, ...func(*Options)) (*ListWorkteamsOutput, error) +} + +var _ ListWorkteamsAPIClient = (*Client)(nil) + +// ListWorkteamsPaginatorOptions is the paginator options for ListWorkteams +type ListWorkteamsPaginatorOptions struct { + // The maximum number of work teams to return in each page of the response. + 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 +} + +// ListWorkteamsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.ListWorkteams +type ListWorkteamsPaginator struct { + options ListWorkteamsPaginatorOptions + client ListWorkteamsAPIClient + params *ListWorkteamsInput + nextToken *string + firstPage bool +} + +// NewListWorkteamsPaginator returns a new ListWorkteamsPaginator +func NewListWorkteamsPaginator(client ListWorkteamsAPIClient, params *ListWorkteamsInput, optFns ...func(*ListWorkteamsPaginatorOptions)) *ListWorkteamsPaginator { + options := ListWorkteamsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkteamsInput{} + } + + return &ListWorkteamsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkteamsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkteams page. +func (p *ListWorkteamsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkteamsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWorkteams(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkteams(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/api_op_Search.go b/service/sagemaker/api_op_Search.go index 1f9244057f2..4f99ba6618e 100644 --- a/service/sagemaker/api_op_Search.go +++ b/service/sagemaker/api_op_Search.go @@ -4,6 +4,7 @@ package sagemaker 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/sagemaker/types" @@ -135,6 +136,86 @@ func addOperationSearchMiddlewares(stack *middleware.Stack, options Options) (er return nil } +// SearchAPIClient is a client that implements the Search operation. +type SearchAPIClient interface { + Search(context.Context, *SearchInput, ...func(*Options)) (*SearchOutput, error) +} + +var _ SearchAPIClient = (*Client)(nil) + +// SearchPaginatorOptions is the paginator options for Search +type SearchPaginatorOptions struct { + // The maximum number of results 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 +} + +// SearchPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemaker.Search +type SearchPaginator struct { + options SearchPaginatorOptions + client SearchAPIClient + params *SearchInput + nextToken *string + firstPage bool +} + +// NewSearchPaginator returns a new SearchPaginator +func NewSearchPaginator(client SearchAPIClient, params *SearchInput, optFns ...func(*SearchPaginatorOptions)) *SearchPaginator { + options := SearchPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchInput{} + } + + return &SearchPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next Search page. +func (p *SearchPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.Search(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearch(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemaker/endpoints.go b/service/sagemaker/endpoints.go index e7613b548de..a139cb2a175 100644 --- a/service/sagemaker/endpoints.go +++ b/service/sagemaker/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sagemakera2iruntime/api_op_ListHumanLoops.go b/service/sagemakera2iruntime/api_op_ListHumanLoops.go index ee76f8d4827..9168167d95c 100644 --- a/service/sagemakera2iruntime/api_op_ListHumanLoops.go +++ b/service/sagemakera2iruntime/api_op_ListHumanLoops.go @@ -4,6 +4,7 @@ package sagemakera2iruntime 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/sagemakera2iruntime/types" @@ -131,6 +132,89 @@ func addOperationListHumanLoopsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListHumanLoopsAPIClient is a client that implements the ListHumanLoops +// operation. +type ListHumanLoopsAPIClient interface { + ListHumanLoops(context.Context, *ListHumanLoopsInput, ...func(*Options)) (*ListHumanLoopsOutput, error) +} + +var _ ListHumanLoopsAPIClient = (*Client)(nil) + +// ListHumanLoopsPaginatorOptions is the paginator options for ListHumanLoops +type ListHumanLoopsPaginatorOptions struct { + // The total number of items to return. If the total number of available items is + // more than the value specified in MaxResults, then a NextToken is returned in the + // output. You can use this token to display the next page of results. + 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 +} + +// ListHumanLoopsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sagemakera2iruntime.ListHumanLoops +type ListHumanLoopsPaginator struct { + options ListHumanLoopsPaginatorOptions + client ListHumanLoopsAPIClient + params *ListHumanLoopsInput + nextToken *string + firstPage bool +} + +// NewListHumanLoopsPaginator returns a new ListHumanLoopsPaginator +func NewListHumanLoopsPaginator(client ListHumanLoopsAPIClient, params *ListHumanLoopsInput, optFns ...func(*ListHumanLoopsPaginatorOptions)) *ListHumanLoopsPaginator { + options := ListHumanLoopsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListHumanLoopsInput{} + } + + return &ListHumanLoopsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListHumanLoopsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListHumanLoops page. +func (p *ListHumanLoopsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHumanLoopsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListHumanLoops(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListHumanLoops(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sagemakera2iruntime/endpoints.go b/service/sagemakera2iruntime/endpoints.go index 71a5f6842a0..892c4ff21ce 100644 --- a/service/sagemakera2iruntime/endpoints.go +++ b/service/sagemakera2iruntime/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sagemakerruntime/endpoints.go b/service/sagemakerruntime/endpoints.go index 76a74bea9d5..614870db702 100644 --- a/service/sagemakerruntime/endpoints.go +++ b/service/sagemakerruntime/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/savingsplans/endpoints.go b/service/savingsplans/endpoints.go index a303442e3ca..14375a67391 100644 --- a/service/savingsplans/endpoints.go +++ b/service/savingsplans/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/schemas/api_op_ListDiscoverers.go b/service/schemas/api_op_ListDiscoverers.go index 7015cc3b5f6..923e57b6bd7 100644 --- a/service/schemas/api_op_ListDiscoverers.go +++ b/service/schemas/api_op_ListDiscoverers.go @@ -4,6 +4,7 @@ package schemas 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/schemas/types" @@ -116,6 +117,86 @@ func addOperationListDiscoverersMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListDiscoverersAPIClient is a client that implements the ListDiscoverers +// operation. +type ListDiscoverersAPIClient interface { + ListDiscoverers(context.Context, *ListDiscoverersInput, ...func(*Options)) (*ListDiscoverersOutput, error) +} + +var _ ListDiscoverersAPIClient = (*Client)(nil) + +// ListDiscoverersPaginatorOptions is the paginator options for ListDiscoverers +type ListDiscoverersPaginatorOptions struct { + 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 +} + +// ListDiscoverersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListDiscoverers +type ListDiscoverersPaginator struct { + options ListDiscoverersPaginatorOptions + client ListDiscoverersAPIClient + params *ListDiscoverersInput + nextToken *string + firstPage bool +} + +// NewListDiscoverersPaginator returns a new ListDiscoverersPaginator +func NewListDiscoverersPaginator(client ListDiscoverersAPIClient, params *ListDiscoverersInput, optFns ...func(*ListDiscoverersPaginatorOptions)) *ListDiscoverersPaginator { + options := ListDiscoverersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDiscoverersInput{} + } + + return &ListDiscoverersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDiscoverersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDiscoverers page. +func (p *ListDiscoverersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoverersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.ListDiscoverers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDiscoverers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListRegistries.go b/service/schemas/api_op_ListRegistries.go index 22782d00ab3..f51305a1086 100644 --- a/service/schemas/api_op_ListRegistries.go +++ b/service/schemas/api_op_ListRegistries.go @@ -4,6 +4,7 @@ package schemas 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/schemas/types" @@ -115,6 +116,86 @@ func addOperationListRegistriesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListRegistriesAPIClient is a client that implements the ListRegistries +// operation. +type ListRegistriesAPIClient interface { + ListRegistries(context.Context, *ListRegistriesInput, ...func(*Options)) (*ListRegistriesOutput, error) +} + +var _ ListRegistriesAPIClient = (*Client)(nil) + +// ListRegistriesPaginatorOptions is the paginator options for ListRegistries +type ListRegistriesPaginatorOptions struct { + 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 +} + +// ListRegistriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListRegistries +type ListRegistriesPaginator struct { + options ListRegistriesPaginatorOptions + client ListRegistriesAPIClient + params *ListRegistriesInput + nextToken *string + firstPage bool +} + +// NewListRegistriesPaginator returns a new ListRegistriesPaginator +func NewListRegistriesPaginator(client ListRegistriesAPIClient, params *ListRegistriesInput, optFns ...func(*ListRegistriesPaginatorOptions)) *ListRegistriesPaginator { + options := ListRegistriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRegistriesInput{} + } + + return &ListRegistriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRegistriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRegistries page. +func (p *ListRegistriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRegistriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.ListRegistries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRegistries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListSchemaVersions.go b/service/schemas/api_op_ListSchemaVersions.go index 25168683dc0..5b2a87cdeff 100644 --- a/service/schemas/api_op_ListSchemaVersions.go +++ b/service/schemas/api_op_ListSchemaVersions.go @@ -4,6 +4,7 @@ package schemas 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/schemas/types" @@ -121,6 +122,87 @@ func addOperationListSchemaVersionsMiddlewares(stack *middleware.Stack, options return nil } +// ListSchemaVersionsAPIClient is a client that implements the ListSchemaVersions +// operation. +type ListSchemaVersionsAPIClient interface { + ListSchemaVersions(context.Context, *ListSchemaVersionsInput, ...func(*Options)) (*ListSchemaVersionsOutput, error) +} + +var _ ListSchemaVersionsAPIClient = (*Client)(nil) + +// ListSchemaVersionsPaginatorOptions is the paginator options for +// ListSchemaVersions +type ListSchemaVersionsPaginatorOptions struct { + 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 +} + +// ListSchemaVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListSchemaVersions +type ListSchemaVersionsPaginator struct { + options ListSchemaVersionsPaginatorOptions + client ListSchemaVersionsAPIClient + params *ListSchemaVersionsInput + nextToken *string + firstPage bool +} + +// NewListSchemaVersionsPaginator returns a new ListSchemaVersionsPaginator +func NewListSchemaVersionsPaginator(client ListSchemaVersionsAPIClient, params *ListSchemaVersionsInput, optFns ...func(*ListSchemaVersionsPaginatorOptions)) *ListSchemaVersionsPaginator { + options := ListSchemaVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemaVersionsInput{} + } + + return &ListSchemaVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemaVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSchemaVersions page. +func (p *ListSchemaVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemaVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.ListSchemaVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemaVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_ListSchemas.go b/service/schemas/api_op_ListSchemas.go index f329944a15a..d658d775f4d 100644 --- a/service/schemas/api_op_ListSchemas.go +++ b/service/schemas/api_op_ListSchemas.go @@ -4,6 +4,7 @@ package schemas 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/schemas/types" @@ -120,6 +121,85 @@ func addOperationListSchemasMiddlewares(stack *middleware.Stack, options Options return nil } +// ListSchemasAPIClient is a client that implements the ListSchemas operation. +type ListSchemasAPIClient interface { + ListSchemas(context.Context, *ListSchemasInput, ...func(*Options)) (*ListSchemasOutput, error) +} + +var _ ListSchemasAPIClient = (*Client)(nil) + +// ListSchemasPaginatorOptions is the paginator options for ListSchemas +type ListSchemasPaginatorOptions struct { + 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 +} + +// ListSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.ListSchemas +type ListSchemasPaginator struct { + options ListSchemasPaginatorOptions + client ListSchemasAPIClient + params *ListSchemasInput + nextToken *string + firstPage bool +} + +// NewListSchemasPaginator returns a new ListSchemasPaginator +func NewListSchemasPaginator(client ListSchemasAPIClient, params *ListSchemasInput, optFns ...func(*ListSchemasPaginatorOptions)) *ListSchemasPaginator { + options := ListSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSchemasInput{} + } + + return &ListSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSchemasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSchemas page. +func (p *ListSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.ListSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/api_op_SearchSchemas.go b/service/schemas/api_op_SearchSchemas.go index 25bc6b22847..0a5abc48bc0 100644 --- a/service/schemas/api_op_SearchSchemas.go +++ b/service/schemas/api_op_SearchSchemas.go @@ -4,6 +4,7 @@ package schemas 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/schemas/types" @@ -122,6 +123,85 @@ func addOperationSearchSchemasMiddlewares(stack *middleware.Stack, options Optio return nil } +// SearchSchemasAPIClient is a client that implements the SearchSchemas operation. +type SearchSchemasAPIClient interface { + SearchSchemas(context.Context, *SearchSchemasInput, ...func(*Options)) (*SearchSchemasOutput, error) +} + +var _ SearchSchemasAPIClient = (*Client)(nil) + +// SearchSchemasPaginatorOptions is the paginator options for SearchSchemas +type SearchSchemasPaginatorOptions struct { + 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 +} + +// SearchSchemasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/schemas.SearchSchemas +type SearchSchemasPaginator struct { + options SearchSchemasPaginatorOptions + client SearchSchemasAPIClient + params *SearchSchemasInput + nextToken *string + firstPage bool +} + +// NewSearchSchemasPaginator returns a new SearchSchemasPaginator +func NewSearchSchemasPaginator(client SearchSchemasAPIClient, params *SearchSchemasInput, optFns ...func(*SearchSchemasPaginatorOptions)) *SearchSchemasPaginator { + options := SearchSchemasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchSchemasInput{} + } + + return &SearchSchemasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchSchemasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchSchemas page. +func (p *SearchSchemasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchSchemasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = p.options.Limit + } + + result, err := p.client.SearchSchemas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchSchemas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/schemas/endpoints.go b/service/schemas/endpoints.go index ea0c17fa837..9db44dca794 100644 --- a/service/schemas/endpoints.go +++ b/service/schemas/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/secretsmanager/api_op_ListSecretVersionIds.go b/service/secretsmanager/api_op_ListSecretVersionIds.go index f03628a88c2..e2113c5cfa0 100644 --- a/service/secretsmanager/api_op_ListSecretVersionIds.go +++ b/service/secretsmanager/api_op_ListSecretVersionIds.go @@ -4,6 +4,7 @@ package secretsmanager 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/secretsmanager/types" @@ -178,6 +179,96 @@ func addOperationListSecretVersionIdsMiddlewares(stack *middleware.Stack, option return nil } +// ListSecretVersionIdsAPIClient is a client that implements the +// ListSecretVersionIds operation. +type ListSecretVersionIdsAPIClient interface { + ListSecretVersionIds(context.Context, *ListSecretVersionIdsInput, ...func(*Options)) (*ListSecretVersionIdsOutput, error) +} + +var _ ListSecretVersionIdsAPIClient = (*Client)(nil) + +// ListSecretVersionIdsPaginatorOptions is the paginator options for +// ListSecretVersionIds +type ListSecretVersionIdsPaginatorOptions struct { + // (Optional) Limits the number of results you want to include in the response. If + // you don't include this parameter, it defaults to a value that's specific to the + // operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (isn't null). Include that + // value as the NextToken request parameter in the next call to the operation to + // get the next part of the results. Note that Secrets Manager might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListSecretVersionIdsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/secretsmanager.ListSecretVersionIds +type ListSecretVersionIdsPaginator struct { + options ListSecretVersionIdsPaginatorOptions + client ListSecretVersionIdsAPIClient + params *ListSecretVersionIdsInput + nextToken *string + firstPage bool +} + +// NewListSecretVersionIdsPaginator returns a new ListSecretVersionIdsPaginator +func NewListSecretVersionIdsPaginator(client ListSecretVersionIdsAPIClient, params *ListSecretVersionIdsInput, optFns ...func(*ListSecretVersionIdsPaginatorOptions)) *ListSecretVersionIdsPaginator { + options := ListSecretVersionIdsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecretVersionIdsInput{} + } + + return &ListSecretVersionIdsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretVersionIdsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecretVersionIds page. +func (p *ListSecretVersionIdsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretVersionIdsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListSecretVersionIds(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecretVersionIds(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/secretsmanager/api_op_ListSecrets.go b/service/secretsmanager/api_op_ListSecrets.go index 760aa2aa4da..9fd64ad39f5 100644 --- a/service/secretsmanager/api_op_ListSecrets.go +++ b/service/secretsmanager/api_op_ListSecrets.go @@ -4,6 +4,7 @@ package secretsmanager 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/secretsmanager/types" @@ -145,6 +146,94 @@ func addOperationListSecretsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListSecretsAPIClient is a client that implements the ListSecrets operation. +type ListSecretsAPIClient interface { + ListSecrets(context.Context, *ListSecretsInput, ...func(*Options)) (*ListSecretsOutput, error) +} + +var _ ListSecretsAPIClient = (*Client)(nil) + +// ListSecretsPaginatorOptions is the paginator options for ListSecrets +type ListSecretsPaginatorOptions struct { + // (Optional) Limits the number of results you want to include in the response. If + // you don't include this parameter, it defaults to a value that's specific to the + // operation. If additional items exist beyond the maximum you specify, the + // NextToken response element is present and has a value (isn't null). Include that + // value as the NextToken request parameter in the next call to the operation to + // get the next part of the results. Note that Secrets Manager might return fewer + // results than the maximum even when there are more results available. You should + // check NextToken after every operation to ensure that you receive all of the + // results. + 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 +} + +// ListSecretsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/secretsmanager.ListSecrets +type ListSecretsPaginator struct { + options ListSecretsPaginatorOptions + client ListSecretsAPIClient + params *ListSecretsInput + nextToken *string + firstPage bool +} + +// NewListSecretsPaginator returns a new ListSecretsPaginator +func NewListSecretsPaginator(client ListSecretsAPIClient, params *ListSecretsInput, optFns ...func(*ListSecretsPaginatorOptions)) *ListSecretsPaginator { + options := ListSecretsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecretsInput{} + } + + return &ListSecretsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecretsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecrets page. +func (p *ListSecretsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecretsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListSecrets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecrets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/secretsmanager/endpoints.go b/service/secretsmanager/endpoints.go index ac1c16bd30c..8715d8f65ee 100644 --- a/service/secretsmanager/endpoints.go +++ b/service/secretsmanager/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/securityhub/api_op_DescribeActionTargets.go b/service/securityhub/api_op_DescribeActionTargets.go index ff6bdff8df5..73233f1a140 100644 --- a/service/securityhub/api_op_DescribeActionTargets.go +++ b/service/securityhub/api_op_DescribeActionTargets.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -114,6 +115,88 @@ func addOperationDescribeActionTargetsMiddlewares(stack *middleware.Stack, optio return nil } +// DescribeActionTargetsAPIClient is a client that implements the +// DescribeActionTargets operation. +type DescribeActionTargetsAPIClient interface { + DescribeActionTargets(context.Context, *DescribeActionTargetsInput, ...func(*Options)) (*DescribeActionTargetsOutput, error) +} + +var _ DescribeActionTargetsAPIClient = (*Client)(nil) + +// DescribeActionTargetsPaginatorOptions is the paginator options for +// DescribeActionTargets +type DescribeActionTargetsPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeActionTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeActionTargets +type DescribeActionTargetsPaginator struct { + options DescribeActionTargetsPaginatorOptions + client DescribeActionTargetsAPIClient + params *DescribeActionTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeActionTargetsPaginator returns a new DescribeActionTargetsPaginator +func NewDescribeActionTargetsPaginator(client DescribeActionTargetsAPIClient, params *DescribeActionTargetsInput, optFns ...func(*DescribeActionTargetsPaginatorOptions)) *DescribeActionTargetsPaginator { + options := DescribeActionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeActionTargetsInput{} + } + + return &DescribeActionTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeActionTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeActionTargets page. +func (p *DescribeActionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActionTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeActionTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeActionTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeProducts.go b/service/securityhub/api_op_DescribeProducts.go index 4e8fd50433f..436b7501002 100644 --- a/service/securityhub/api_op_DescribeProducts.go +++ b/service/securityhub/api_op_DescribeProducts.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -111,6 +112,87 @@ func addOperationDescribeProductsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeProductsAPIClient is a client that implements the DescribeProducts +// operation. +type DescribeProductsAPIClient interface { + DescribeProducts(context.Context, *DescribeProductsInput, ...func(*Options)) (*DescribeProductsOutput, error) +} + +var _ DescribeProductsAPIClient = (*Client)(nil) + +// DescribeProductsPaginatorOptions is the paginator options for DescribeProducts +type DescribeProductsPaginatorOptions struct { + // The maximum number of results 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 +} + +// DescribeProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeProducts +type DescribeProductsPaginator struct { + options DescribeProductsPaginatorOptions + client DescribeProductsAPIClient + params *DescribeProductsInput + nextToken *string + firstPage bool +} + +// NewDescribeProductsPaginator returns a new DescribeProductsPaginator +func NewDescribeProductsPaginator(client DescribeProductsAPIClient, params *DescribeProductsInput, optFns ...func(*DescribeProductsPaginatorOptions)) *DescribeProductsPaginator { + options := DescribeProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeProductsInput{} + } + + return &DescribeProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeProductsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeProducts page. +func (p *DescribeProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeStandards.go b/service/securityhub/api_op_DescribeStandards.go index 0756feea427..cc348fd8633 100644 --- a/service/securityhub/api_op_DescribeStandards.go +++ b/service/securityhub/api_op_DescribeStandards.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -109,6 +110,87 @@ func addOperationDescribeStandardsMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeStandardsAPIClient is a client that implements the DescribeStandards +// operation. +type DescribeStandardsAPIClient interface { + DescribeStandards(context.Context, *DescribeStandardsInput, ...func(*Options)) (*DescribeStandardsOutput, error) +} + +var _ DescribeStandardsAPIClient = (*Client)(nil) + +// DescribeStandardsPaginatorOptions is the paginator options for DescribeStandards +type DescribeStandardsPaginatorOptions struct { + // The maximum number of standards 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 +} + +// DescribeStandardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeStandards +type DescribeStandardsPaginator struct { + options DescribeStandardsPaginatorOptions + client DescribeStandardsAPIClient + params *DescribeStandardsInput + nextToken *string + firstPage bool +} + +// NewDescribeStandardsPaginator returns a new DescribeStandardsPaginator +func NewDescribeStandardsPaginator(client DescribeStandardsAPIClient, params *DescribeStandardsInput, optFns ...func(*DescribeStandardsPaginatorOptions)) *DescribeStandardsPaginator { + options := DescribeStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStandardsInput{} + } + + return &DescribeStandardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStandardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStandards page. +func (p *DescribeStandardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStandardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeStandards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStandards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_DescribeStandardsControls.go b/service/securityhub/api_op_DescribeStandardsControls.go index 6a907f280d2..8c642adf53c 100644 --- a/service/securityhub/api_op_DescribeStandardsControls.go +++ b/service/securityhub/api_op_DescribeStandardsControls.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -118,6 +119,89 @@ func addOperationDescribeStandardsControlsMiddlewares(stack *middleware.Stack, o return nil } +// DescribeStandardsControlsAPIClient is a client that implements the +// DescribeStandardsControls operation. +type DescribeStandardsControlsAPIClient interface { + DescribeStandardsControls(context.Context, *DescribeStandardsControlsInput, ...func(*Options)) (*DescribeStandardsControlsOutput, error) +} + +var _ DescribeStandardsControlsAPIClient = (*Client)(nil) + +// DescribeStandardsControlsPaginatorOptions is the paginator options for +// DescribeStandardsControls +type DescribeStandardsControlsPaginatorOptions struct { + // The maximum number of security standard controls 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 +} + +// DescribeStandardsControlsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.DescribeStandardsControls +type DescribeStandardsControlsPaginator struct { + options DescribeStandardsControlsPaginatorOptions + client DescribeStandardsControlsAPIClient + params *DescribeStandardsControlsInput + nextToken *string + firstPage bool +} + +// NewDescribeStandardsControlsPaginator returns a new +// DescribeStandardsControlsPaginator +func NewDescribeStandardsControlsPaginator(client DescribeStandardsControlsAPIClient, params *DescribeStandardsControlsInput, optFns ...func(*DescribeStandardsControlsPaginatorOptions)) *DescribeStandardsControlsPaginator { + options := DescribeStandardsControlsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeStandardsControlsInput{} + } + + return &DescribeStandardsControlsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeStandardsControlsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeStandardsControls page. +func (p *DescribeStandardsControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeStandardsControlsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeStandardsControls(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeStandardsControls(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetEnabledStandards.go b/service/securityhub/api_op_GetEnabledStandards.go index 37c877b4151..2bc6471bcad 100644 --- a/service/securityhub/api_op_GetEnabledStandards.go +++ b/service/securityhub/api_op_GetEnabledStandards.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -112,6 +113,88 @@ func addOperationGetEnabledStandardsMiddlewares(stack *middleware.Stack, options return nil } +// GetEnabledStandardsAPIClient is a client that implements the GetEnabledStandards +// operation. +type GetEnabledStandardsAPIClient interface { + GetEnabledStandards(context.Context, *GetEnabledStandardsInput, ...func(*Options)) (*GetEnabledStandardsOutput, error) +} + +var _ GetEnabledStandardsAPIClient = (*Client)(nil) + +// GetEnabledStandardsPaginatorOptions is the paginator options for +// GetEnabledStandards +type GetEnabledStandardsPaginatorOptions struct { + // The maximum number of results to return in the response. + 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 +} + +// GetEnabledStandardsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetEnabledStandards +type GetEnabledStandardsPaginator struct { + options GetEnabledStandardsPaginatorOptions + client GetEnabledStandardsAPIClient + params *GetEnabledStandardsInput + nextToken *string + firstPage bool +} + +// NewGetEnabledStandardsPaginator returns a new GetEnabledStandardsPaginator +func NewGetEnabledStandardsPaginator(client GetEnabledStandardsAPIClient, params *GetEnabledStandardsInput, optFns ...func(*GetEnabledStandardsPaginatorOptions)) *GetEnabledStandardsPaginator { + options := GetEnabledStandardsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetEnabledStandardsInput{} + } + + return &GetEnabledStandardsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetEnabledStandardsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetEnabledStandards page. +func (p *GetEnabledStandardsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetEnabledStandardsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetEnabledStandards(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetEnabledStandards(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetFindings.go b/service/securityhub/api_op_GetFindings.go index c6816899644..b5c7c013172 100644 --- a/service/securityhub/api_op_GetFindings.go +++ b/service/securityhub/api_op_GetFindings.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -120,6 +121,86 @@ func addOperationGetFindingsMiddlewares(stack *middleware.Stack, options Options return nil } +// GetFindingsAPIClient is a client that implements the GetFindings operation. +type GetFindingsAPIClient interface { + GetFindings(context.Context, *GetFindingsInput, ...func(*Options)) (*GetFindingsOutput, error) +} + +var _ GetFindingsAPIClient = (*Client)(nil) + +// GetFindingsPaginatorOptions is the paginator options for GetFindings +type GetFindingsPaginatorOptions struct { + // The maximum number of findings 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 +} + +// GetFindingsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetFindings +type GetFindingsPaginator struct { + options GetFindingsPaginatorOptions + client GetFindingsAPIClient + params *GetFindingsInput + nextToken *string + firstPage bool +} + +// NewGetFindingsPaginator returns a new GetFindingsPaginator +func NewGetFindingsPaginator(client GetFindingsAPIClient, params *GetFindingsInput, optFns ...func(*GetFindingsPaginatorOptions)) *GetFindingsPaginator { + options := GetFindingsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetFindingsInput{} + } + + return &GetFindingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetFindingsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetFindings page. +func (p *GetFindingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetFindingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetFindings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetFindings(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_GetInsights.go b/service/securityhub/api_op_GetInsights.go index b79e1123b3a..237404f61fa 100644 --- a/service/securityhub/api_op_GetInsights.go +++ b/service/securityhub/api_op_GetInsights.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -115,6 +116,86 @@ func addOperationGetInsightsMiddlewares(stack *middleware.Stack, options Options return nil } +// GetInsightsAPIClient is a client that implements the GetInsights operation. +type GetInsightsAPIClient interface { + GetInsights(context.Context, *GetInsightsInput, ...func(*Options)) (*GetInsightsOutput, error) +} + +var _ GetInsightsAPIClient = (*Client)(nil) + +// GetInsightsPaginatorOptions is the paginator options for GetInsights +type GetInsightsPaginatorOptions struct { + // The maximum number of items to return in the response. + 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 +} + +// GetInsightsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.GetInsights +type GetInsightsPaginator struct { + options GetInsightsPaginatorOptions + client GetInsightsAPIClient + params *GetInsightsInput + nextToken *string + firstPage bool +} + +// NewGetInsightsPaginator returns a new GetInsightsPaginator +func NewGetInsightsPaginator(client GetInsightsAPIClient, params *GetInsightsInput, optFns ...func(*GetInsightsPaginatorOptions)) *GetInsightsPaginator { + options := GetInsightsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInsightsInput{} + } + + return &GetInsightsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInsightsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetInsights page. +func (p *GetInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInsightsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetInsights(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInsights(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListEnabledProductsForImport.go b/service/securityhub/api_op_ListEnabledProductsForImport.go index bd2c22a31f6..275a662f4ec 100644 --- a/service/securityhub/api_op_ListEnabledProductsForImport.go +++ b/service/securityhub/api_op_ListEnabledProductsForImport.go @@ -4,6 +4,7 @@ package securityhub 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/awslabs/smithy-go/middleware" @@ -109,6 +110,89 @@ func addOperationListEnabledProductsForImportMiddlewares(stack *middleware.Stack return nil } +// ListEnabledProductsForImportAPIClient is a client that implements the +// ListEnabledProductsForImport operation. +type ListEnabledProductsForImportAPIClient interface { + ListEnabledProductsForImport(context.Context, *ListEnabledProductsForImportInput, ...func(*Options)) (*ListEnabledProductsForImportOutput, error) +} + +var _ ListEnabledProductsForImportAPIClient = (*Client)(nil) + +// ListEnabledProductsForImportPaginatorOptions is the paginator options for +// ListEnabledProductsForImport +type ListEnabledProductsForImportPaginatorOptions struct { + // The maximum number of items to return in the response. + 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 +} + +// ListEnabledProductsForImportPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListEnabledProductsForImport +type ListEnabledProductsForImportPaginator struct { + options ListEnabledProductsForImportPaginatorOptions + client ListEnabledProductsForImportAPIClient + params *ListEnabledProductsForImportInput + nextToken *string + firstPage bool +} + +// NewListEnabledProductsForImportPaginator returns a new +// ListEnabledProductsForImportPaginator +func NewListEnabledProductsForImportPaginator(client ListEnabledProductsForImportAPIClient, params *ListEnabledProductsForImportInput, optFns ...func(*ListEnabledProductsForImportPaginatorOptions)) *ListEnabledProductsForImportPaginator { + options := ListEnabledProductsForImportPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEnabledProductsForImportInput{} + } + + return &ListEnabledProductsForImportPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEnabledProductsForImportPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEnabledProductsForImport page. +func (p *ListEnabledProductsForImportPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEnabledProductsForImportOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListEnabledProductsForImport(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEnabledProductsForImport(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListInvitations.go b/service/securityhub/api_op_ListInvitations.go index 8fdc9fcf2dd..6e13fc8a69f 100644 --- a/service/securityhub/api_op_ListInvitations.go +++ b/service/securityhub/api_op_ListInvitations.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -109,6 +110,87 @@ func addOperationListInvitationsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListInvitationsAPIClient is a client that implements the ListInvitations +// operation. +type ListInvitationsAPIClient interface { + ListInvitations(context.Context, *ListInvitationsInput, ...func(*Options)) (*ListInvitationsOutput, error) +} + +var _ ListInvitationsAPIClient = (*Client)(nil) + +// ListInvitationsPaginatorOptions is the paginator options for ListInvitations +type ListInvitationsPaginatorOptions struct { + // The maximum number of items to return in the response. + 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 +} + +// ListInvitationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListInvitations +type ListInvitationsPaginator struct { + options ListInvitationsPaginatorOptions + client ListInvitationsAPIClient + params *ListInvitationsInput + nextToken *string + firstPage bool +} + +// NewListInvitationsPaginator returns a new ListInvitationsPaginator +func NewListInvitationsPaginator(client ListInvitationsAPIClient, params *ListInvitationsInput, optFns ...func(*ListInvitationsPaginatorOptions)) *ListInvitationsPaginator { + options := ListInvitationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInvitationsInput{} + } + + return &ListInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInvitations page. +func (p *ListInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInvitations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/api_op_ListMembers.go b/service/securityhub/api_op_ListMembers.go index a4eb853206e..ff64067319a 100644 --- a/service/securityhub/api_op_ListMembers.go +++ b/service/securityhub/api_op_ListMembers.go @@ -4,6 +4,7 @@ package securityhub 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/securityhub/types" @@ -117,6 +118,86 @@ func addOperationListMembersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListMembersAPIClient is a client that implements the ListMembers operation. +type ListMembersAPIClient interface { + ListMembers(context.Context, *ListMembersInput, ...func(*Options)) (*ListMembersOutput, error) +} + +var _ ListMembersAPIClient = (*Client)(nil) + +// ListMembersPaginatorOptions is the paginator options for ListMembers +type ListMembersPaginatorOptions struct { + // The maximum number of items to return in the response. + 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 +} + +// ListMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/securityhub.ListMembers +type ListMembersPaginator struct { + options ListMembersPaginatorOptions + client ListMembersAPIClient + params *ListMembersInput + nextToken *string + firstPage bool +} + +// NewListMembersPaginator returns a new ListMembersPaginator +func NewListMembersPaginator(client ListMembersAPIClient, params *ListMembersInput, optFns ...func(*ListMembersPaginatorOptions)) *ListMembersPaginator { + options := ListMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMembersInput{} + } + + return &ListMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMembers page. +func (p *ListMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/securityhub/endpoints.go b/service/securityhub/endpoints.go index 63d75680030..6da7f6cf269 100644 --- a/service/securityhub/endpoints.go +++ b/service/securityhub/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go b/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go index 9c41a752b1c..71bb69d09e0 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go +++ b/service/serverlessapplicationrepository/api_op_ListApplicationDependencies.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository 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/serverlessapplicationrepository/types" @@ -116,6 +117,89 @@ func addOperationListApplicationDependenciesMiddlewares(stack *middleware.Stack, return nil } +// ListApplicationDependenciesAPIClient is a client that implements the +// ListApplicationDependencies operation. +type ListApplicationDependenciesAPIClient interface { + ListApplicationDependencies(context.Context, *ListApplicationDependenciesInput, ...func(*Options)) (*ListApplicationDependenciesOutput, error) +} + +var _ ListApplicationDependenciesAPIClient = (*Client)(nil) + +// ListApplicationDependenciesPaginatorOptions is the paginator options for +// ListApplicationDependencies +type ListApplicationDependenciesPaginatorOptions struct { + // The total number of items 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 +} + +// ListApplicationDependenciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplicationDependencies +type ListApplicationDependenciesPaginator struct { + options ListApplicationDependenciesPaginatorOptions + client ListApplicationDependenciesAPIClient + params *ListApplicationDependenciesInput + nextToken *string + firstPage bool +} + +// NewListApplicationDependenciesPaginator returns a new +// ListApplicationDependenciesPaginator +func NewListApplicationDependenciesPaginator(client ListApplicationDependenciesAPIClient, params *ListApplicationDependenciesInput, optFns ...func(*ListApplicationDependenciesPaginatorOptions)) *ListApplicationDependenciesPaginator { + options := ListApplicationDependenciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationDependenciesInput{} + } + + return &ListApplicationDependenciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationDependenciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplicationDependencies page. +func (p *ListApplicationDependenciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationDependenciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = p.options.Limit + } + + result, err := p.client.ListApplicationDependencies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationDependencies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go b/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go index d45b0375dd5..7dd5c356cfa 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go +++ b/service/serverlessapplicationrepository/api_op_ListApplicationVersions.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository 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/serverlessapplicationrepository/types" @@ -113,6 +114,89 @@ func addOperationListApplicationVersionsMiddlewares(stack *middleware.Stack, opt return nil } +// ListApplicationVersionsAPIClient is a client that implements the +// ListApplicationVersions operation. +type ListApplicationVersionsAPIClient interface { + ListApplicationVersions(context.Context, *ListApplicationVersionsInput, ...func(*Options)) (*ListApplicationVersionsOutput, error) +} + +var _ ListApplicationVersionsAPIClient = (*Client)(nil) + +// ListApplicationVersionsPaginatorOptions is the paginator options for +// ListApplicationVersions +type ListApplicationVersionsPaginatorOptions struct { + // The total number of items 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 +} + +// ListApplicationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplicationVersions +type ListApplicationVersionsPaginator struct { + options ListApplicationVersionsPaginatorOptions + client ListApplicationVersionsAPIClient + params *ListApplicationVersionsInput + nextToken *string + firstPage bool +} + +// NewListApplicationVersionsPaginator returns a new +// ListApplicationVersionsPaginator +func NewListApplicationVersionsPaginator(client ListApplicationVersionsAPIClient, params *ListApplicationVersionsInput, optFns ...func(*ListApplicationVersionsPaginatorOptions)) *ListApplicationVersionsPaginator { + options := ListApplicationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationVersionsInput{} + } + + return &ListApplicationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplicationVersions page. +func (p *ListApplicationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = p.options.Limit + } + + result, err := p.client.ListApplicationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplicationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/api_op_ListApplications.go b/service/serverlessapplicationrepository/api_op_ListApplications.go index 906ad8aa34f..e6e2c8d4e97 100644 --- a/service/serverlessapplicationrepository/api_op_ListApplications.go +++ b/service/serverlessapplicationrepository/api_op_ListApplications.go @@ -4,6 +4,7 @@ package serverlessapplicationrepository 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/serverlessapplicationrepository/types" @@ -105,6 +106,87 @@ func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions struct { + // The total number of items 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 +} + +// ListApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository.ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = p.options.Limit + } + + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/serverlessapplicationrepository/endpoints.go b/service/serverlessapplicationrepository/endpoints.go index 2ca85efb6b6..8acb8fad85b 100644 --- a/service/serverlessapplicationrepository/endpoints.go +++ b/service/serverlessapplicationrepository/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/servicecatalog/api_op_GetProvisionedProductOutputs.go b/service/servicecatalog/api_op_GetProvisionedProductOutputs.go index 8afba18518c..57483838089 100644 --- a/service/servicecatalog/api_op_GetProvisionedProductOutputs.go +++ b/service/servicecatalog/api_op_GetProvisionedProductOutputs.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -130,6 +131,89 @@ func addOperationGetProvisionedProductOutputsMiddlewares(stack *middleware.Stack return nil } +// GetProvisionedProductOutputsAPIClient is a client that implements the +// GetProvisionedProductOutputs operation. +type GetProvisionedProductOutputsAPIClient interface { + GetProvisionedProductOutputs(context.Context, *GetProvisionedProductOutputsInput, ...func(*Options)) (*GetProvisionedProductOutputsOutput, error) +} + +var _ GetProvisionedProductOutputsAPIClient = (*Client)(nil) + +// GetProvisionedProductOutputsPaginatorOptions is the paginator options for +// GetProvisionedProductOutputs +type GetProvisionedProductOutputsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// GetProvisionedProductOutputsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.GetProvisionedProductOutputs +type GetProvisionedProductOutputsPaginator struct { + options GetProvisionedProductOutputsPaginatorOptions + client GetProvisionedProductOutputsAPIClient + params *GetProvisionedProductOutputsInput + nextToken *string + firstPage bool +} + +// NewGetProvisionedProductOutputsPaginator returns a new +// GetProvisionedProductOutputsPaginator +func NewGetProvisionedProductOutputsPaginator(client GetProvisionedProductOutputsAPIClient, params *GetProvisionedProductOutputsInput, optFns ...func(*GetProvisionedProductOutputsPaginatorOptions)) *GetProvisionedProductOutputsPaginator { + options := GetProvisionedProductOutputsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetProvisionedProductOutputsInput{} + } + + return &GetProvisionedProductOutputsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetProvisionedProductOutputsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetProvisionedProductOutputs page. +func (p *GetProvisionedProductOutputsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetProvisionedProductOutputsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.GetProvisionedProductOutputs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetProvisionedProductOutputs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go b/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go index 5b913086a6c..f1f27680f1b 100644 --- a/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go +++ b/service/servicecatalog/api_op_ListAcceptedPortfolioShares.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -128,6 +129,89 @@ func addOperationListAcceptedPortfolioSharesMiddlewares(stack *middleware.Stack, return nil } +// ListAcceptedPortfolioSharesAPIClient is a client that implements the +// ListAcceptedPortfolioShares operation. +type ListAcceptedPortfolioSharesAPIClient interface { + ListAcceptedPortfolioShares(context.Context, *ListAcceptedPortfolioSharesInput, ...func(*Options)) (*ListAcceptedPortfolioSharesOutput, error) +} + +var _ ListAcceptedPortfolioSharesAPIClient = (*Client)(nil) + +// ListAcceptedPortfolioSharesPaginatorOptions is the paginator options for +// ListAcceptedPortfolioShares +type ListAcceptedPortfolioSharesPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListAcceptedPortfolioSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListAcceptedPortfolioShares +type ListAcceptedPortfolioSharesPaginator struct { + options ListAcceptedPortfolioSharesPaginatorOptions + client ListAcceptedPortfolioSharesAPIClient + params *ListAcceptedPortfolioSharesInput + nextToken *string + firstPage bool +} + +// NewListAcceptedPortfolioSharesPaginator returns a new +// ListAcceptedPortfolioSharesPaginator +func NewListAcceptedPortfolioSharesPaginator(client ListAcceptedPortfolioSharesAPIClient, params *ListAcceptedPortfolioSharesInput, optFns ...func(*ListAcceptedPortfolioSharesPaginatorOptions)) *ListAcceptedPortfolioSharesPaginator { + options := ListAcceptedPortfolioSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAcceptedPortfolioSharesInput{} + } + + return &ListAcceptedPortfolioSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAcceptedPortfolioSharesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAcceptedPortfolioShares page. +func (p *ListAcceptedPortfolioSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAcceptedPortfolioSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListAcceptedPortfolioShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAcceptedPortfolioShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListBudgetsForResource.go b/service/servicecatalog/api_op_ListBudgetsForResource.go index 0c08f5c2f91..dfec9e70216 100644 --- a/service/servicecatalog/api_op_ListBudgetsForResource.go +++ b/service/servicecatalog/api_op_ListBudgetsForResource.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -124,6 +125,88 @@ func addOperationListBudgetsForResourceMiddlewares(stack *middleware.Stack, opti return nil } +// ListBudgetsForResourceAPIClient is a client that implements the +// ListBudgetsForResource operation. +type ListBudgetsForResourceAPIClient interface { + ListBudgetsForResource(context.Context, *ListBudgetsForResourceInput, ...func(*Options)) (*ListBudgetsForResourceOutput, error) +} + +var _ ListBudgetsForResourceAPIClient = (*Client)(nil) + +// ListBudgetsForResourcePaginatorOptions is the paginator options for +// ListBudgetsForResource +type ListBudgetsForResourcePaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListBudgetsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListBudgetsForResource +type ListBudgetsForResourcePaginator struct { + options ListBudgetsForResourcePaginatorOptions + client ListBudgetsForResourceAPIClient + params *ListBudgetsForResourceInput + nextToken *string + firstPage bool +} + +// NewListBudgetsForResourcePaginator returns a new ListBudgetsForResourcePaginator +func NewListBudgetsForResourcePaginator(client ListBudgetsForResourceAPIClient, params *ListBudgetsForResourceInput, optFns ...func(*ListBudgetsForResourcePaginatorOptions)) *ListBudgetsForResourcePaginator { + options := ListBudgetsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListBudgetsForResourceInput{} + } + + return &ListBudgetsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListBudgetsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListBudgetsForResource page. +func (p *ListBudgetsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBudgetsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListBudgetsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListBudgetsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListConstraintsForPortfolio.go b/service/servicecatalog/api_op_ListConstraintsForPortfolio.go index 7d6dbad35b8..83f2413dacc 100644 --- a/service/servicecatalog/api_op_ListConstraintsForPortfolio.go +++ b/service/servicecatalog/api_op_ListConstraintsForPortfolio.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -127,6 +128,89 @@ func addOperationListConstraintsForPortfolioMiddlewares(stack *middleware.Stack, return nil } +// ListConstraintsForPortfolioAPIClient is a client that implements the +// ListConstraintsForPortfolio operation. +type ListConstraintsForPortfolioAPIClient interface { + ListConstraintsForPortfolio(context.Context, *ListConstraintsForPortfolioInput, ...func(*Options)) (*ListConstraintsForPortfolioOutput, error) +} + +var _ ListConstraintsForPortfolioAPIClient = (*Client)(nil) + +// ListConstraintsForPortfolioPaginatorOptions is the paginator options for +// ListConstraintsForPortfolio +type ListConstraintsForPortfolioPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListConstraintsForPortfolioPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListConstraintsForPortfolio +type ListConstraintsForPortfolioPaginator struct { + options ListConstraintsForPortfolioPaginatorOptions + client ListConstraintsForPortfolioAPIClient + params *ListConstraintsForPortfolioInput + nextToken *string + firstPage bool +} + +// NewListConstraintsForPortfolioPaginator returns a new +// ListConstraintsForPortfolioPaginator +func NewListConstraintsForPortfolioPaginator(client ListConstraintsForPortfolioAPIClient, params *ListConstraintsForPortfolioInput, optFns ...func(*ListConstraintsForPortfolioPaginatorOptions)) *ListConstraintsForPortfolioPaginator { + options := ListConstraintsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConstraintsForPortfolioInput{} + } + + return &ListConstraintsForPortfolioPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConstraintsForPortfolioPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConstraintsForPortfolio page. +func (p *ListConstraintsForPortfolioPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConstraintsForPortfolioOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListConstraintsForPortfolio(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConstraintsForPortfolio(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListLaunchPaths.go b/service/servicecatalog/api_op_ListLaunchPaths.go index 5e122e8ef58..0cb5d5d8f35 100644 --- a/service/servicecatalog/api_op_ListLaunchPaths.go +++ b/service/servicecatalog/api_op_ListLaunchPaths.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -126,6 +127,87 @@ func addOperationListLaunchPathsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListLaunchPathsAPIClient is a client that implements the ListLaunchPaths +// operation. +type ListLaunchPathsAPIClient interface { + ListLaunchPaths(context.Context, *ListLaunchPathsInput, ...func(*Options)) (*ListLaunchPathsOutput, error) +} + +var _ ListLaunchPathsAPIClient = (*Client)(nil) + +// ListLaunchPathsPaginatorOptions is the paginator options for ListLaunchPaths +type ListLaunchPathsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListLaunchPathsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListLaunchPaths +type ListLaunchPathsPaginator struct { + options ListLaunchPathsPaginatorOptions + client ListLaunchPathsAPIClient + params *ListLaunchPathsInput + nextToken *string + firstPage bool +} + +// NewListLaunchPathsPaginator returns a new ListLaunchPathsPaginator +func NewListLaunchPathsPaginator(client ListLaunchPathsAPIClient, params *ListLaunchPathsInput, optFns ...func(*ListLaunchPathsPaginatorOptions)) *ListLaunchPathsPaginator { + options := ListLaunchPathsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLaunchPathsInput{} + } + + return &ListLaunchPathsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLaunchPathsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLaunchPaths page. +func (p *ListLaunchPathsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLaunchPathsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListLaunchPaths(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLaunchPaths(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go b/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go index b53c9baf571..3c4da5fe3b8 100644 --- a/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go +++ b/service/servicecatalog/api_op_ListOrganizationPortfolioAccess.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -142,6 +143,89 @@ func addOperationListOrganizationPortfolioAccessMiddlewares(stack *middleware.St return nil } +// ListOrganizationPortfolioAccessAPIClient is a client that implements the +// ListOrganizationPortfolioAccess operation. +type ListOrganizationPortfolioAccessAPIClient interface { + ListOrganizationPortfolioAccess(context.Context, *ListOrganizationPortfolioAccessInput, ...func(*Options)) (*ListOrganizationPortfolioAccessOutput, error) +} + +var _ ListOrganizationPortfolioAccessAPIClient = (*Client)(nil) + +// ListOrganizationPortfolioAccessPaginatorOptions is the paginator options for +// ListOrganizationPortfolioAccess +type ListOrganizationPortfolioAccessPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListOrganizationPortfolioAccessPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListOrganizationPortfolioAccess +type ListOrganizationPortfolioAccessPaginator struct { + options ListOrganizationPortfolioAccessPaginatorOptions + client ListOrganizationPortfolioAccessAPIClient + params *ListOrganizationPortfolioAccessInput + nextToken *string + firstPage bool +} + +// NewListOrganizationPortfolioAccessPaginator returns a new +// ListOrganizationPortfolioAccessPaginator +func NewListOrganizationPortfolioAccessPaginator(client ListOrganizationPortfolioAccessAPIClient, params *ListOrganizationPortfolioAccessInput, optFns ...func(*ListOrganizationPortfolioAccessPaginatorOptions)) *ListOrganizationPortfolioAccessPaginator { + options := ListOrganizationPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationPortfolioAccessInput{} + } + + return &ListOrganizationPortfolioAccessPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationPortfolioAccessPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOrganizationPortfolioAccess page. +func (p *ListOrganizationPortfolioAccessPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationPortfolioAccessOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListOrganizationPortfolioAccess(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizationPortfolioAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfolioAccess.go b/service/servicecatalog/api_op_ListPortfolioAccess.go index 047dfb90111..bd3657b6239 100644 --- a/service/servicecatalog/api_op_ListPortfolioAccess.go +++ b/service/servicecatalog/api_op_ListPortfolioAccess.go @@ -4,6 +4,7 @@ package servicecatalog 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/awslabs/smithy-go/middleware" @@ -130,6 +131,88 @@ func addOperationListPortfolioAccessMiddlewares(stack *middleware.Stack, options return nil } +// ListPortfolioAccessAPIClient is a client that implements the ListPortfolioAccess +// operation. +type ListPortfolioAccessAPIClient interface { + ListPortfolioAccess(context.Context, *ListPortfolioAccessInput, ...func(*Options)) (*ListPortfolioAccessOutput, error) +} + +var _ ListPortfolioAccessAPIClient = (*Client)(nil) + +// ListPortfolioAccessPaginatorOptions is the paginator options for +// ListPortfolioAccess +type ListPortfolioAccessPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListPortfolioAccessPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfolioAccess +type ListPortfolioAccessPaginator struct { + options ListPortfolioAccessPaginatorOptions + client ListPortfolioAccessAPIClient + params *ListPortfolioAccessInput + nextToken *string + firstPage bool +} + +// NewListPortfolioAccessPaginator returns a new ListPortfolioAccessPaginator +func NewListPortfolioAccessPaginator(client ListPortfolioAccessAPIClient, params *ListPortfolioAccessInput, optFns ...func(*ListPortfolioAccessPaginatorOptions)) *ListPortfolioAccessPaginator { + options := ListPortfolioAccessPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfolioAccessInput{} + } + + return &ListPortfolioAccessPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfolioAccessPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPortfolioAccess page. +func (p *ListPortfolioAccessPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfolioAccessOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListPortfolioAccess(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfolioAccess(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfolios.go b/service/servicecatalog/api_op_ListPortfolios.go index a6ca73d4cd5..8405973d166 100644 --- a/service/servicecatalog/api_op_ListPortfolios.go +++ b/service/servicecatalog/api_op_ListPortfolios.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -116,6 +117,87 @@ func addOperationListPortfoliosMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListPortfoliosAPIClient is a client that implements the ListPortfolios +// operation. +type ListPortfoliosAPIClient interface { + ListPortfolios(context.Context, *ListPortfoliosInput, ...func(*Options)) (*ListPortfoliosOutput, error) +} + +var _ ListPortfoliosAPIClient = (*Client)(nil) + +// ListPortfoliosPaginatorOptions is the paginator options for ListPortfolios +type ListPortfoliosPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListPortfoliosPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfolios +type ListPortfoliosPaginator struct { + options ListPortfoliosPaginatorOptions + client ListPortfoliosAPIClient + params *ListPortfoliosInput + nextToken *string + firstPage bool +} + +// NewListPortfoliosPaginator returns a new ListPortfoliosPaginator +func NewListPortfoliosPaginator(client ListPortfoliosAPIClient, params *ListPortfoliosInput, optFns ...func(*ListPortfoliosPaginatorOptions)) *ListPortfoliosPaginator { + options := ListPortfoliosPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfoliosInput{} + } + + return &ListPortfoliosPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfoliosPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPortfolios page. +func (p *ListPortfoliosPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfoliosOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListPortfolios(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfolios(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPortfoliosForProduct.go b/service/servicecatalog/api_op_ListPortfoliosForProduct.go index 3815a2d51d8..e5160de90e7 100644 --- a/service/servicecatalog/api_op_ListPortfoliosForProduct.go +++ b/service/servicecatalog/api_op_ListPortfoliosForProduct.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -124,6 +125,89 @@ func addOperationListPortfoliosForProductMiddlewares(stack *middleware.Stack, op return nil } +// ListPortfoliosForProductAPIClient is a client that implements the +// ListPortfoliosForProduct operation. +type ListPortfoliosForProductAPIClient interface { + ListPortfoliosForProduct(context.Context, *ListPortfoliosForProductInput, ...func(*Options)) (*ListPortfoliosForProductOutput, error) +} + +var _ ListPortfoliosForProductAPIClient = (*Client)(nil) + +// ListPortfoliosForProductPaginatorOptions is the paginator options for +// ListPortfoliosForProduct +type ListPortfoliosForProductPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListPortfoliosForProductPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPortfoliosForProduct +type ListPortfoliosForProductPaginator struct { + options ListPortfoliosForProductPaginatorOptions + client ListPortfoliosForProductAPIClient + params *ListPortfoliosForProductInput + nextToken *string + firstPage bool +} + +// NewListPortfoliosForProductPaginator returns a new +// ListPortfoliosForProductPaginator +func NewListPortfoliosForProductPaginator(client ListPortfoliosForProductAPIClient, params *ListPortfoliosForProductInput, optFns ...func(*ListPortfoliosForProductPaginatorOptions)) *ListPortfoliosForProductPaginator { + options := ListPortfoliosForProductPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPortfoliosForProductInput{} + } + + return &ListPortfoliosForProductPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPortfoliosForProductPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPortfoliosForProduct page. +func (p *ListPortfoliosForProductPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPortfoliosForProductOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListPortfoliosForProduct(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPortfoliosForProduct(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go index 906e142301d..a836835b6ae 100644 --- a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go +++ b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -124,6 +125,89 @@ func addOperationListPrincipalsForPortfolioMiddlewares(stack *middleware.Stack, return nil } +// ListPrincipalsForPortfolioAPIClient is a client that implements the +// ListPrincipalsForPortfolio operation. +type ListPrincipalsForPortfolioAPIClient interface { + ListPrincipalsForPortfolio(context.Context, *ListPrincipalsForPortfolioInput, ...func(*Options)) (*ListPrincipalsForPortfolioOutput, error) +} + +var _ ListPrincipalsForPortfolioAPIClient = (*Client)(nil) + +// ListPrincipalsForPortfolioPaginatorOptions is the paginator options for +// ListPrincipalsForPortfolio +type ListPrincipalsForPortfolioPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListPrincipalsForPortfolioPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListPrincipalsForPortfolio +type ListPrincipalsForPortfolioPaginator struct { + options ListPrincipalsForPortfolioPaginatorOptions + client ListPrincipalsForPortfolioAPIClient + params *ListPrincipalsForPortfolioInput + nextToken *string + firstPage bool +} + +// NewListPrincipalsForPortfolioPaginator returns a new +// ListPrincipalsForPortfolioPaginator +func NewListPrincipalsForPortfolioPaginator(client ListPrincipalsForPortfolioAPIClient, params *ListPrincipalsForPortfolioInput, optFns ...func(*ListPrincipalsForPortfolioPaginatorOptions)) *ListPrincipalsForPortfolioPaginator { + options := ListPrincipalsForPortfolioPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPrincipalsForPortfolioInput{} + } + + return &ListPrincipalsForPortfolioPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPrincipalsForPortfolioPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPrincipalsForPortfolio page. +func (p *ListPrincipalsForPortfolioPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPrincipalsForPortfolioOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListPrincipalsForPortfolio(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPrincipalsForPortfolio(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go b/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go index 2973dc2f482..8521b957e11 100644 --- a/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go +++ b/service/servicecatalog/api_op_ListProvisioningArtifactsForServiceAction.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -126,6 +127,89 @@ func addOperationListProvisioningArtifactsForServiceActionMiddlewares(stack *mid return nil } +// ListProvisioningArtifactsForServiceActionAPIClient is a client that implements +// the ListProvisioningArtifactsForServiceAction operation. +type ListProvisioningArtifactsForServiceActionAPIClient interface { + ListProvisioningArtifactsForServiceAction(context.Context, *ListProvisioningArtifactsForServiceActionInput, ...func(*Options)) (*ListProvisioningArtifactsForServiceActionOutput, error) +} + +var _ ListProvisioningArtifactsForServiceActionAPIClient = (*Client)(nil) + +// ListProvisioningArtifactsForServiceActionPaginatorOptions is the paginator +// options for ListProvisioningArtifactsForServiceAction +type ListProvisioningArtifactsForServiceActionPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListProvisioningArtifactsForServiceActionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListProvisioningArtifactsForServiceAction +type ListProvisioningArtifactsForServiceActionPaginator struct { + options ListProvisioningArtifactsForServiceActionPaginatorOptions + client ListProvisioningArtifactsForServiceActionAPIClient + params *ListProvisioningArtifactsForServiceActionInput + nextToken *string + firstPage bool +} + +// NewListProvisioningArtifactsForServiceActionPaginator returns a new +// ListProvisioningArtifactsForServiceActionPaginator +func NewListProvisioningArtifactsForServiceActionPaginator(client ListProvisioningArtifactsForServiceActionAPIClient, params *ListProvisioningArtifactsForServiceActionInput, optFns ...func(*ListProvisioningArtifactsForServiceActionPaginatorOptions)) *ListProvisioningArtifactsForServiceActionPaginator { + options := ListProvisioningArtifactsForServiceActionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProvisioningArtifactsForServiceActionInput{} + } + + return &ListProvisioningArtifactsForServiceActionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProvisioningArtifactsForServiceActionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProvisioningArtifactsForServiceAction page. +func (p *ListProvisioningArtifactsForServiceActionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProvisioningArtifactsForServiceActionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListProvisioningArtifactsForServiceAction(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProvisioningArtifactsForServiceAction(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListResourcesForTagOption.go b/service/servicecatalog/api_op_ListResourcesForTagOption.go index dcff7e515f4..4e383df01e9 100644 --- a/service/servicecatalog/api_op_ListResourcesForTagOption.go +++ b/service/servicecatalog/api_op_ListResourcesForTagOption.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -122,6 +123,89 @@ func addOperationListResourcesForTagOptionMiddlewares(stack *middleware.Stack, o return nil } +// ListResourcesForTagOptionAPIClient is a client that implements the +// ListResourcesForTagOption operation. +type ListResourcesForTagOptionAPIClient interface { + ListResourcesForTagOption(context.Context, *ListResourcesForTagOptionInput, ...func(*Options)) (*ListResourcesForTagOptionOutput, error) +} + +var _ ListResourcesForTagOptionAPIClient = (*Client)(nil) + +// ListResourcesForTagOptionPaginatorOptions is the paginator options for +// ListResourcesForTagOption +type ListResourcesForTagOptionPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListResourcesForTagOptionPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListResourcesForTagOption +type ListResourcesForTagOptionPaginator struct { + options ListResourcesForTagOptionPaginatorOptions + client ListResourcesForTagOptionAPIClient + params *ListResourcesForTagOptionInput + nextToken *string + firstPage bool +} + +// NewListResourcesForTagOptionPaginator returns a new +// ListResourcesForTagOptionPaginator +func NewListResourcesForTagOptionPaginator(client ListResourcesForTagOptionAPIClient, params *ListResourcesForTagOptionInput, optFns ...func(*ListResourcesForTagOptionPaginatorOptions)) *ListResourcesForTagOptionPaginator { + options := ListResourcesForTagOptionPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesForTagOptionInput{} + } + + return &ListResourcesForTagOptionPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesForTagOptionPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourcesForTagOption page. +func (p *ListResourcesForTagOptionPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesForTagOptionOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListResourcesForTagOption(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourcesForTagOption(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListServiceActions.go b/service/servicecatalog/api_op_ListServiceActions.go index 6180a7d4cfb..d5380397152 100644 --- a/service/servicecatalog/api_op_ListServiceActions.go +++ b/service/servicecatalog/api_op_ListServiceActions.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -117,6 +118,88 @@ func addOperationListServiceActionsMiddlewares(stack *middleware.Stack, options return nil } +// ListServiceActionsAPIClient is a client that implements the ListServiceActions +// operation. +type ListServiceActionsAPIClient interface { + ListServiceActions(context.Context, *ListServiceActionsInput, ...func(*Options)) (*ListServiceActionsOutput, error) +} + +var _ ListServiceActionsAPIClient = (*Client)(nil) + +// ListServiceActionsPaginatorOptions is the paginator options for +// ListServiceActions +type ListServiceActionsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListServiceActionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListServiceActions +type ListServiceActionsPaginator struct { + options ListServiceActionsPaginatorOptions + client ListServiceActionsAPIClient + params *ListServiceActionsInput + nextToken *string + firstPage bool +} + +// NewListServiceActionsPaginator returns a new ListServiceActionsPaginator +func NewListServiceActionsPaginator(client ListServiceActionsAPIClient, params *ListServiceActionsInput, optFns ...func(*ListServiceActionsPaginatorOptions)) *ListServiceActionsPaginator { + options := ListServiceActionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceActionsInput{} + } + + return &ListServiceActionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceActionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServiceActions page. +func (p *ListServiceActionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceActionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListServiceActions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceActions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go b/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go index ed083bb393e..2405f37fa56 100644 --- a/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go +++ b/service/servicecatalog/api_op_ListServiceActionsForProvisioningArtifact.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -131,6 +132,89 @@ func addOperationListServiceActionsForProvisioningArtifactMiddlewares(stack *mid return nil } +// ListServiceActionsForProvisioningArtifactAPIClient is a client that implements +// the ListServiceActionsForProvisioningArtifact operation. +type ListServiceActionsForProvisioningArtifactAPIClient interface { + ListServiceActionsForProvisioningArtifact(context.Context, *ListServiceActionsForProvisioningArtifactInput, ...func(*Options)) (*ListServiceActionsForProvisioningArtifactOutput, error) +} + +var _ ListServiceActionsForProvisioningArtifactAPIClient = (*Client)(nil) + +// ListServiceActionsForProvisioningArtifactPaginatorOptions is the paginator +// options for ListServiceActionsForProvisioningArtifact +type ListServiceActionsForProvisioningArtifactPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListServiceActionsForProvisioningArtifactPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListServiceActionsForProvisioningArtifact +type ListServiceActionsForProvisioningArtifactPaginator struct { + options ListServiceActionsForProvisioningArtifactPaginatorOptions + client ListServiceActionsForProvisioningArtifactAPIClient + params *ListServiceActionsForProvisioningArtifactInput + nextToken *string + firstPage bool +} + +// NewListServiceActionsForProvisioningArtifactPaginator returns a new +// ListServiceActionsForProvisioningArtifactPaginator +func NewListServiceActionsForProvisioningArtifactPaginator(client ListServiceActionsForProvisioningArtifactAPIClient, params *ListServiceActionsForProvisioningArtifactInput, optFns ...func(*ListServiceActionsForProvisioningArtifactPaginatorOptions)) *ListServiceActionsForProvisioningArtifactPaginator { + options := ListServiceActionsForProvisioningArtifactPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceActionsForProvisioningArtifactInput{} + } + + return &ListServiceActionsForProvisioningArtifactPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceActionsForProvisioningArtifactPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServiceActionsForProvisioningArtifact page. +func (p *ListServiceActionsForProvisioningArtifactPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceActionsForProvisioningArtifactOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListServiceActionsForProvisioningArtifact(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceActionsForProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_ListTagOptions.go b/service/servicecatalog/api_op_ListTagOptions.go index 83e30b8107d..ae61c002c7c 100644 --- a/service/servicecatalog/api_op_ListTagOptions.go +++ b/service/servicecatalog/api_op_ListTagOptions.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -111,6 +112,87 @@ func addOperationListTagOptionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListTagOptionsAPIClient is a client that implements the ListTagOptions +// operation. +type ListTagOptionsAPIClient interface { + ListTagOptions(context.Context, *ListTagOptionsInput, ...func(*Options)) (*ListTagOptionsOutput, error) +} + +var _ ListTagOptionsAPIClient = (*Client)(nil) + +// ListTagOptionsPaginatorOptions is the paginator options for ListTagOptions +type ListTagOptionsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// ListTagOptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.ListTagOptions +type ListTagOptionsPaginator struct { + options ListTagOptionsPaginatorOptions + client ListTagOptionsAPIClient + params *ListTagOptionsInput + nextToken *string + firstPage bool +} + +// NewListTagOptionsPaginator returns a new ListTagOptionsPaginator +func NewListTagOptionsPaginator(client ListTagOptionsAPIClient, params *ListTagOptionsInput, optFns ...func(*ListTagOptionsPaginatorOptions)) *ListTagOptionsPaginator { + options := ListTagOptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagOptionsInput{} + } + + return &ListTagOptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagOptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagOptions page. +func (p *ListTagOptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagOptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.ListTagOptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.PageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagOptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProducts.go b/service/servicecatalog/api_op_SearchProducts.go index 01c37e597c7..859f7340db0 100644 --- a/service/servicecatalog/api_op_SearchProducts.go +++ b/service/servicecatalog/api_op_SearchProducts.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -129,6 +130,87 @@ func addOperationSearchProductsMiddlewares(stack *middleware.Stack, options Opti return nil } +// SearchProductsAPIClient is a client that implements the SearchProducts +// operation. +type SearchProductsAPIClient interface { + SearchProducts(context.Context, *SearchProductsInput, ...func(*Options)) (*SearchProductsOutput, error) +} + +var _ SearchProductsAPIClient = (*Client)(nil) + +// SearchProductsPaginatorOptions is the paginator options for SearchProducts +type SearchProductsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// SearchProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProducts +type SearchProductsPaginator struct { + options SearchProductsPaginatorOptions + client SearchProductsAPIClient + params *SearchProductsInput + nextToken *string + firstPage bool +} + +// NewSearchProductsPaginator returns a new SearchProductsPaginator +func NewSearchProductsPaginator(client SearchProductsAPIClient, params *SearchProductsInput, optFns ...func(*SearchProductsPaginatorOptions)) *SearchProductsPaginator { + options := SearchProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProductsInput{} + } + + return &SearchProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProductsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchProducts page. +func (p *SearchProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.SearchProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProductsAsAdmin.go b/service/servicecatalog/api_op_SearchProductsAsAdmin.go index d470006dde6..95490e0e130 100644 --- a/service/servicecatalog/api_op_SearchProductsAsAdmin.go +++ b/service/servicecatalog/api_op_SearchProductsAsAdmin.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -132,6 +133,88 @@ func addOperationSearchProductsAsAdminMiddlewares(stack *middleware.Stack, optio return nil } +// SearchProductsAsAdminAPIClient is a client that implements the +// SearchProductsAsAdmin operation. +type SearchProductsAsAdminAPIClient interface { + SearchProductsAsAdmin(context.Context, *SearchProductsAsAdminInput, ...func(*Options)) (*SearchProductsAsAdminOutput, error) +} + +var _ SearchProductsAsAdminAPIClient = (*Client)(nil) + +// SearchProductsAsAdminPaginatorOptions is the paginator options for +// SearchProductsAsAdmin +type SearchProductsAsAdminPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// SearchProductsAsAdminPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProductsAsAdmin +type SearchProductsAsAdminPaginator struct { + options SearchProductsAsAdminPaginatorOptions + client SearchProductsAsAdminAPIClient + params *SearchProductsAsAdminInput + nextToken *string + firstPage bool +} + +// NewSearchProductsAsAdminPaginator returns a new SearchProductsAsAdminPaginator +func NewSearchProductsAsAdminPaginator(client SearchProductsAsAdminAPIClient, params *SearchProductsAsAdminInput, optFns ...func(*SearchProductsAsAdminPaginatorOptions)) *SearchProductsAsAdminPaginator { + options := SearchProductsAsAdminPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProductsAsAdminInput{} + } + + return &SearchProductsAsAdminPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProductsAsAdminPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchProductsAsAdmin page. +func (p *SearchProductsAsAdminPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProductsAsAdminOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.SearchProductsAsAdmin(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProductsAsAdmin(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/api_op_SearchProvisionedProducts.go b/service/servicecatalog/api_op_SearchProvisionedProducts.go index 435ffd55d61..42ff2870108 100644 --- a/service/servicecatalog/api_op_SearchProvisionedProducts.go +++ b/service/servicecatalog/api_op_SearchProvisionedProducts.go @@ -4,6 +4,7 @@ package servicecatalog 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/servicecatalog/types" @@ -137,6 +138,89 @@ func addOperationSearchProvisionedProductsMiddlewares(stack *middleware.Stack, o return nil } +// SearchProvisionedProductsAPIClient is a client that implements the +// SearchProvisionedProducts operation. +type SearchProvisionedProductsAPIClient interface { + SearchProvisionedProducts(context.Context, *SearchProvisionedProductsInput, ...func(*Options)) (*SearchProvisionedProductsOutput, error) +} + +var _ SearchProvisionedProductsAPIClient = (*Client)(nil) + +// SearchProvisionedProductsPaginatorOptions is the paginator options for +// SearchProvisionedProducts +type SearchProvisionedProductsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// SearchProvisionedProductsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicecatalog.SearchProvisionedProducts +type SearchProvisionedProductsPaginator struct { + options SearchProvisionedProductsPaginatorOptions + client SearchProvisionedProductsAPIClient + params *SearchProvisionedProductsInput + nextToken *string + firstPage bool +} + +// NewSearchProvisionedProductsPaginator returns a new +// SearchProvisionedProductsPaginator +func NewSearchProvisionedProductsPaginator(client SearchProvisionedProductsAPIClient, params *SearchProvisionedProductsInput, optFns ...func(*SearchProvisionedProductsPaginatorOptions)) *SearchProvisionedProductsPaginator { + options := SearchProvisionedProductsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &SearchProvisionedProductsInput{} + } + + return &SearchProvisionedProductsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchProvisionedProductsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next SearchProvisionedProducts page. +func (p *SearchProvisionedProductsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchProvisionedProductsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = p.options.Limit + } + + result, err := p.client.SearchProvisionedProducts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opSearchProvisionedProducts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicecatalog/endpoints.go b/service/servicecatalog/endpoints.go index daf4e8068fb..77dc3a07c87 100644 --- a/service/servicecatalog/endpoints.go +++ b/service/servicecatalog/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/servicediscovery/api_op_GetInstancesHealthStatus.go b/service/servicediscovery/api_op_GetInstancesHealthStatus.go index 249059c5b4a..1a5da326d1c 100644 --- a/service/servicediscovery/api_op_GetInstancesHealthStatus.go +++ b/service/servicediscovery/api_op_GetInstancesHealthStatus.go @@ -4,6 +4,7 @@ package servicediscovery 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/servicediscovery/types" @@ -133,6 +134,91 @@ func addOperationGetInstancesHealthStatusMiddlewares(stack *middleware.Stack, op return nil } +// GetInstancesHealthStatusAPIClient is a client that implements the +// GetInstancesHealthStatus operation. +type GetInstancesHealthStatusAPIClient interface { + GetInstancesHealthStatus(context.Context, *GetInstancesHealthStatusInput, ...func(*Options)) (*GetInstancesHealthStatusOutput, error) +} + +var _ GetInstancesHealthStatusAPIClient = (*Client)(nil) + +// GetInstancesHealthStatusPaginatorOptions is the paginator options for +// GetInstancesHealthStatus +type GetInstancesHealthStatusPaginatorOptions struct { + // The maximum number of instances that you want AWS Cloud Map to return in the + // response to a GetInstancesHealthStatus request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 instances. + 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 +} + +// GetInstancesHealthStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.GetInstancesHealthStatus +type GetInstancesHealthStatusPaginator struct { + options GetInstancesHealthStatusPaginatorOptions + client GetInstancesHealthStatusAPIClient + params *GetInstancesHealthStatusInput + nextToken *string + firstPage bool +} + +// NewGetInstancesHealthStatusPaginator returns a new +// GetInstancesHealthStatusPaginator +func NewGetInstancesHealthStatusPaginator(client GetInstancesHealthStatusAPIClient, params *GetInstancesHealthStatusInput, optFns ...func(*GetInstancesHealthStatusPaginatorOptions)) *GetInstancesHealthStatusPaginator { + options := GetInstancesHealthStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInstancesHealthStatusInput{} + } + + return &GetInstancesHealthStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInstancesHealthStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetInstancesHealthStatus page. +func (p *GetInstancesHealthStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInstancesHealthStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetInstancesHealthStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInstancesHealthStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListInstances.go b/service/servicediscovery/api_op_ListInstances.go index d2da138c873..52131d2e9c3 100644 --- a/service/servicediscovery/api_op_ListInstances.go +++ b/service/servicediscovery/api_op_ListInstances.go @@ -4,6 +4,7 @@ package servicediscovery 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/servicediscovery/types" @@ -122,6 +123,88 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // The maximum number of instances that you want AWS Cloud Map to return in the + // response to a ListInstances request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 instances. + 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 +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListNamespaces.go b/service/servicediscovery/api_op_ListNamespaces.go index 80608e73900..fad091997b7 100644 --- a/service/servicediscovery/api_op_ListNamespaces.go +++ b/service/servicediscovery/api_op_ListNamespaces.go @@ -4,6 +4,7 @@ package servicediscovery 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/servicediscovery/types" @@ -129,6 +130,89 @@ func addOperationListNamespacesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListNamespacesAPIClient is a client that implements the ListNamespaces +// operation. +type ListNamespacesAPIClient interface { + ListNamespaces(context.Context, *ListNamespacesInput, ...func(*Options)) (*ListNamespacesOutput, error) +} + +var _ ListNamespacesAPIClient = (*Client)(nil) + +// ListNamespacesPaginatorOptions is the paginator options for ListNamespaces +type ListNamespacesPaginatorOptions struct { + // The maximum number of namespaces that you want AWS Cloud Map to return in the + // response to a ListNamespaces request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 namespaces. + 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 +} + +// ListNamespacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListNamespaces +type ListNamespacesPaginator struct { + options ListNamespacesPaginatorOptions + client ListNamespacesAPIClient + params *ListNamespacesInput + nextToken *string + firstPage bool +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + options := ListNamespacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNamespacesInput{} + } + + return &ListNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamespacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNamespaces page. +func (p *ListNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamespacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListNamespaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListOperations.go b/service/servicediscovery/api_op_ListOperations.go index 85fce22cea5..f298b83d396 100644 --- a/service/servicediscovery/api_op_ListOperations.go +++ b/service/servicediscovery/api_op_ListOperations.go @@ -4,6 +4,7 @@ package servicediscovery 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/servicediscovery/types" @@ -128,6 +129,89 @@ func addOperationListOperationsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListOperationsAPIClient is a client that implements the ListOperations +// operation. +type ListOperationsAPIClient interface { + ListOperations(context.Context, *ListOperationsInput, ...func(*Options)) (*ListOperationsOutput, error) +} + +var _ ListOperationsAPIClient = (*Client)(nil) + +// ListOperationsPaginatorOptions is the paginator options for ListOperations +type ListOperationsPaginatorOptions struct { + // The maximum number of items that you want AWS Cloud Map to return in the + // response to a ListOperations request. If you don't specify a value for + // MaxResults, AWS Cloud Map returns up to 100 operations. + 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 +} + +// ListOperationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListOperations +type ListOperationsPaginator struct { + options ListOperationsPaginatorOptions + client ListOperationsAPIClient + params *ListOperationsInput + nextToken *string + firstPage bool +} + +// NewListOperationsPaginator returns a new ListOperationsPaginator +func NewListOperationsPaginator(client ListOperationsAPIClient, params *ListOperationsInput, optFns ...func(*ListOperationsPaginatorOptions)) *ListOperationsPaginator { + options := ListOperationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOperationsInput{} + } + + return &ListOperationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOperationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOperations page. +func (p *ListOperationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOperationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListOperations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOperations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/api_op_ListServices.go b/service/servicediscovery/api_op_ListServices.go index 3733e3a0268..67fb7f07175 100644 --- a/service/servicediscovery/api_op_ListServices.go +++ b/service/servicediscovery/api_op_ListServices.go @@ -4,6 +4,7 @@ package servicediscovery 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/servicediscovery/types" @@ -128,6 +129,88 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // The maximum number of services that you want AWS Cloud Map to return in the + // response to a ListServices request. If you don't specify a value for MaxResults, + // AWS Cloud Map returns up to 100 services. + 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 +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicediscovery.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicediscovery/endpoints.go b/service/servicediscovery/endpoints.go index 53d2cc127a5..fba77965d6d 100644 --- a/service/servicediscovery/endpoints.go +++ b/service/servicediscovery/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go index 5a81c4b5f76..160dd8b1a94 100644 --- a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go +++ b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -139,6 +140,95 @@ func addOperationListAWSDefaultServiceQuotasMiddlewares(stack *middleware.Stack, return nil } +// ListAWSDefaultServiceQuotasAPIClient is a client that implements the +// ListAWSDefaultServiceQuotas operation. +type ListAWSDefaultServiceQuotasAPIClient interface { + ListAWSDefaultServiceQuotas(context.Context, *ListAWSDefaultServiceQuotasInput, ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) +} + +var _ ListAWSDefaultServiceQuotasAPIClient = (*Client)(nil) + +// ListAWSDefaultServiceQuotasPaginatorOptions is the paginator options for +// ListAWSDefaultServiceQuotas +type ListAWSDefaultServiceQuotasPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListAWSDefaultServiceQuotasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListAWSDefaultServiceQuotas +type ListAWSDefaultServiceQuotasPaginator struct { + options ListAWSDefaultServiceQuotasPaginatorOptions + client ListAWSDefaultServiceQuotasAPIClient + params *ListAWSDefaultServiceQuotasInput + nextToken *string + firstPage bool +} + +// NewListAWSDefaultServiceQuotasPaginator returns a new +// ListAWSDefaultServiceQuotasPaginator +func NewListAWSDefaultServiceQuotasPaginator(client ListAWSDefaultServiceQuotasAPIClient, params *ListAWSDefaultServiceQuotasInput, optFns ...func(*ListAWSDefaultServiceQuotasPaginatorOptions)) *ListAWSDefaultServiceQuotasPaginator { + options := ListAWSDefaultServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAWSDefaultServiceQuotasInput{} + } + + return &ListAWSDefaultServiceQuotasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAWSDefaultServiceQuotasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAWSDefaultServiceQuotas page. +func (p *ListAWSDefaultServiceQuotasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAWSDefaultServiceQuotas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAWSDefaultServiceQuotas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go index 97716290493..ea2f71b4220 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -126,6 +127,95 @@ func addOperationListRequestedServiceQuotaChangeHistoryMiddlewares(stack *middle return nil } +// ListRequestedServiceQuotaChangeHistoryAPIClient is a client that implements the +// ListRequestedServiceQuotaChangeHistory operation. +type ListRequestedServiceQuotaChangeHistoryAPIClient interface { + ListRequestedServiceQuotaChangeHistory(context.Context, *ListRequestedServiceQuotaChangeHistoryInput, ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) +} + +var _ ListRequestedServiceQuotaChangeHistoryAPIClient = (*Client)(nil) + +// ListRequestedServiceQuotaChangeHistoryPaginatorOptions is the paginator options +// for ListRequestedServiceQuotaChangeHistory +type ListRequestedServiceQuotaChangeHistoryPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListRequestedServiceQuotaChangeHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListRequestedServiceQuotaChangeHistory +type ListRequestedServiceQuotaChangeHistoryPaginator struct { + options ListRequestedServiceQuotaChangeHistoryPaginatorOptions + client ListRequestedServiceQuotaChangeHistoryAPIClient + params *ListRequestedServiceQuotaChangeHistoryInput + nextToken *string + firstPage bool +} + +// NewListRequestedServiceQuotaChangeHistoryPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryPaginator +func NewListRequestedServiceQuotaChangeHistoryPaginator(client ListRequestedServiceQuotaChangeHistoryAPIClient, params *ListRequestedServiceQuotaChangeHistoryInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryPaginator { + options := ListRequestedServiceQuotaChangeHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRequestedServiceQuotaChangeHistoryInput{} + } + + return &ListRequestedServiceQuotaChangeHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRequestedServiceQuotaChangeHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRequestedServiceQuotaChangeHistory page. +func (p *ListRequestedServiceQuotaChangeHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRequestedServiceQuotaChangeHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRequestedServiceQuotaChangeHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go index 7d11f4fab33..7b25941213b 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -139,6 +140,95 @@ func addOperationListRequestedServiceQuotaChangeHistoryByQuotaMiddlewares(stack return nil } +// ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient is a client that +// implements the ListRequestedServiceQuotaChangeHistoryByQuota operation. +type ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient interface { + ListRequestedServiceQuotaChangeHistoryByQuota(context.Context, *ListRequestedServiceQuotaChangeHistoryByQuotaInput, ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryByQuotaOutput, error) +} + +var _ ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient = (*Client)(nil) + +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions is the paginator +// options for ListRequestedServiceQuotaChangeHistoryByQuota +type ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListRequestedServiceQuotaChangeHistoryByQuota +type ListRequestedServiceQuotaChangeHistoryByQuotaPaginator struct { + options ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions + client ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient + params *ListRequestedServiceQuotaChangeHistoryByQuotaInput + nextToken *string + firstPage bool +} + +// NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator returns a new +// ListRequestedServiceQuotaChangeHistoryByQuotaPaginator +func NewListRequestedServiceQuotaChangeHistoryByQuotaPaginator(client ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient, params *ListRequestedServiceQuotaChangeHistoryByQuotaInput, optFns ...func(*ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions)) *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator { + options := ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListRequestedServiceQuotaChangeHistoryByQuotaInput{} + } + + return &ListRequestedServiceQuotaChangeHistoryByQuotaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListRequestedServiceQuotaChangeHistoryByQuota page. +func (p *ListRequestedServiceQuotaChangeHistoryByQuotaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryByQuotaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListRequestedServiceQuotaChangeHistoryByQuota(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListRequestedServiceQuotaChangeHistoryByQuota(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go index 41446ffa162..0a4c3931a57 100644 --- a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go +++ b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -127,6 +128,95 @@ func addOperationListServiceQuotaIncreaseRequestsInTemplateMiddlewares(stack *mi return nil } +// ListServiceQuotaIncreaseRequestsInTemplateAPIClient is a client that implements +// the ListServiceQuotaIncreaseRequestsInTemplate operation. +type ListServiceQuotaIncreaseRequestsInTemplateAPIClient interface { + ListServiceQuotaIncreaseRequestsInTemplate(context.Context, *ListServiceQuotaIncreaseRequestsInTemplateInput, ...func(*Options)) (*ListServiceQuotaIncreaseRequestsInTemplateOutput, error) +} + +var _ ListServiceQuotaIncreaseRequestsInTemplateAPIClient = (*Client)(nil) + +// ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions is the paginator +// options for ListServiceQuotaIncreaseRequestsInTemplate +type ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListServiceQuotaIncreaseRequestsInTemplatePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServiceQuotaIncreaseRequestsInTemplate +type ListServiceQuotaIncreaseRequestsInTemplatePaginator struct { + options ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions + client ListServiceQuotaIncreaseRequestsInTemplateAPIClient + params *ListServiceQuotaIncreaseRequestsInTemplateInput + nextToken *string + firstPage bool +} + +// NewListServiceQuotaIncreaseRequestsInTemplatePaginator returns a new +// ListServiceQuotaIncreaseRequestsInTemplatePaginator +func NewListServiceQuotaIncreaseRequestsInTemplatePaginator(client ListServiceQuotaIncreaseRequestsInTemplateAPIClient, params *ListServiceQuotaIncreaseRequestsInTemplateInput, optFns ...func(*ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions)) *ListServiceQuotaIncreaseRequestsInTemplatePaginator { + options := ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceQuotaIncreaseRequestsInTemplateInput{} + } + + return &ListServiceQuotaIncreaseRequestsInTemplatePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceQuotaIncreaseRequestsInTemplatePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServiceQuotaIncreaseRequestsInTemplate page. +func (p *ListServiceQuotaIncreaseRequestsInTemplatePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceQuotaIncreaseRequestsInTemplateOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServiceQuotaIncreaseRequestsInTemplate(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceQuotaIncreaseRequestsInTemplate(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServiceQuotas.go b/service/servicequotas/api_op_ListServiceQuotas.go index 2887ff87d7b..406003c1c8a 100644 --- a/service/servicequotas/api_op_ListServiceQuotas.go +++ b/service/servicequotas/api_op_ListServiceQuotas.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -137,6 +138,93 @@ func addOperationListServiceQuotasMiddlewares(stack *middleware.Stack, options O return nil } +// ListServiceQuotasAPIClient is a client that implements the ListServiceQuotas +// operation. +type ListServiceQuotasAPIClient interface { + ListServiceQuotas(context.Context, *ListServiceQuotasInput, ...func(*Options)) (*ListServiceQuotasOutput, error) +} + +var _ ListServiceQuotasAPIClient = (*Client)(nil) + +// ListServiceQuotasPaginatorOptions is the paginator options for ListServiceQuotas +type ListServiceQuotasPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListServiceQuotasPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServiceQuotas +type ListServiceQuotasPaginator struct { + options ListServiceQuotasPaginatorOptions + client ListServiceQuotasAPIClient + params *ListServiceQuotasInput + nextToken *string + firstPage bool +} + +// NewListServiceQuotasPaginator returns a new ListServiceQuotasPaginator +func NewListServiceQuotasPaginator(client ListServiceQuotasAPIClient, params *ListServiceQuotasInput, optFns ...func(*ListServiceQuotasPaginatorOptions)) *ListServiceQuotasPaginator { + options := ListServiceQuotasPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceQuotasInput{} + } + + return &ListServiceQuotasPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceQuotasPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServiceQuotas page. +func (p *ListServiceQuotasPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceQuotasOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServiceQuotas(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServiceQuotas(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/api_op_ListServices.go b/service/servicequotas/api_op_ListServices.go index 28c0055bb24..db8fe61e7a6 100644 --- a/service/servicequotas/api_op_ListServices.go +++ b/service/servicequotas/api_op_ListServices.go @@ -4,6 +4,7 @@ package servicequotas 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/servicequotas/types" @@ -122,6 +123,92 @@ func addOperationListServicesMiddlewares(stack *middleware.Stack, options Option return nil } +// ListServicesAPIClient is a client that implements the ListServices operation. +type ListServicesAPIClient interface { + ListServices(context.Context, *ListServicesInput, ...func(*Options)) (*ListServicesOutput, error) +} + +var _ ListServicesAPIClient = (*Client)(nil) + +// ListServicesPaginatorOptions is the paginator options for ListServices +type ListServicesPaginatorOptions struct { + // (Optional) Limits the number of results that you want to include in the + // response. If you don't include this parameter, the response defaults to a value + // that's specific to the operation. If additional items exist beyond the specified + // maximum, the NextToken element is present and has a value (isn't null). Include + // that value as the NextToken request parameter in the call to the operation to + // get the next part of the results. You should check NextToken after every + // operation to ensure that you receive all of the results. + 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 +} + +// ListServicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/servicequotas.ListServices +type ListServicesPaginator struct { + options ListServicesPaginatorOptions + client ListServicesAPIClient + params *ListServicesInput + nextToken *string + firstPage bool +} + +// NewListServicesPaginator returns a new ListServicesPaginator +func NewListServicesPaginator(client ListServicesAPIClient, params *ListServicesInput, optFns ...func(*ListServicesPaginatorOptions)) *ListServicesPaginator { + options := ListServicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServicesInput{} + } + + return &ListServicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServices page. +func (p *ListServicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/servicequotas/endpoints.go b/service/servicequotas/endpoints.go index f85248ec50e..e519ba990a6 100644 --- a/service/servicequotas/endpoints.go +++ b/service/servicequotas/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ses/api_op_ListCustomVerificationEmailTemplates.go b/service/ses/api_op_ListCustomVerificationEmailTemplates.go index 769a9a38908..7a8b126cbfd 100644 --- a/service/ses/api_op_ListCustomVerificationEmailTemplates.go +++ b/service/ses/api_op_ListCustomVerificationEmailTemplates.go @@ -4,6 +4,7 @@ package ses 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/ses/types" @@ -122,6 +123,92 @@ func addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middlewa return nil } +// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the +// ListCustomVerificationEmailTemplates operation. +type ListCustomVerificationEmailTemplatesAPIClient interface { + ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) +} + +var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil) + +// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options +// for ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginatorOptions struct { + // The maximum number of custom verification email templates to return. This value + // must be at least 1 and less than or equal to 50. If you do not specify a value, + // or if you specify a value less than 1 or greater than 50, the operation will + // return up to 50 results. + 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 +} + +// ListCustomVerificationEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ses.ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginator struct { + options ListCustomVerificationEmailTemplatesPaginatorOptions + client ListCustomVerificationEmailTemplatesAPIClient + params *ListCustomVerificationEmailTemplatesInput + nextToken *string + firstPage bool +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + return &ListCustomVerificationEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCustomVerificationEmailTemplates page. +func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListCustomVerificationEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ses/api_op_ListIdentities.go b/service/ses/api_op_ListIdentities.go index 355c0173a4a..87591943ea1 100644 --- a/service/ses/api_op_ListIdentities.go +++ b/service/ses/api_op_ListIdentities.go @@ -4,6 +4,7 @@ package ses 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/ses/types" @@ -118,6 +119,87 @@ func addOperationListIdentitiesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListIdentitiesAPIClient is a client that implements the ListIdentities +// operation. +type ListIdentitiesAPIClient interface { + ListIdentities(context.Context, *ListIdentitiesInput, ...func(*Options)) (*ListIdentitiesOutput, error) +} + +var _ ListIdentitiesAPIClient = (*Client)(nil) + +// ListIdentitiesPaginatorOptions is the paginator options for ListIdentities +type ListIdentitiesPaginatorOptions struct { + // The maximum number of identities per page. Possible values are 1-1000 inclusive. + 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 +} + +// ListIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ses.ListIdentities +type ListIdentitiesPaginator struct { + options ListIdentitiesPaginatorOptions + client ListIdentitiesAPIClient + params *ListIdentitiesInput + nextToken *string + firstPage bool +} + +// NewListIdentitiesPaginator returns a new ListIdentitiesPaginator +func NewListIdentitiesPaginator(client ListIdentitiesAPIClient, params *ListIdentitiesInput, optFns ...func(*ListIdentitiesPaginatorOptions)) *ListIdentitiesPaginator { + options := ListIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListIdentitiesInput{} + } + + return &ListIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListIdentitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListIdentities page. +func (p *ListIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxItems = &p.options.Limit + } + + result, err := p.client.ListIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ses/endpoints.go b/service/ses/endpoints.go index 0b7efb1db4b..bdd69e9b941 100644 --- a/service/ses/endpoints.go +++ b/service/ses/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sesv2/api_op_GetDedicatedIps.go b/service/sesv2/api_op_GetDedicatedIps.go index a5c16327673..9cdd19860b7 100644 --- a/service/sesv2/api_op_GetDedicatedIps.go +++ b/service/sesv2/api_op_GetDedicatedIps.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -117,6 +118,90 @@ func addOperationGetDedicatedIpsMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetDedicatedIpsAPIClient is a client that implements the GetDedicatedIps +// operation. +type GetDedicatedIpsAPIClient interface { + GetDedicatedIps(context.Context, *GetDedicatedIpsInput, ...func(*Options)) (*GetDedicatedIpsOutput, error) +} + +var _ GetDedicatedIpsAPIClient = (*Client)(nil) + +// GetDedicatedIpsPaginatorOptions is the paginator options for GetDedicatedIps +type GetDedicatedIpsPaginatorOptions struct { + // The number of results to show in a single call to GetDedicatedIpsRequest. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// GetDedicatedIpsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.GetDedicatedIps +type GetDedicatedIpsPaginator struct { + options GetDedicatedIpsPaginatorOptions + client GetDedicatedIpsAPIClient + params *GetDedicatedIpsInput + nextToken *string + firstPage bool +} + +// NewGetDedicatedIpsPaginator returns a new GetDedicatedIpsPaginator +func NewGetDedicatedIpsPaginator(client GetDedicatedIpsAPIClient, params *GetDedicatedIpsInput, optFns ...func(*GetDedicatedIpsPaginatorOptions)) *GetDedicatedIpsPaginator { + options := GetDedicatedIpsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetDedicatedIpsInput{} + } + + return &GetDedicatedIpsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetDedicatedIpsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetDedicatedIps page. +func (p *GetDedicatedIpsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDedicatedIpsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.GetDedicatedIps(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetDedicatedIps(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListConfigurationSets.go b/service/sesv2/api_op_ListConfigurationSets.go index b29972199f3..0c769b98fb1 100644 --- a/service/sesv2/api_op_ListConfigurationSets.go +++ b/service/sesv2/api_op_ListConfigurationSets.go @@ -4,6 +4,7 @@ package sesv2 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/awslabs/smithy-go/middleware" @@ -120,6 +121,91 @@ func addOperationListConfigurationSetsMiddlewares(stack *middleware.Stack, optio return nil } +// ListConfigurationSetsAPIClient is a client that implements the +// ListConfigurationSets operation. +type ListConfigurationSetsAPIClient interface { + ListConfigurationSets(context.Context, *ListConfigurationSetsInput, ...func(*Options)) (*ListConfigurationSetsOutput, error) +} + +var _ ListConfigurationSetsAPIClient = (*Client)(nil) + +// ListConfigurationSetsPaginatorOptions is the paginator options for +// ListConfigurationSets +type ListConfigurationSetsPaginatorOptions struct { + // The number of results to show in a single call to ListConfigurationSets. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// ListConfigurationSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListConfigurationSets +type ListConfigurationSetsPaginator struct { + options ListConfigurationSetsPaginatorOptions + client ListConfigurationSetsAPIClient + params *ListConfigurationSetsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationSetsPaginator returns a new ListConfigurationSetsPaginator +func NewListConfigurationSetsPaginator(client ListConfigurationSetsAPIClient, params *ListConfigurationSetsInput, optFns ...func(*ListConfigurationSetsPaginatorOptions)) *ListConfigurationSetsPaginator { + options := ListConfigurationSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListConfigurationSetsInput{} + } + + return &ListConfigurationSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListConfigurationSets page. +func (p *ListConfigurationSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListConfigurationSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListConfigurationSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListContactLists.go b/service/sesv2/api_op_ListContactLists.go index 854abc64bf1..c8057150694 100644 --- a/service/sesv2/api_op_ListContactLists.go +++ b/service/sesv2/api_op_ListContactLists.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -113,6 +114,90 @@ func addOperationListContactListsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListContactListsAPIClient is a client that implements the ListContactLists +// operation. +type ListContactListsAPIClient interface { + ListContactLists(context.Context, *ListContactListsInput, ...func(*Options)) (*ListContactListsOutput, error) +} + +var _ ListContactListsAPIClient = (*Client)(nil) + +// ListContactListsPaginatorOptions is the paginator options for ListContactLists +type ListContactListsPaginatorOptions struct { + // Maximum number of contact lists to return at once. Use this parameter to + // paginate results. If additional contact lists exist beyond the specified limit, + // the NextToken element is sent in the response. Use the NextToken value in + // subsequent requests to retrieve additional lists. + 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 +} + +// ListContactListsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListContactLists +type ListContactListsPaginator struct { + options ListContactListsPaginatorOptions + client ListContactListsAPIClient + params *ListContactListsInput + nextToken *string + firstPage bool +} + +// NewListContactListsPaginator returns a new ListContactListsPaginator +func NewListContactListsPaginator(client ListContactListsAPIClient, params *ListContactListsInput, optFns ...func(*ListContactListsPaginatorOptions)) *ListContactListsPaginator { + options := ListContactListsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactListsInput{} + } + + return &ListContactListsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactListsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContactLists page. +func (p *ListContactListsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactListsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListContactLists(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContactLists(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListContacts.go b/service/sesv2/api_op_ListContacts.go index baf7b2d8143..7848d06eadb 100644 --- a/service/sesv2/api_op_ListContacts.go +++ b/service/sesv2/api_op_ListContacts.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -124,6 +125,90 @@ func addOperationListContactsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListContactsAPIClient is a client that implements the ListContacts operation. +type ListContactsAPIClient interface { + ListContacts(context.Context, *ListContactsInput, ...func(*Options)) (*ListContactsOutput, error) +} + +var _ ListContactsAPIClient = (*Client)(nil) + +// ListContactsPaginatorOptions is the paginator options for ListContacts +type ListContactsPaginatorOptions struct { + // The number of contacts that may be returned at once, which is dependent on if + // there are more or less contacts than the value of the PageSize. Use this + // parameter to paginate results. If additional contacts exist beyond the specified + // limit, the NextToken element is sent in the response. Use the NextToken value in + // subsequent requests to retrieve additional contacts. + 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 +} + +// ListContactsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListContacts +type ListContactsPaginator struct { + options ListContactsPaginatorOptions + client ListContactsAPIClient + params *ListContactsInput + nextToken *string + firstPage bool +} + +// NewListContactsPaginator returns a new ListContactsPaginator +func NewListContactsPaginator(client ListContactsAPIClient, params *ListContactsInput, optFns ...func(*ListContactsPaginatorOptions)) *ListContactsPaginator { + options := ListContactsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListContactsInput{} + } + + return &ListContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListContactsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListContacts page. +func (p *ListContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListContacts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListContacts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go index 95540f9e7a0..5fd5bb099ac 100644 --- a/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go +++ b/service/sesv2/api_op_ListCustomVerificationEmailTemplates.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -121,6 +122,93 @@ func addOperationListCustomVerificationEmailTemplatesMiddlewares(stack *middlewa return nil } +// ListCustomVerificationEmailTemplatesAPIClient is a client that implements the +// ListCustomVerificationEmailTemplates operation. +type ListCustomVerificationEmailTemplatesAPIClient interface { + ListCustomVerificationEmailTemplates(context.Context, *ListCustomVerificationEmailTemplatesInput, ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) +} + +var _ ListCustomVerificationEmailTemplatesAPIClient = (*Client)(nil) + +// ListCustomVerificationEmailTemplatesPaginatorOptions is the paginator options +// for ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginatorOptions struct { + // The number of results to show in a single call to + // ListCustomVerificationEmailTemplates. If the number of results is larger than + // the number you specified in this parameter, then the response includes a + // NextToken element, which you can use to obtain additional results. The value you + // specify has to be at least 1, and can be no more than 50. + 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 +} + +// ListCustomVerificationEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListCustomVerificationEmailTemplates +type ListCustomVerificationEmailTemplatesPaginator struct { + options ListCustomVerificationEmailTemplatesPaginatorOptions + client ListCustomVerificationEmailTemplatesAPIClient + params *ListCustomVerificationEmailTemplatesInput + nextToken *string + firstPage bool +} + +// NewListCustomVerificationEmailTemplatesPaginator returns a new +// ListCustomVerificationEmailTemplatesPaginator +func NewListCustomVerificationEmailTemplatesPaginator(client ListCustomVerificationEmailTemplatesAPIClient, params *ListCustomVerificationEmailTemplatesInput, optFns ...func(*ListCustomVerificationEmailTemplatesPaginatorOptions)) *ListCustomVerificationEmailTemplatesPaginator { + options := ListCustomVerificationEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCustomVerificationEmailTemplatesInput{} + } + + return &ListCustomVerificationEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCustomVerificationEmailTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCustomVerificationEmailTemplates page. +func (p *ListCustomVerificationEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomVerificationEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListCustomVerificationEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCustomVerificationEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDedicatedIpPools.go b/service/sesv2/api_op_ListDedicatedIpPools.go index 8eed81c8473..ee89a20a6d1 100644 --- a/service/sesv2/api_op_ListDedicatedIpPools.go +++ b/service/sesv2/api_op_ListDedicatedIpPools.go @@ -4,6 +4,7 @@ package sesv2 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/awslabs/smithy-go/middleware" @@ -114,6 +115,91 @@ func addOperationListDedicatedIpPoolsMiddlewares(stack *middleware.Stack, option return nil } +// ListDedicatedIpPoolsAPIClient is a client that implements the +// ListDedicatedIpPools operation. +type ListDedicatedIpPoolsAPIClient interface { + ListDedicatedIpPools(context.Context, *ListDedicatedIpPoolsInput, ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) +} + +var _ ListDedicatedIpPoolsAPIClient = (*Client)(nil) + +// ListDedicatedIpPoolsPaginatorOptions is the paginator options for +// ListDedicatedIpPools +type ListDedicatedIpPoolsPaginatorOptions struct { + // The number of results to show in a single call to ListDedicatedIpPools. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// ListDedicatedIpPoolsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDedicatedIpPools +type ListDedicatedIpPoolsPaginator struct { + options ListDedicatedIpPoolsPaginatorOptions + client ListDedicatedIpPoolsAPIClient + params *ListDedicatedIpPoolsInput + nextToken *string + firstPage bool +} + +// NewListDedicatedIpPoolsPaginator returns a new ListDedicatedIpPoolsPaginator +func NewListDedicatedIpPoolsPaginator(client ListDedicatedIpPoolsAPIClient, params *ListDedicatedIpPoolsInput, optFns ...func(*ListDedicatedIpPoolsPaginatorOptions)) *ListDedicatedIpPoolsPaginator { + options := ListDedicatedIpPoolsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDedicatedIpPoolsInput{} + } + + return &ListDedicatedIpPoolsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDedicatedIpPoolsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDedicatedIpPools page. +func (p *ListDedicatedIpPoolsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDedicatedIpPoolsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDedicatedIpPools(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDedicatedIpPools(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDeliverabilityTestReports.go b/service/sesv2/api_op_ListDeliverabilityTestReports.go index eef56a41880..ef65cab8e52 100644 --- a/service/sesv2/api_op_ListDeliverabilityTestReports.go +++ b/service/sesv2/api_op_ListDeliverabilityTestReports.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -123,6 +124,93 @@ func addOperationListDeliverabilityTestReportsMiddlewares(stack *middleware.Stac return nil } +// ListDeliverabilityTestReportsAPIClient is a client that implements the +// ListDeliverabilityTestReports operation. +type ListDeliverabilityTestReportsAPIClient interface { + ListDeliverabilityTestReports(context.Context, *ListDeliverabilityTestReportsInput, ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) +} + +var _ ListDeliverabilityTestReportsAPIClient = (*Client)(nil) + +// ListDeliverabilityTestReportsPaginatorOptions is the paginator options for +// ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginatorOptions struct { + // The number of results to show in a single call to ListDeliverabilityTestReports. + // If the number of results is larger than the number you specified in this + // parameter, then the response includes a NextToken element, which you can use to + // obtain additional results. The value you specify has to be at least 0, and can + // be no more than 1000. + 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 +} + +// ListDeliverabilityTestReportsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDeliverabilityTestReports +type ListDeliverabilityTestReportsPaginator struct { + options ListDeliverabilityTestReportsPaginatorOptions + client ListDeliverabilityTestReportsAPIClient + params *ListDeliverabilityTestReportsInput + nextToken *string + firstPage bool +} + +// NewListDeliverabilityTestReportsPaginator returns a new +// ListDeliverabilityTestReportsPaginator +func NewListDeliverabilityTestReportsPaginator(client ListDeliverabilityTestReportsAPIClient, params *ListDeliverabilityTestReportsInput, optFns ...func(*ListDeliverabilityTestReportsPaginatorOptions)) *ListDeliverabilityTestReportsPaginator { + options := ListDeliverabilityTestReportsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeliverabilityTestReportsInput{} + } + + return &ListDeliverabilityTestReportsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeliverabilityTestReportsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeliverabilityTestReports page. +func (p *ListDeliverabilityTestReportsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeliverabilityTestReportsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDeliverabilityTestReports(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeliverabilityTestReports(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go b/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go index a05af38faab..9f1be4d981e 100644 --- a/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go +++ b/service/sesv2/api_op_ListDomainDeliverabilityCampaigns.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -146,6 +147,92 @@ func addOperationListDomainDeliverabilityCampaignsMiddlewares(stack *middleware. return nil } +// ListDomainDeliverabilityCampaignsAPIClient is a client that implements the +// ListDomainDeliverabilityCampaigns operation. +type ListDomainDeliverabilityCampaignsAPIClient interface { + ListDomainDeliverabilityCampaigns(context.Context, *ListDomainDeliverabilityCampaignsInput, ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) +} + +var _ ListDomainDeliverabilityCampaignsAPIClient = (*Client)(nil) + +// ListDomainDeliverabilityCampaignsPaginatorOptions is the paginator options for +// ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginatorOptions struct { + // The maximum number of results to include in response to a single call to the + // ListDomainDeliverabilityCampaigns operation. If the number of results is larger + // than the number that you specify in this parameter, the response includes a + // NextToken element, which you can use to obtain additional results. + 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 +} + +// ListDomainDeliverabilityCampaignsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListDomainDeliverabilityCampaigns +type ListDomainDeliverabilityCampaignsPaginator struct { + options ListDomainDeliverabilityCampaignsPaginatorOptions + client ListDomainDeliverabilityCampaignsAPIClient + params *ListDomainDeliverabilityCampaignsInput + nextToken *string + firstPage bool +} + +// NewListDomainDeliverabilityCampaignsPaginator returns a new +// ListDomainDeliverabilityCampaignsPaginator +func NewListDomainDeliverabilityCampaignsPaginator(client ListDomainDeliverabilityCampaignsAPIClient, params *ListDomainDeliverabilityCampaignsInput, optFns ...func(*ListDomainDeliverabilityCampaignsPaginatorOptions)) *ListDomainDeliverabilityCampaignsPaginator { + options := ListDomainDeliverabilityCampaignsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainDeliverabilityCampaignsInput{} + } + + return &ListDomainDeliverabilityCampaignsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainDeliverabilityCampaignsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomainDeliverabilityCampaigns page. +func (p *ListDomainDeliverabilityCampaignsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainDeliverabilityCampaignsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListDomainDeliverabilityCampaigns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomainDeliverabilityCampaigns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListEmailIdentities.go b/service/sesv2/api_op_ListEmailIdentities.go index ae61822c42e..a79b7370802 100644 --- a/service/sesv2/api_op_ListEmailIdentities.go +++ b/service/sesv2/api_op_ListEmailIdentities.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -123,6 +124,92 @@ func addOperationListEmailIdentitiesMiddlewares(stack *middleware.Stack, options return nil } +// ListEmailIdentitiesAPIClient is a client that implements the ListEmailIdentities +// operation. +type ListEmailIdentitiesAPIClient interface { + ListEmailIdentities(context.Context, *ListEmailIdentitiesInput, ...func(*Options)) (*ListEmailIdentitiesOutput, error) +} + +var _ ListEmailIdentitiesAPIClient = (*Client)(nil) + +// ListEmailIdentitiesPaginatorOptions is the paginator options for +// ListEmailIdentities +type ListEmailIdentitiesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailIdentities. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 0, and can be no + // more than 1000. + 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 +} + +// ListEmailIdentitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListEmailIdentities +type ListEmailIdentitiesPaginator struct { + options ListEmailIdentitiesPaginatorOptions + client ListEmailIdentitiesAPIClient + params *ListEmailIdentitiesInput + nextToken *string + firstPage bool +} + +// NewListEmailIdentitiesPaginator returns a new ListEmailIdentitiesPaginator +func NewListEmailIdentitiesPaginator(client ListEmailIdentitiesAPIClient, params *ListEmailIdentitiesInput, optFns ...func(*ListEmailIdentitiesPaginatorOptions)) *ListEmailIdentitiesPaginator { + options := ListEmailIdentitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailIdentitiesInput{} + } + + return &ListEmailIdentitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailIdentitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEmailIdentities page. +func (p *ListEmailIdentitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailIdentitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListEmailIdentities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailIdentities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListEmailTemplates.go b/service/sesv2/api_op_ListEmailTemplates.go index 559f33482d8..5640fb65f97 100644 --- a/service/sesv2/api_op_ListEmailTemplates.go +++ b/service/sesv2/api_op_ListEmailTemplates.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -119,6 +120,92 @@ func addOperationListEmailTemplatesMiddlewares(stack *middleware.Stack, options return nil } +// ListEmailTemplatesAPIClient is a client that implements the ListEmailTemplates +// operation. +type ListEmailTemplatesAPIClient interface { + ListEmailTemplates(context.Context, *ListEmailTemplatesInput, ...func(*Options)) (*ListEmailTemplatesOutput, error) +} + +var _ ListEmailTemplatesAPIClient = (*Client)(nil) + +// ListEmailTemplatesPaginatorOptions is the paginator options for +// ListEmailTemplates +type ListEmailTemplatesPaginatorOptions struct { + // The number of results to show in a single call to ListEmailTemplates. If the + // number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. The value you specify has to be at least 1, and can be no + // more than 10. + 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 +} + +// ListEmailTemplatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListEmailTemplates +type ListEmailTemplatesPaginator struct { + options ListEmailTemplatesPaginatorOptions + client ListEmailTemplatesAPIClient + params *ListEmailTemplatesInput + nextToken *string + firstPage bool +} + +// NewListEmailTemplatesPaginator returns a new ListEmailTemplatesPaginator +func NewListEmailTemplatesPaginator(client ListEmailTemplatesAPIClient, params *ListEmailTemplatesInput, optFns ...func(*ListEmailTemplatesPaginatorOptions)) *ListEmailTemplatesPaginator { + options := ListEmailTemplatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEmailTemplatesInput{} + } + + return &ListEmailTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailTemplatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEmailTemplates page. +func (p *ListEmailTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListEmailTemplates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEmailTemplates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListImportJobs.go b/service/sesv2/api_op_ListImportJobs.go index 2b291fcfd7a..94799244cc4 100644 --- a/service/sesv2/api_op_ListImportJobs.go +++ b/service/sesv2/api_op_ListImportJobs.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -120,6 +121,90 @@ func addOperationListImportJobsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListImportJobsAPIClient is a client that implements the ListImportJobs +// operation. +type ListImportJobsAPIClient interface { + ListImportJobs(context.Context, *ListImportJobsInput, ...func(*Options)) (*ListImportJobsOutput, error) +} + +var _ ListImportJobsAPIClient = (*Client)(nil) + +// ListImportJobsPaginatorOptions is the paginator options for ListImportJobs +type ListImportJobsPaginatorOptions struct { + // Maximum number of import jobs to return at once. Use this parameter to paginate + // results. If additional import jobs exist beyond the specified limit, the + // NextToken element is sent in the response. Use the NextToken value in subsequent + // requests to retrieve additional addresses. + 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 +} + +// ListImportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListImportJobs +type ListImportJobsPaginator struct { + options ListImportJobsPaginatorOptions + client ListImportJobsAPIClient + params *ListImportJobsInput + nextToken *string + firstPage bool +} + +// NewListImportJobsPaginator returns a new ListImportJobsPaginator +func NewListImportJobsPaginator(client ListImportJobsAPIClient, params *ListImportJobsInput, optFns ...func(*ListImportJobsPaginatorOptions)) *ListImportJobsPaginator { + options := ListImportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListImportJobsInput{} + } + + return &ListImportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListImportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListImportJobs page. +func (p *ListImportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListImportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListImportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListImportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/api_op_ListSuppressedDestinations.go b/service/sesv2/api_op_ListSuppressedDestinations.go index c4d951c9d97..cdbbe0e7638 100644 --- a/service/sesv2/api_op_ListSuppressedDestinations.go +++ b/service/sesv2/api_op_ListSuppressedDestinations.go @@ -4,6 +4,7 @@ package sesv2 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/sesv2/types" @@ -131,6 +132,92 @@ func addOperationListSuppressedDestinationsMiddlewares(stack *middleware.Stack, return nil } +// ListSuppressedDestinationsAPIClient is a client that implements the +// ListSuppressedDestinations operation. +type ListSuppressedDestinationsAPIClient interface { + ListSuppressedDestinations(context.Context, *ListSuppressedDestinationsInput, ...func(*Options)) (*ListSuppressedDestinationsOutput, error) +} + +var _ ListSuppressedDestinationsAPIClient = (*Client)(nil) + +// ListSuppressedDestinationsPaginatorOptions is the paginator options for +// ListSuppressedDestinations +type ListSuppressedDestinationsPaginatorOptions struct { + // The number of results to show in a single call to ListSuppressedDestinations. If + // the number of results is larger than the number you specified in this parameter, + // then the response includes a NextToken element, which you can use to obtain + // additional results. + 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 +} + +// ListSuppressedDestinationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sesv2.ListSuppressedDestinations +type ListSuppressedDestinationsPaginator struct { + options ListSuppressedDestinationsPaginatorOptions + client ListSuppressedDestinationsAPIClient + params *ListSuppressedDestinationsInput + nextToken *string + firstPage bool +} + +// NewListSuppressedDestinationsPaginator returns a new +// ListSuppressedDestinationsPaginator +func NewListSuppressedDestinationsPaginator(client ListSuppressedDestinationsAPIClient, params *ListSuppressedDestinationsInput, optFns ...func(*ListSuppressedDestinationsPaginatorOptions)) *ListSuppressedDestinationsPaginator { + options := ListSuppressedDestinationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuppressedDestinationsInput{} + } + + return &ListSuppressedDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuppressedDestinationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSuppressedDestinations page. +func (p *ListSuppressedDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuppressedDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.PageSize = &p.options.Limit + } + + result, err := p.client.ListSuppressedDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSuppressedDestinations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sesv2/endpoints.go b/service/sesv2/endpoints.go index b7a00c715a9..49d8a4fdbec 100644 --- a/service/sesv2/endpoints.go +++ b/service/sesv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sfn/api_op_GetExecutionHistory.go b/service/sfn/api_op_GetExecutionHistory.go index b1696a46c18..21aaf74cd04 100644 --- a/service/sfn/api_op_GetExecutionHistory.go +++ b/service/sfn/api_op_GetExecutionHistory.go @@ -4,6 +4,7 @@ package sfn 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/sfn/types" @@ -142,6 +143,92 @@ func addOperationGetExecutionHistoryMiddlewares(stack *middleware.Stack, options return nil } +// GetExecutionHistoryAPIClient is a client that implements the GetExecutionHistory +// operation. +type GetExecutionHistoryAPIClient interface { + GetExecutionHistory(context.Context, *GetExecutionHistoryInput, ...func(*Options)) (*GetExecutionHistoryOutput, error) +} + +var _ GetExecutionHistoryAPIClient = (*Client)(nil) + +// GetExecutionHistoryPaginatorOptions is the paginator options for +// GetExecutionHistory +type GetExecutionHistoryPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + 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 +} + +// GetExecutionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.GetExecutionHistory +type GetExecutionHistoryPaginator struct { + options GetExecutionHistoryPaginatorOptions + client GetExecutionHistoryAPIClient + params *GetExecutionHistoryInput + nextToken *string + firstPage bool +} + +// NewGetExecutionHistoryPaginator returns a new GetExecutionHistoryPaginator +func NewGetExecutionHistoryPaginator(client GetExecutionHistoryAPIClient, params *GetExecutionHistoryInput, optFns ...func(*GetExecutionHistoryPaginatorOptions)) *GetExecutionHistoryPaginator { + options := GetExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetExecutionHistoryInput{} + } + + return &GetExecutionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetExecutionHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetExecutionHistory page. +func (p *GetExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetExecutionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetExecutionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListActivities.go b/service/sfn/api_op_ListActivities.go index cb9692f2e7d..2aaf816f332 100644 --- a/service/sfn/api_op_ListActivities.go +++ b/service/sfn/api_op_ListActivities.go @@ -4,6 +4,7 @@ package sfn 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/sfn/types" @@ -125,6 +126,91 @@ func addOperationListActivitiesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListActivitiesAPIClient is a client that implements the ListActivities +// operation. +type ListActivitiesAPIClient interface { + ListActivities(context.Context, *ListActivitiesInput, ...func(*Options)) (*ListActivitiesOutput, error) +} + +var _ ListActivitiesAPIClient = (*Client)(nil) + +// ListActivitiesPaginatorOptions is the paginator options for ListActivities +type ListActivitiesPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + 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 +} + +// ListActivitiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListActivities +type ListActivitiesPaginator struct { + options ListActivitiesPaginatorOptions + client ListActivitiesAPIClient + params *ListActivitiesInput + nextToken *string + firstPage bool +} + +// NewListActivitiesPaginator returns a new ListActivitiesPaginator +func NewListActivitiesPaginator(client ListActivitiesAPIClient, params *ListActivitiesInput, optFns ...func(*ListActivitiesPaginatorOptions)) *ListActivitiesPaginator { + options := ListActivitiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActivitiesInput{} + } + + return &ListActivitiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActivitiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListActivities page. +func (p *ListActivitiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivitiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListActivities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActivities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListExecutions.go b/service/sfn/api_op_ListExecutions.go index 050b3c85416..507d96c8ed2 100644 --- a/service/sfn/api_op_ListExecutions.go +++ b/service/sfn/api_op_ListExecutions.go @@ -4,6 +4,7 @@ package sfn 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/sfn/types" @@ -139,6 +140,91 @@ func addOperationListExecutionsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListExecutionsAPIClient is a client that implements the ListExecutions +// operation. +type ListExecutionsAPIClient interface { + ListExecutions(context.Context, *ListExecutionsInput, ...func(*Options)) (*ListExecutionsOutput, error) +} + +var _ ListExecutionsAPIClient = (*Client)(nil) + +// ListExecutionsPaginatorOptions is the paginator options for ListExecutions +type ListExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + 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 +} + +// ListExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListExecutions +type ListExecutionsPaginator struct { + options ListExecutionsPaginatorOptions + client ListExecutionsAPIClient + params *ListExecutionsInput + nextToken *string + firstPage bool +} + +// NewListExecutionsPaginator returns a new ListExecutionsPaginator +func NewListExecutionsPaginator(client ListExecutionsAPIClient, params *ListExecutionsInput, optFns ...func(*ListExecutionsPaginatorOptions)) *ListExecutionsPaginator { + options := ListExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListExecutionsInput{} + } + + return &ListExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListExecutions page. +func (p *ListExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/api_op_ListStateMachines.go b/service/sfn/api_op_ListStateMachines.go index 752c17616c3..6583ee32383 100644 --- a/service/sfn/api_op_ListStateMachines.go +++ b/service/sfn/api_op_ListStateMachines.go @@ -4,6 +4,7 @@ package sfn 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/sfn/types" @@ -121,6 +122,91 @@ func addOperationListStateMachinesMiddlewares(stack *middleware.Stack, options O return nil } +// ListStateMachinesAPIClient is a client that implements the ListStateMachines +// operation. +type ListStateMachinesAPIClient interface { + ListStateMachines(context.Context, *ListStateMachinesInput, ...func(*Options)) (*ListStateMachinesOutput, error) +} + +var _ ListStateMachinesAPIClient = (*Client)(nil) + +// ListStateMachinesPaginatorOptions is the paginator options for ListStateMachines +type ListStateMachinesPaginatorOptions struct { + // The maximum number of results that are returned per call. You can use nextToken + // to obtain further pages of results. The default is 100 and the maximum allowed + // page size is 1000. A value of 0 uses the default. This is only an upper limit. + // The actual number of results returned per call might be fewer than the specified + // maximum. + 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 +} + +// ListStateMachinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sfn.ListStateMachines +type ListStateMachinesPaginator struct { + options ListStateMachinesPaginatorOptions + client ListStateMachinesAPIClient + params *ListStateMachinesInput + nextToken *string + firstPage bool +} + +// NewListStateMachinesPaginator returns a new ListStateMachinesPaginator +func NewListStateMachinesPaginator(client ListStateMachinesAPIClient, params *ListStateMachinesInput, optFns ...func(*ListStateMachinesPaginatorOptions)) *ListStateMachinesPaginator { + options := ListStateMachinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListStateMachinesInput{} + } + + return &ListStateMachinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStateMachinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListStateMachines page. +func (p *ListStateMachinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStateMachinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListStateMachines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListStateMachines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sfn/endpoints.go b/service/sfn/endpoints.go index 1bb87ad0403..fc2063ed3a6 100644 --- a/service/sfn/endpoints.go +++ b/service/sfn/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/shield/api_op_ListAttacks.go b/service/shield/api_op_ListAttacks.go index 84ccd1b9e99..d8fa305eb47 100644 --- a/service/shield/api_op_ListAttacks.go +++ b/service/shield/api_op_ListAttacks.go @@ -4,6 +4,7 @@ package shield 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/shield/types" @@ -135,6 +136,91 @@ func addOperationListAttacksMiddlewares(stack *middleware.Stack, options Options return nil } +// ListAttacksAPIClient is a client that implements the ListAttacks operation. +type ListAttacksAPIClient interface { + ListAttacks(context.Context, *ListAttacksInput, ...func(*Options)) (*ListAttacksOutput, error) +} + +var _ ListAttacksAPIClient = (*Client)(nil) + +// ListAttacksPaginatorOptions is the paginator options for ListAttacks +type ListAttacksPaginatorOptions struct { + // The maximum number of AttackSummary objects to be returned. If this is left + // blank, the first 20 results will be returned. This is a maximum value; it is + // possible that AWS WAF will return the results in smaller batches. That is, the + // number of AttackSummary objects returned could be less than MaxResults, even if + // there are still more AttackSummary objects yet to return. If there are more + // AttackSummary objects to return, AWS WAF will always also return a NextToken. + 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 +} + +// ListAttacksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/shield.ListAttacks +type ListAttacksPaginator struct { + options ListAttacksPaginatorOptions + client ListAttacksAPIClient + params *ListAttacksInput + nextToken *string + firstPage bool +} + +// NewListAttacksPaginator returns a new ListAttacksPaginator +func NewListAttacksPaginator(client ListAttacksAPIClient, params *ListAttacksInput, optFns ...func(*ListAttacksPaginatorOptions)) *ListAttacksPaginator { + options := ListAttacksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAttacksInput{} + } + + return &ListAttacksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAttacksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAttacks page. +func (p *ListAttacksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAttacksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAttacks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAttacks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/shield/api_op_ListProtections.go b/service/shield/api_op_ListProtections.go index 75811a88bd8..779e2e7f301 100644 --- a/service/shield/api_op_ListProtections.go +++ b/service/shield/api_op_ListProtections.go @@ -4,6 +4,7 @@ package shield 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/shield/types" @@ -118,6 +119,92 @@ func addOperationListProtectionsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListProtectionsAPIClient is a client that implements the ListProtections +// operation. +type ListProtectionsAPIClient interface { + ListProtections(context.Context, *ListProtectionsInput, ...func(*Options)) (*ListProtectionsOutput, error) +} + +var _ ListProtectionsAPIClient = (*Client)(nil) + +// ListProtectionsPaginatorOptions is the paginator options for ListProtections +type ListProtectionsPaginatorOptions struct { + // The maximum number of Protection objects to be returned. If this is left blank + // the first 20 results will be returned. This is a maximum value; it is possible + // that AWS WAF will return the results in smaller batches. That is, the number of + // Protection objects returned could be less than MaxResults, even if there are + // still more Protection objects yet to return. If there are more Protection + // objects to return, AWS WAF will always also return a NextToken. + 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 +} + +// ListProtectionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/shield.ListProtections +type ListProtectionsPaginator struct { + options ListProtectionsPaginatorOptions + client ListProtectionsAPIClient + params *ListProtectionsInput + nextToken *string + firstPage bool +} + +// NewListProtectionsPaginator returns a new ListProtectionsPaginator +func NewListProtectionsPaginator(client ListProtectionsAPIClient, params *ListProtectionsInput, optFns ...func(*ListProtectionsPaginatorOptions)) *ListProtectionsPaginator { + options := ListProtectionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListProtectionsInput{} + } + + return &ListProtectionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProtectionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListProtections page. +func (p *ListProtectionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProtectionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListProtections(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListProtections(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/shield/endpoints.go b/service/shield/endpoints.go index 31c5d354066..f0b479dbb3d 100644 --- a/service/shield/endpoints.go +++ b/service/shield/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/signer/api_op_ListSigningJobs.go b/service/signer/api_op_ListSigningJobs.go index bfa42e5beba..4b1a829d364 100644 --- a/service/signer/api_op_ListSigningJobs.go +++ b/service/signer/api_op_ListSigningJobs.go @@ -4,6 +4,7 @@ package signer 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/signer/types" @@ -127,6 +128,90 @@ func addOperationListSigningJobsMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListSigningJobsAPIClient is a client that implements the ListSigningJobs +// operation. +type ListSigningJobsAPIClient interface { + ListSigningJobs(context.Context, *ListSigningJobsInput, ...func(*Options)) (*ListSigningJobsOutput, error) +} + +var _ ListSigningJobsAPIClient = (*Client)(nil) + +// ListSigningJobsPaginatorOptions is the paginator options for ListSigningJobs +type ListSigningJobsPaginatorOptions struct { + // Specifies the maximum number of items to return in the response. Use this + // parameter when paginating results. If additional items exist beyond the number + // you specify, the nextToken element is set in the response. Use the nextToken + // value in a subsequent request to retrieve additional items. + 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 +} + +// ListSigningJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningJobs +type ListSigningJobsPaginator struct { + options ListSigningJobsPaginatorOptions + client ListSigningJobsAPIClient + params *ListSigningJobsInput + nextToken *string + firstPage bool +} + +// NewListSigningJobsPaginator returns a new ListSigningJobsPaginator +func NewListSigningJobsPaginator(client ListSigningJobsAPIClient, params *ListSigningJobsInput, optFns ...func(*ListSigningJobsPaginatorOptions)) *ListSigningJobsPaginator { + options := ListSigningJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningJobsInput{} + } + + return &ListSigningJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSigningJobs page. +func (p *ListSigningJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSigningJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/api_op_ListSigningPlatforms.go b/service/signer/api_op_ListSigningPlatforms.go index d69daa25888..03f2d8bfd01 100644 --- a/service/signer/api_op_ListSigningPlatforms.go +++ b/service/signer/api_op_ListSigningPlatforms.go @@ -4,6 +4,7 @@ package signer 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/signer/types" @@ -122,6 +123,88 @@ func addOperationListSigningPlatformsMiddlewares(stack *middleware.Stack, option return nil } +// ListSigningPlatformsAPIClient is a client that implements the +// ListSigningPlatforms operation. +type ListSigningPlatformsAPIClient interface { + ListSigningPlatforms(context.Context, *ListSigningPlatformsInput, ...func(*Options)) (*ListSigningPlatformsOutput, error) +} + +var _ ListSigningPlatformsAPIClient = (*Client)(nil) + +// ListSigningPlatformsPaginatorOptions is the paginator options for +// ListSigningPlatforms +type ListSigningPlatformsPaginatorOptions struct { + // The maximum number of results to be returned by this operation. + 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 +} + +// ListSigningPlatformsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningPlatforms +type ListSigningPlatformsPaginator struct { + options ListSigningPlatformsPaginatorOptions + client ListSigningPlatformsAPIClient + params *ListSigningPlatformsInput + nextToken *string + firstPage bool +} + +// NewListSigningPlatformsPaginator returns a new ListSigningPlatformsPaginator +func NewListSigningPlatformsPaginator(client ListSigningPlatformsAPIClient, params *ListSigningPlatformsInput, optFns ...func(*ListSigningPlatformsPaginatorOptions)) *ListSigningPlatformsPaginator { + options := ListSigningPlatformsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningPlatformsInput{} + } + + return &ListSigningPlatformsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningPlatformsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSigningPlatforms page. +func (p *ListSigningPlatformsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningPlatformsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSigningPlatforms(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningPlatforms(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/api_op_ListSigningProfiles.go b/service/signer/api_op_ListSigningProfiles.go index 940811828db..f33c568d3c7 100644 --- a/service/signer/api_op_ListSigningProfiles.go +++ b/service/signer/api_op_ListSigningProfiles.go @@ -4,6 +4,7 @@ package signer 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/signer/types" @@ -118,6 +119,88 @@ func addOperationListSigningProfilesMiddlewares(stack *middleware.Stack, options return nil } +// ListSigningProfilesAPIClient is a client that implements the ListSigningProfiles +// operation. +type ListSigningProfilesAPIClient interface { + ListSigningProfiles(context.Context, *ListSigningProfilesInput, ...func(*Options)) (*ListSigningProfilesOutput, error) +} + +var _ ListSigningProfilesAPIClient = (*Client)(nil) + +// ListSigningProfilesPaginatorOptions is the paginator options for +// ListSigningProfiles +type ListSigningProfilesPaginatorOptions struct { + // The maximum number of profiles to be returned. + 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 +} + +// ListSigningProfilesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/signer.ListSigningProfiles +type ListSigningProfilesPaginator struct { + options ListSigningProfilesPaginatorOptions + client ListSigningProfilesAPIClient + params *ListSigningProfilesInput + nextToken *string + firstPage bool +} + +// NewListSigningProfilesPaginator returns a new ListSigningProfilesPaginator +func NewListSigningProfilesPaginator(client ListSigningProfilesAPIClient, params *ListSigningProfilesInput, optFns ...func(*ListSigningProfilesPaginatorOptions)) *ListSigningProfilesPaginator { + options := ListSigningProfilesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSigningProfilesInput{} + } + + return &ListSigningProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSigningProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSigningProfiles page. +func (p *ListSigningProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSigningProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSigningProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSigningProfiles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/signer/endpoints.go b/service/signer/endpoints.go index 741b394883b..73c5d20f565 100644 --- a/service/signer/endpoints.go +++ b/service/signer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sms/api_op_GetConnectors.go b/service/sms/api_op_GetConnectors.go index 95886d5cc10..abfc651ae7f 100644 --- a/service/sms/api_op_GetConnectors.go +++ b/service/sms/api_op_GetConnectors.go @@ -4,6 +4,7 @@ package sms 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/sms/types" @@ -108,6 +109,88 @@ func addOperationGetConnectorsMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetConnectorsAPIClient is a client that implements the GetConnectors operation. +type GetConnectorsAPIClient interface { + GetConnectors(context.Context, *GetConnectorsInput, ...func(*Options)) (*GetConnectorsOutput, error) +} + +var _ GetConnectorsAPIClient = (*Client)(nil) + +// GetConnectorsPaginatorOptions is the paginator options for GetConnectors +type GetConnectorsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + 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 +} + +// GetConnectorsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetConnectors +type GetConnectorsPaginator struct { + options GetConnectorsPaginatorOptions + client GetConnectorsAPIClient + params *GetConnectorsInput + nextToken *string + firstPage bool +} + +// NewGetConnectorsPaginator returns a new GetConnectorsPaginator +func NewGetConnectorsPaginator(client GetConnectorsAPIClient, params *GetConnectorsInput, optFns ...func(*GetConnectorsPaginatorOptions)) *GetConnectorsPaginator { + options := GetConnectorsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetConnectorsInput{} + } + + return &GetConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetConnectorsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetConnectors page. +func (p *GetConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetConnectors(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetReplicationJobs.go b/service/sms/api_op_GetReplicationJobs.go index 82e1b5773c6..0c10d37a115 100644 --- a/service/sms/api_op_GetReplicationJobs.go +++ b/service/sms/api_op_GetReplicationJobs.go @@ -4,6 +4,7 @@ package sms 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/sms/types" @@ -111,6 +112,90 @@ func addOperationGetReplicationJobsMiddlewares(stack *middleware.Stack, options return nil } +// GetReplicationJobsAPIClient is a client that implements the GetReplicationJobs +// operation. +type GetReplicationJobsAPIClient interface { + GetReplicationJobs(context.Context, *GetReplicationJobsInput, ...func(*Options)) (*GetReplicationJobsOutput, error) +} + +var _ GetReplicationJobsAPIClient = (*Client)(nil) + +// GetReplicationJobsPaginatorOptions is the paginator options for +// GetReplicationJobs +type GetReplicationJobsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + 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 +} + +// GetReplicationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetReplicationJobs +type GetReplicationJobsPaginator struct { + options GetReplicationJobsPaginatorOptions + client GetReplicationJobsAPIClient + params *GetReplicationJobsInput + nextToken *string + firstPage bool +} + +// NewGetReplicationJobsPaginator returns a new GetReplicationJobsPaginator +func NewGetReplicationJobsPaginator(client GetReplicationJobsAPIClient, params *GetReplicationJobsInput, optFns ...func(*GetReplicationJobsPaginatorOptions)) *GetReplicationJobsPaginator { + options := GetReplicationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetReplicationJobsInput{} + } + + return &GetReplicationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetReplicationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetReplicationJobs page. +func (p *GetReplicationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetReplicationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetReplicationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetReplicationRuns.go b/service/sms/api_op_GetReplicationRuns.go index 3dadacf470d..66d5bc7272a 100644 --- a/service/sms/api_op_GetReplicationRuns.go +++ b/service/sms/api_op_GetReplicationRuns.go @@ -4,6 +4,7 @@ package sms 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/sms/types" @@ -119,6 +120,90 @@ func addOperationGetReplicationRunsMiddlewares(stack *middleware.Stack, options return nil } +// GetReplicationRunsAPIClient is a client that implements the GetReplicationRuns +// operation. +type GetReplicationRunsAPIClient interface { + GetReplicationRuns(context.Context, *GetReplicationRunsInput, ...func(*Options)) (*GetReplicationRunsOutput, error) +} + +var _ GetReplicationRunsAPIClient = (*Client)(nil) + +// GetReplicationRunsPaginatorOptions is the paginator options for +// GetReplicationRuns +type GetReplicationRunsPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + 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 +} + +// GetReplicationRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetReplicationRuns +type GetReplicationRunsPaginator struct { + options GetReplicationRunsPaginatorOptions + client GetReplicationRunsAPIClient + params *GetReplicationRunsInput + nextToken *string + firstPage bool +} + +// NewGetReplicationRunsPaginator returns a new GetReplicationRunsPaginator +func NewGetReplicationRunsPaginator(client GetReplicationRunsAPIClient, params *GetReplicationRunsInput, optFns ...func(*GetReplicationRunsPaginatorOptions)) *GetReplicationRunsPaginator { + options := GetReplicationRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetReplicationRunsInput{} + } + + return &GetReplicationRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetReplicationRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetReplicationRuns page. +func (p *GetReplicationRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReplicationRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetReplicationRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetReplicationRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/api_op_GetServers.go b/service/sms/api_op_GetServers.go index a6931c54299..63f73b4e1b0 100644 --- a/service/sms/api_op_GetServers.go +++ b/service/sms/api_op_GetServers.go @@ -4,6 +4,7 @@ package sms 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/sms/types" @@ -119,6 +120,88 @@ func addOperationGetServersMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetServersAPIClient is a client that implements the GetServers operation. +type GetServersAPIClient interface { + GetServers(context.Context, *GetServersInput, ...func(*Options)) (*GetServersOutput, error) +} + +var _ GetServersAPIClient = (*Client)(nil) + +// GetServersPaginatorOptions is the paginator options for GetServers +type GetServersPaginatorOptions struct { + // The maximum number of results to return in a single call. The default value is + // 50. To retrieve the remaining results, make another call with the returned + // NextToken value. + 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 +} + +// GetServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sms.GetServers +type GetServersPaginator struct { + options GetServersPaginatorOptions + client GetServersAPIClient + params *GetServersInput + nextToken *string + firstPage bool +} + +// NewGetServersPaginator returns a new GetServersPaginator +func NewGetServersPaginator(client GetServersAPIClient, params *GetServersInput, optFns ...func(*GetServersPaginatorOptions)) *GetServersPaginator { + options := GetServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetServersInput{} + } + + return &GetServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetServersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetServers page. +func (p *GetServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sms/endpoints.go b/service/sms/endpoints.go index c72ba1c942f..dca7cc79d89 100644 --- a/service/sms/endpoints.go +++ b/service/sms/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/snowball/api_op_DescribeAddresses.go b/service/snowball/api_op_DescribeAddresses.go index d1b3d5b3dc5..6bec3d081b4 100644 --- a/service/snowball/api_op_DescribeAddresses.go +++ b/service/snowball/api_op_DescribeAddresses.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" @@ -111,6 +112,87 @@ func addOperationDescribeAddressesMiddlewares(stack *middleware.Stack, options O return nil } +// DescribeAddressesAPIClient is a client that implements the DescribeAddresses +// operation. +type DescribeAddressesAPIClient interface { + DescribeAddresses(context.Context, *DescribeAddressesInput, ...func(*Options)) (*DescribeAddressesOutput, error) +} + +var _ DescribeAddressesAPIClient = (*Client)(nil) + +// DescribeAddressesPaginatorOptions is the paginator options for DescribeAddresses +type DescribeAddressesPaginatorOptions struct { + // The number of ADDRESS 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 +} + +// DescribeAddressesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/snowball.DescribeAddresses +type DescribeAddressesPaginator struct { + options DescribeAddressesPaginatorOptions + client DescribeAddressesAPIClient + params *DescribeAddressesInput + nextToken *string + firstPage bool +} + +// NewDescribeAddressesPaginator returns a new DescribeAddressesPaginator +func NewDescribeAddressesPaginator(client DescribeAddressesAPIClient, params *DescribeAddressesInput, optFns ...func(*DescribeAddressesPaginatorOptions)) *DescribeAddressesPaginator { + options := DescribeAddressesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAddressesInput{} + } + + return &DescribeAddressesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAddressesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAddresses page. +func (p *DescribeAddressesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAddressesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeAddresses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAddresses(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/api_op_ListJobs.go b/service/snowball/api_op_ListJobs.go index 6a6deacefbb..3409ec1946e 100644 --- a/service/snowball/api_op_ListJobs.go +++ b/service/snowball/api_op_ListJobs.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" @@ -114,6 +115,86 @@ func addOperationListJobsMiddlewares(stack *middleware.Stack, options Options) ( return nil } +// ListJobsAPIClient is a client that implements the ListJobs operation. +type ListJobsAPIClient interface { + ListJobs(context.Context, *ListJobsInput, ...func(*Options)) (*ListJobsOutput, error) +} + +var _ ListJobsAPIClient = (*Client)(nil) + +// ListJobsPaginatorOptions is the paginator options for ListJobs +type ListJobsPaginatorOptions 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 +} + +// ListJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/snowball.ListJobs +type ListJobsPaginator struct { + options ListJobsPaginatorOptions + client ListJobsAPIClient + params *ListJobsInput + nextToken *string + firstPage bool +} + +// NewListJobsPaginator returns a new ListJobsPaginator +func NewListJobsPaginator(client ListJobsAPIClient, params *ListJobsInput, optFns ...func(*ListJobsPaginatorOptions)) *ListJobsPaginator { + options := ListJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListJobsInput{} + } + + return &ListJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListJobs page. +func (p *ListJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/snowball/endpoints.go b/service/snowball/endpoints.go index 79d196bf881..f80732d1b5b 100644 --- a/service/snowball/endpoints.go +++ b/service/snowball/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sns/api_op_ListEndpointsByPlatformApplication.go b/service/sns/api_op_ListEndpointsByPlatformApplication.go index 9de802ab7f5..d04c8156ee6 100644 --- a/service/sns/api_op_ListEndpointsByPlatformApplication.go +++ b/service/sns/api_op_ListEndpointsByPlatformApplication.go @@ -4,6 +4,7 @@ package sns 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/sns/types" @@ -124,6 +125,82 @@ func addOperationListEndpointsByPlatformApplicationMiddlewares(stack *middleware return nil } +// ListEndpointsByPlatformApplicationAPIClient is a client that implements the +// ListEndpointsByPlatformApplication operation. +type ListEndpointsByPlatformApplicationAPIClient interface { + ListEndpointsByPlatformApplication(context.Context, *ListEndpointsByPlatformApplicationInput, ...func(*Options)) (*ListEndpointsByPlatformApplicationOutput, error) +} + +var _ ListEndpointsByPlatformApplicationAPIClient = (*Client)(nil) + +// ListEndpointsByPlatformApplicationPaginatorOptions is the paginator options for +// ListEndpointsByPlatformApplication +type ListEndpointsByPlatformApplicationPaginatorOptions struct { + // 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 +} + +// ListEndpointsByPlatformApplicationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListEndpointsByPlatformApplication +type ListEndpointsByPlatformApplicationPaginator struct { + options ListEndpointsByPlatformApplicationPaginatorOptions + client ListEndpointsByPlatformApplicationAPIClient + params *ListEndpointsByPlatformApplicationInput + nextToken *string + firstPage bool +} + +// NewListEndpointsByPlatformApplicationPaginator returns a new +// ListEndpointsByPlatformApplicationPaginator +func NewListEndpointsByPlatformApplicationPaginator(client ListEndpointsByPlatformApplicationAPIClient, params *ListEndpointsByPlatformApplicationInput, optFns ...func(*ListEndpointsByPlatformApplicationPaginatorOptions)) *ListEndpointsByPlatformApplicationPaginator { + options := ListEndpointsByPlatformApplicationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEndpointsByPlatformApplicationInput{} + } + + return &ListEndpointsByPlatformApplicationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointsByPlatformApplicationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEndpointsByPlatformApplication page. +func (p *ListEndpointsByPlatformApplicationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointsByPlatformApplicationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListEndpointsByPlatformApplication(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListEndpointsByPlatformApplication(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListPlatformApplications.go b/service/sns/api_op_ListPlatformApplications.go index c5d4674b7e9..ea76784cef4 100644 --- a/service/sns/api_op_ListPlatformApplications.go +++ b/service/sns/api_op_ListPlatformApplications.go @@ -4,6 +4,7 @@ package sns 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/sns/types" @@ -115,6 +116,82 @@ func addOperationListPlatformApplicationsMiddlewares(stack *middleware.Stack, op return nil } +// ListPlatformApplicationsAPIClient is a client that implements the +// ListPlatformApplications operation. +type ListPlatformApplicationsAPIClient interface { + ListPlatformApplications(context.Context, *ListPlatformApplicationsInput, ...func(*Options)) (*ListPlatformApplicationsOutput, error) +} + +var _ ListPlatformApplicationsAPIClient = (*Client)(nil) + +// ListPlatformApplicationsPaginatorOptions is the paginator options for +// ListPlatformApplications +type ListPlatformApplicationsPaginatorOptions struct { + // 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 +} + +// ListPlatformApplicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListPlatformApplications +type ListPlatformApplicationsPaginator struct { + options ListPlatformApplicationsPaginatorOptions + client ListPlatformApplicationsAPIClient + params *ListPlatformApplicationsInput + nextToken *string + firstPage bool +} + +// NewListPlatformApplicationsPaginator returns a new +// ListPlatformApplicationsPaginator +func NewListPlatformApplicationsPaginator(client ListPlatformApplicationsAPIClient, params *ListPlatformApplicationsInput, optFns ...func(*ListPlatformApplicationsPaginatorOptions)) *ListPlatformApplicationsPaginator { + options := ListPlatformApplicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPlatformApplicationsInput{} + } + + return &ListPlatformApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPlatformApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPlatformApplications page. +func (p *ListPlatformApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPlatformApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListPlatformApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPlatformApplications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListSubscriptions.go b/service/sns/api_op_ListSubscriptions.go index 5feeb1a0461..4e340881c63 100644 --- a/service/sns/api_op_ListSubscriptions.go +++ b/service/sns/api_op_ListSubscriptions.go @@ -4,6 +4,7 @@ package sns 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/sns/types" @@ -109,6 +110,80 @@ func addOperationListSubscriptionsMiddlewares(stack *middleware.Stack, options O return nil } +// ListSubscriptionsAPIClient is a client that implements the ListSubscriptions +// operation. +type ListSubscriptionsAPIClient interface { + ListSubscriptions(context.Context, *ListSubscriptionsInput, ...func(*Options)) (*ListSubscriptionsOutput, error) +} + +var _ ListSubscriptionsAPIClient = (*Client)(nil) + +// ListSubscriptionsPaginatorOptions is the paginator options for ListSubscriptions +type ListSubscriptionsPaginatorOptions struct { + // 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 +} + +// ListSubscriptionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListSubscriptions +type ListSubscriptionsPaginator struct { + options ListSubscriptionsPaginatorOptions + client ListSubscriptionsAPIClient + params *ListSubscriptionsInput + nextToken *string + firstPage bool +} + +// NewListSubscriptionsPaginator returns a new ListSubscriptionsPaginator +func NewListSubscriptionsPaginator(client ListSubscriptionsAPIClient, params *ListSubscriptionsInput, optFns ...func(*ListSubscriptionsPaginatorOptions)) *ListSubscriptionsPaginator { + options := ListSubscriptionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscriptionsInput{} + } + + return &ListSubscriptionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscriptionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSubscriptions page. +func (p *ListSubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscriptionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSubscriptions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListSubscriptionsByTopic.go b/service/sns/api_op_ListSubscriptionsByTopic.go index 6695800cd26..38f5db5d76d 100644 --- a/service/sns/api_op_ListSubscriptionsByTopic.go +++ b/service/sns/api_op_ListSubscriptionsByTopic.go @@ -4,6 +4,7 @@ package sns 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/sns/types" @@ -117,6 +118,82 @@ func addOperationListSubscriptionsByTopicMiddlewares(stack *middleware.Stack, op return nil } +// ListSubscriptionsByTopicAPIClient is a client that implements the +// ListSubscriptionsByTopic operation. +type ListSubscriptionsByTopicAPIClient interface { + ListSubscriptionsByTopic(context.Context, *ListSubscriptionsByTopicInput, ...func(*Options)) (*ListSubscriptionsByTopicOutput, error) +} + +var _ ListSubscriptionsByTopicAPIClient = (*Client)(nil) + +// ListSubscriptionsByTopicPaginatorOptions is the paginator options for +// ListSubscriptionsByTopic +type ListSubscriptionsByTopicPaginatorOptions struct { + // 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 +} + +// ListSubscriptionsByTopicPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListSubscriptionsByTopic +type ListSubscriptionsByTopicPaginator struct { + options ListSubscriptionsByTopicPaginatorOptions + client ListSubscriptionsByTopicAPIClient + params *ListSubscriptionsByTopicInput + nextToken *string + firstPage bool +} + +// NewListSubscriptionsByTopicPaginator returns a new +// ListSubscriptionsByTopicPaginator +func NewListSubscriptionsByTopicPaginator(client ListSubscriptionsByTopicAPIClient, params *ListSubscriptionsByTopicInput, optFns ...func(*ListSubscriptionsByTopicPaginatorOptions)) *ListSubscriptionsByTopicPaginator { + options := ListSubscriptionsByTopicPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSubscriptionsByTopicInput{} + } + + return &ListSubscriptionsByTopicPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSubscriptionsByTopicPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSubscriptionsByTopic page. +func (p *ListSubscriptionsByTopicPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscriptionsByTopicOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListSubscriptionsByTopic(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSubscriptionsByTopic(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/api_op_ListTopics.go b/service/sns/api_op_ListTopics.go index 6b9e9964f36..fa3bff62ffc 100644 --- a/service/sns/api_op_ListTopics.go +++ b/service/sns/api_op_ListTopics.go @@ -4,6 +4,7 @@ package sns 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/sns/types" @@ -107,6 +108,79 @@ func addOperationListTopicsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTopicsAPIClient is a client that implements the ListTopics operation. +type ListTopicsAPIClient interface { + ListTopics(context.Context, *ListTopicsInput, ...func(*Options)) (*ListTopicsOutput, error) +} + +var _ ListTopicsAPIClient = (*Client)(nil) + +// ListTopicsPaginatorOptions is the paginator options for ListTopics +type ListTopicsPaginatorOptions struct { + // 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 +} + +// ListTopicsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sns.ListTopics +type ListTopicsPaginator struct { + options ListTopicsPaginatorOptions + client ListTopicsAPIClient + params *ListTopicsInput + nextToken *string + firstPage bool +} + +// NewListTopicsPaginator returns a new ListTopicsPaginator +func NewListTopicsPaginator(client ListTopicsAPIClient, params *ListTopicsInput, optFns ...func(*ListTopicsPaginatorOptions)) *ListTopicsPaginator { + options := ListTopicsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTopicsInput{} + } + + return &ListTopicsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTopicsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTopics page. +func (p *ListTopicsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTopicsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTopics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTopics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sns/endpoints.go b/service/sns/endpoints.go index 19ff9f2d5b2..f32ccc0949c 100644 --- a/service/sns/endpoints.go +++ b/service/sns/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sqs/api_op_ListDeadLetterSourceQueues.go b/service/sqs/api_op_ListDeadLetterSourceQueues.go index 7580fe87148..353cc7c25e8 100644 --- a/service/sqs/api_op_ListDeadLetterSourceQueues.go +++ b/service/sqs/api_op_ListDeadLetterSourceQueues.go @@ -4,6 +4,7 @@ package sqs 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/awslabs/smithy-go/middleware" @@ -131,6 +132,90 @@ func addOperationListDeadLetterSourceQueuesMiddlewares(stack *middleware.Stack, return nil } +// ListDeadLetterSourceQueuesAPIClient is a client that implements the +// ListDeadLetterSourceQueues operation. +type ListDeadLetterSourceQueuesAPIClient interface { + ListDeadLetterSourceQueues(context.Context, *ListDeadLetterSourceQueuesInput, ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) +} + +var _ ListDeadLetterSourceQueuesAPIClient = (*Client)(nil) + +// ListDeadLetterSourceQueuesPaginatorOptions is the paginator options for +// ListDeadLetterSourceQueues +type ListDeadLetterSourceQueuesPaginatorOptions struct { + // Maximum number of results to include in the response. Value range is 1 to 1000. + // You must set MaxResults to receive a value for NextToken in the response. + 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 +} + +// ListDeadLetterSourceQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sqs.ListDeadLetterSourceQueues +type ListDeadLetterSourceQueuesPaginator struct { + options ListDeadLetterSourceQueuesPaginatorOptions + client ListDeadLetterSourceQueuesAPIClient + params *ListDeadLetterSourceQueuesInput + nextToken *string + firstPage bool +} + +// NewListDeadLetterSourceQueuesPaginator returns a new +// ListDeadLetterSourceQueuesPaginator +func NewListDeadLetterSourceQueuesPaginator(client ListDeadLetterSourceQueuesAPIClient, params *ListDeadLetterSourceQueuesInput, optFns ...func(*ListDeadLetterSourceQueuesPaginatorOptions)) *ListDeadLetterSourceQueuesPaginator { + options := ListDeadLetterSourceQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeadLetterSourceQueuesInput{} + } + + return &ListDeadLetterSourceQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeadLetterSourceQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeadLetterSourceQueues page. +func (p *ListDeadLetterSourceQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeadLetterSourceQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDeadLetterSourceQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDeadLetterSourceQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sqs/api_op_ListQueues.go b/service/sqs/api_op_ListQueues.go index e6ac6a8022b..d7be782e92a 100644 --- a/service/sqs/api_op_ListQueues.go +++ b/service/sqs/api_op_ListQueues.go @@ -4,6 +4,7 @@ package sqs 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/awslabs/smithy-go/middleware" @@ -127,6 +128,87 @@ func addOperationListQueuesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListQueuesAPIClient is a client that implements the ListQueues operation. +type ListQueuesAPIClient interface { + ListQueues(context.Context, *ListQueuesInput, ...func(*Options)) (*ListQueuesOutput, error) +} + +var _ ListQueuesAPIClient = (*Client)(nil) + +// ListQueuesPaginatorOptions is the paginator options for ListQueues +type ListQueuesPaginatorOptions struct { + // Maximum number of results to include in the response. Value range is 1 to 1000. + // You must set MaxResults to receive a value for NextToken in the response. + 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 +} + +// ListQueuesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sqs.ListQueues +type ListQueuesPaginator struct { + options ListQueuesPaginatorOptions + client ListQueuesAPIClient + params *ListQueuesInput + nextToken *string + firstPage bool +} + +// NewListQueuesPaginator returns a new ListQueuesPaginator +func NewListQueuesPaginator(client ListQueuesAPIClient, params *ListQueuesInput, optFns ...func(*ListQueuesPaginatorOptions)) *ListQueuesPaginator { + options := ListQueuesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQueuesInput{} + } + + return &ListQueuesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQueuesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQueues page. +func (p *ListQueuesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQueuesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListQueues(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListQueues(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sqs/endpoints.go b/service/sqs/endpoints.go index 2377d94bbc9..f81fa3981d7 100644 --- a/service/sqs/endpoints.go +++ b/service/sqs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ssm/api_op_DescribeActivations.go b/service/ssm/api_op_DescribeActivations.go index f831feba19c..a294e48fbdf 100644 --- a/service/ssm/api_op_DescribeActivations.go +++ b/service/ssm/api_op_DescribeActivations.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -112,6 +113,89 @@ func addOperationDescribeActivationsMiddlewares(stack *middleware.Stack, options return nil } +// DescribeActivationsAPIClient is a client that implements the DescribeActivations +// operation. +type DescribeActivationsAPIClient interface { + DescribeActivations(context.Context, *DescribeActivationsInput, ...func(*Options)) (*DescribeActivationsOutput, error) +} + +var _ DescribeActivationsAPIClient = (*Client)(nil) + +// DescribeActivationsPaginatorOptions is the paginator options for +// DescribeActivations +type DescribeActivationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeActivationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeActivations +type DescribeActivationsPaginator struct { + options DescribeActivationsPaginatorOptions + client DescribeActivationsAPIClient + params *DescribeActivationsInput + nextToken *string + firstPage bool +} + +// NewDescribeActivationsPaginator returns a new DescribeActivationsPaginator +func NewDescribeActivationsPaginator(client DescribeActivationsAPIClient, params *DescribeActivationsInput, optFns ...func(*DescribeActivationsPaginatorOptions)) *DescribeActivationsPaginator { + options := DescribeActivationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeActivationsInput{} + } + + return &DescribeActivationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeActivationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeActivations page. +func (p *DescribeActivationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeActivationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeActivations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeActivations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAssociationExecutionTargets.go b/service/ssm/api_op_DescribeAssociationExecutionTargets.go index 85e77fc4351..1f83fdfddc4 100644 --- a/service/ssm/api_op_DescribeAssociationExecutionTargets.go +++ b/service/ssm/api_op_DescribeAssociationExecutionTargets.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -126,6 +127,90 @@ func addOperationDescribeAssociationExecutionTargetsMiddlewares(stack *middlewar return nil } +// DescribeAssociationExecutionTargetsAPIClient is a client that implements the +// DescribeAssociationExecutionTargets operation. +type DescribeAssociationExecutionTargetsAPIClient interface { + DescribeAssociationExecutionTargets(context.Context, *DescribeAssociationExecutionTargetsInput, ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) +} + +var _ DescribeAssociationExecutionTargetsAPIClient = (*Client)(nil) + +// DescribeAssociationExecutionTargetsPaginatorOptions is the paginator options for +// DescribeAssociationExecutionTargets +type DescribeAssociationExecutionTargetsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeAssociationExecutionTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAssociationExecutionTargets +type DescribeAssociationExecutionTargetsPaginator struct { + options DescribeAssociationExecutionTargetsPaginatorOptions + client DescribeAssociationExecutionTargetsAPIClient + params *DescribeAssociationExecutionTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeAssociationExecutionTargetsPaginator returns a new +// DescribeAssociationExecutionTargetsPaginator +func NewDescribeAssociationExecutionTargetsPaginator(client DescribeAssociationExecutionTargetsAPIClient, params *DescribeAssociationExecutionTargetsInput, optFns ...func(*DescribeAssociationExecutionTargetsPaginatorOptions)) *DescribeAssociationExecutionTargetsPaginator { + options := DescribeAssociationExecutionTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAssociationExecutionTargetsInput{} + } + + return &DescribeAssociationExecutionTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAssociationExecutionTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAssociationExecutionTargets page. +func (p *DescribeAssociationExecutionTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAssociationExecutionTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAssociationExecutionTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAssociationExecutions.go b/service/ssm/api_op_DescribeAssociationExecutions.go index 136777270b4..8acdb83d9ed 100644 --- a/service/ssm/api_op_DescribeAssociationExecutions.go +++ b/service/ssm/api_op_DescribeAssociationExecutions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -119,6 +120,90 @@ func addOperationDescribeAssociationExecutionsMiddlewares(stack *middleware.Stac return nil } +// DescribeAssociationExecutionsAPIClient is a client that implements the +// DescribeAssociationExecutions operation. +type DescribeAssociationExecutionsAPIClient interface { + DescribeAssociationExecutions(context.Context, *DescribeAssociationExecutionsInput, ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) +} + +var _ DescribeAssociationExecutionsAPIClient = (*Client)(nil) + +// DescribeAssociationExecutionsPaginatorOptions is the paginator options for +// DescribeAssociationExecutions +type DescribeAssociationExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeAssociationExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAssociationExecutions +type DescribeAssociationExecutionsPaginator struct { + options DescribeAssociationExecutionsPaginatorOptions + client DescribeAssociationExecutionsAPIClient + params *DescribeAssociationExecutionsInput + nextToken *string + firstPage bool +} + +// NewDescribeAssociationExecutionsPaginator returns a new +// DescribeAssociationExecutionsPaginator +func NewDescribeAssociationExecutionsPaginator(client DescribeAssociationExecutionsAPIClient, params *DescribeAssociationExecutionsInput, optFns ...func(*DescribeAssociationExecutionsPaginatorOptions)) *DescribeAssociationExecutionsPaginator { + options := DescribeAssociationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAssociationExecutionsInput{} + } + + return &DescribeAssociationExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAssociationExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAssociationExecutions page. +func (p *DescribeAssociationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAssociationExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAssociationExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAssociationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAutomationExecutions.go b/service/ssm/api_op_DescribeAutomationExecutions.go index 62dc34fe87d..50e0bcf7219 100644 --- a/service/ssm/api_op_DescribeAutomationExecutions.go +++ b/service/ssm/api_op_DescribeAutomationExecutions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -115,6 +116,90 @@ func addOperationDescribeAutomationExecutionsMiddlewares(stack *middleware.Stack return nil } +// DescribeAutomationExecutionsAPIClient is a client that implements the +// DescribeAutomationExecutions operation. +type DescribeAutomationExecutionsAPIClient interface { + DescribeAutomationExecutions(context.Context, *DescribeAutomationExecutionsInput, ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) +} + +var _ DescribeAutomationExecutionsAPIClient = (*Client)(nil) + +// DescribeAutomationExecutionsPaginatorOptions is the paginator options for +// DescribeAutomationExecutions +type DescribeAutomationExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeAutomationExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAutomationExecutions +type DescribeAutomationExecutionsPaginator struct { + options DescribeAutomationExecutionsPaginatorOptions + client DescribeAutomationExecutionsAPIClient + params *DescribeAutomationExecutionsInput + nextToken *string + firstPage bool +} + +// NewDescribeAutomationExecutionsPaginator returns a new +// DescribeAutomationExecutionsPaginator +func NewDescribeAutomationExecutionsPaginator(client DescribeAutomationExecutionsAPIClient, params *DescribeAutomationExecutionsInput, optFns ...func(*DescribeAutomationExecutionsPaginatorOptions)) *DescribeAutomationExecutionsPaginator { + options := DescribeAutomationExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutomationExecutionsInput{} + } + + return &DescribeAutomationExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutomationExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAutomationExecutions page. +func (p *DescribeAutomationExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAutomationExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutomationExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAutomationStepExecutions.go b/service/ssm/api_op_DescribeAutomationStepExecutions.go index f3e7fd0e208..1d9946187e0 100644 --- a/service/ssm/api_op_DescribeAutomationStepExecutions.go +++ b/service/ssm/api_op_DescribeAutomationStepExecutions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -126,6 +127,90 @@ func addOperationDescribeAutomationStepExecutionsMiddlewares(stack *middleware.S return nil } +// DescribeAutomationStepExecutionsAPIClient is a client that implements the +// DescribeAutomationStepExecutions operation. +type DescribeAutomationStepExecutionsAPIClient interface { + DescribeAutomationStepExecutions(context.Context, *DescribeAutomationStepExecutionsInput, ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) +} + +var _ DescribeAutomationStepExecutionsAPIClient = (*Client)(nil) + +// DescribeAutomationStepExecutionsPaginatorOptions is the paginator options for +// DescribeAutomationStepExecutions +type DescribeAutomationStepExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeAutomationStepExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAutomationStepExecutions +type DescribeAutomationStepExecutionsPaginator struct { + options DescribeAutomationStepExecutionsPaginatorOptions + client DescribeAutomationStepExecutionsAPIClient + params *DescribeAutomationStepExecutionsInput + nextToken *string + firstPage bool +} + +// NewDescribeAutomationStepExecutionsPaginator returns a new +// DescribeAutomationStepExecutionsPaginator +func NewDescribeAutomationStepExecutionsPaginator(client DescribeAutomationStepExecutionsAPIClient, params *DescribeAutomationStepExecutionsInput, optFns ...func(*DescribeAutomationStepExecutionsPaginatorOptions)) *DescribeAutomationStepExecutionsPaginator { + options := DescribeAutomationStepExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAutomationStepExecutionsInput{} + } + + return &DescribeAutomationStepExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAutomationStepExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAutomationStepExecutions page. +func (p *DescribeAutomationStepExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAutomationStepExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAutomationStepExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAutomationStepExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeAvailablePatches.go b/service/ssm/api_op_DescribeAvailablePatches.go index e2d2503c523..7db6773f489 100644 --- a/service/ssm/api_op_DescribeAvailablePatches.go +++ b/service/ssm/api_op_DescribeAvailablePatches.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -110,6 +111,89 @@ func addOperationDescribeAvailablePatchesMiddlewares(stack *middleware.Stack, op return nil } +// DescribeAvailablePatchesAPIClient is a client that implements the +// DescribeAvailablePatches operation. +type DescribeAvailablePatchesAPIClient interface { + DescribeAvailablePatches(context.Context, *DescribeAvailablePatchesInput, ...func(*Options)) (*DescribeAvailablePatchesOutput, error) +} + +var _ DescribeAvailablePatchesAPIClient = (*Client)(nil) + +// DescribeAvailablePatchesPaginatorOptions is the paginator options for +// DescribeAvailablePatches +type DescribeAvailablePatchesPaginatorOptions struct { + // The maximum number of patches to return (per page). + 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 +} + +// DescribeAvailablePatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeAvailablePatches +type DescribeAvailablePatchesPaginator struct { + options DescribeAvailablePatchesPaginatorOptions + client DescribeAvailablePatchesAPIClient + params *DescribeAvailablePatchesInput + nextToken *string + firstPage bool +} + +// NewDescribeAvailablePatchesPaginator returns a new +// DescribeAvailablePatchesPaginator +func NewDescribeAvailablePatchesPaginator(client DescribeAvailablePatchesAPIClient, params *DescribeAvailablePatchesInput, optFns ...func(*DescribeAvailablePatchesPaginatorOptions)) *DescribeAvailablePatchesPaginator { + options := DescribeAvailablePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeAvailablePatchesInput{} + } + + return &DescribeAvailablePatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeAvailablePatchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeAvailablePatches page. +func (p *DescribeAvailablePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeAvailablePatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeAvailablePatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeAvailablePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go b/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go index d5750f4ad8d..8bb2d5196ae 100644 --- a/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go +++ b/service/ssm/api_op_DescribeEffectiveInstanceAssociations.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -116,6 +117,90 @@ func addOperationDescribeEffectiveInstanceAssociationsMiddlewares(stack *middlew return nil } +// DescribeEffectiveInstanceAssociationsAPIClient is a client that implements the +// DescribeEffectiveInstanceAssociations operation. +type DescribeEffectiveInstanceAssociationsAPIClient interface { + DescribeEffectiveInstanceAssociations(context.Context, *DescribeEffectiveInstanceAssociationsInput, ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) +} + +var _ DescribeEffectiveInstanceAssociationsAPIClient = (*Client)(nil) + +// DescribeEffectiveInstanceAssociationsPaginatorOptions is the paginator options +// for DescribeEffectiveInstanceAssociations +type DescribeEffectiveInstanceAssociationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeEffectiveInstanceAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeEffectiveInstanceAssociations +type DescribeEffectiveInstanceAssociationsPaginator struct { + options DescribeEffectiveInstanceAssociationsPaginatorOptions + client DescribeEffectiveInstanceAssociationsAPIClient + params *DescribeEffectiveInstanceAssociationsInput + nextToken *string + firstPage bool +} + +// NewDescribeEffectiveInstanceAssociationsPaginator returns a new +// DescribeEffectiveInstanceAssociationsPaginator +func NewDescribeEffectiveInstanceAssociationsPaginator(client DescribeEffectiveInstanceAssociationsAPIClient, params *DescribeEffectiveInstanceAssociationsInput, optFns ...func(*DescribeEffectiveInstanceAssociationsPaginatorOptions)) *DescribeEffectiveInstanceAssociationsPaginator { + options := DescribeEffectiveInstanceAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEffectiveInstanceAssociationsInput{} + } + + return &DescribeEffectiveInstanceAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEffectiveInstanceAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEffectiveInstanceAssociations page. +func (p *DescribeEffectiveInstanceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectiveInstanceAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeEffectiveInstanceAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEffectiveInstanceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go b/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go index f629579cfe4..81303efe678 100644 --- a/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go +++ b/service/ssm/api_op_DescribeEffectivePatchesForPatchBaseline.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -117,6 +118,89 @@ func addOperationDescribeEffectivePatchesForPatchBaselineMiddlewares(stack *midd return nil } +// DescribeEffectivePatchesForPatchBaselineAPIClient is a client that implements +// the DescribeEffectivePatchesForPatchBaseline operation. +type DescribeEffectivePatchesForPatchBaselineAPIClient interface { + DescribeEffectivePatchesForPatchBaseline(context.Context, *DescribeEffectivePatchesForPatchBaselineInput, ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) +} + +var _ DescribeEffectivePatchesForPatchBaselineAPIClient = (*Client)(nil) + +// DescribeEffectivePatchesForPatchBaselinePaginatorOptions is the paginator +// options for DescribeEffectivePatchesForPatchBaseline +type DescribeEffectivePatchesForPatchBaselinePaginatorOptions struct { + // The maximum number of patches to return (per page). + 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 +} + +// DescribeEffectivePatchesForPatchBaselinePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeEffectivePatchesForPatchBaseline +type DescribeEffectivePatchesForPatchBaselinePaginator struct { + options DescribeEffectivePatchesForPatchBaselinePaginatorOptions + client DescribeEffectivePatchesForPatchBaselineAPIClient + params *DescribeEffectivePatchesForPatchBaselineInput + nextToken *string + firstPage bool +} + +// NewDescribeEffectivePatchesForPatchBaselinePaginator returns a new +// DescribeEffectivePatchesForPatchBaselinePaginator +func NewDescribeEffectivePatchesForPatchBaselinePaginator(client DescribeEffectivePatchesForPatchBaselineAPIClient, params *DescribeEffectivePatchesForPatchBaselineInput, optFns ...func(*DescribeEffectivePatchesForPatchBaselinePaginatorOptions)) *DescribeEffectivePatchesForPatchBaselinePaginator { + options := DescribeEffectivePatchesForPatchBaselinePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeEffectivePatchesForPatchBaselineInput{} + } + + return &DescribeEffectivePatchesForPatchBaselinePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeEffectivePatchesForPatchBaselinePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeEffectivePatchesForPatchBaseline page. +func (p *DescribeEffectivePatchesForPatchBaselinePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeEffectivePatchesForPatchBaselineOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeEffectivePatchesForPatchBaseline(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeEffectivePatchesForPatchBaseline(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstanceAssociationsStatus.go b/service/ssm/api_op_DescribeInstanceAssociationsStatus.go index 25e09833641..63871527dfe 100644 --- a/service/ssm/api_op_DescribeInstanceAssociationsStatus.go +++ b/service/ssm/api_op_DescribeInstanceAssociationsStatus.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -116,6 +117,90 @@ func addOperationDescribeInstanceAssociationsStatusMiddlewares(stack *middleware return nil } +// DescribeInstanceAssociationsStatusAPIClient is a client that implements the +// DescribeInstanceAssociationsStatus operation. +type DescribeInstanceAssociationsStatusAPIClient interface { + DescribeInstanceAssociationsStatus(context.Context, *DescribeInstanceAssociationsStatusInput, ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) +} + +var _ DescribeInstanceAssociationsStatusAPIClient = (*Client)(nil) + +// DescribeInstanceAssociationsStatusPaginatorOptions is the paginator options for +// DescribeInstanceAssociationsStatus +type DescribeInstanceAssociationsStatusPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeInstanceAssociationsStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstanceAssociationsStatus +type DescribeInstanceAssociationsStatusPaginator struct { + options DescribeInstanceAssociationsStatusPaginatorOptions + client DescribeInstanceAssociationsStatusAPIClient + params *DescribeInstanceAssociationsStatusInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceAssociationsStatusPaginator returns a new +// DescribeInstanceAssociationsStatusPaginator +func NewDescribeInstanceAssociationsStatusPaginator(client DescribeInstanceAssociationsStatusAPIClient, params *DescribeInstanceAssociationsStatusInput, optFns ...func(*DescribeInstanceAssociationsStatusPaginatorOptions)) *DescribeInstanceAssociationsStatusPaginator { + options := DescribeInstanceAssociationsStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceAssociationsStatusInput{} + } + + return &DescribeInstanceAssociationsStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceAssociationsStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceAssociationsStatus page. +func (p *DescribeInstanceAssociationsStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceAssociationsStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstanceAssociationsStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceAssociationsStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstanceInformation.go b/service/ssm/api_op_DescribeInstanceInformation.go index 134e3d5d89d..e7609958181 100644 --- a/service/ssm/api_op_DescribeInstanceInformation.go +++ b/service/ssm/api_op_DescribeInstanceInformation.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -130,6 +131,90 @@ func addOperationDescribeInstanceInformationMiddlewares(stack *middleware.Stack, return nil } +// DescribeInstanceInformationAPIClient is a client that implements the +// DescribeInstanceInformation operation. +type DescribeInstanceInformationAPIClient interface { + DescribeInstanceInformation(context.Context, *DescribeInstanceInformationInput, ...func(*Options)) (*DescribeInstanceInformationOutput, error) +} + +var _ DescribeInstanceInformationAPIClient = (*Client)(nil) + +// DescribeInstanceInformationPaginatorOptions is the paginator options for +// DescribeInstanceInformation +type DescribeInstanceInformationPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeInstanceInformationPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstanceInformation +type DescribeInstanceInformationPaginator struct { + options DescribeInstanceInformationPaginatorOptions + client DescribeInstanceInformationAPIClient + params *DescribeInstanceInformationInput + nextToken *string + firstPage bool +} + +// NewDescribeInstanceInformationPaginator returns a new +// DescribeInstanceInformationPaginator +func NewDescribeInstanceInformationPaginator(client DescribeInstanceInformationAPIClient, params *DescribeInstanceInformationInput, optFns ...func(*DescribeInstanceInformationPaginatorOptions)) *DescribeInstanceInformationPaginator { + options := DescribeInstanceInformationPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstanceInformationInput{} + } + + return &DescribeInstanceInformationPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstanceInformationPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstanceInformation page. +func (p *DescribeInstanceInformationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstanceInformationOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstanceInformation(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstanceInformation(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatchStates.go b/service/ssm/api_op_DescribeInstancePatchStates.go index 40e71612938..8e5d8a66309 100644 --- a/service/ssm/api_op_DescribeInstancePatchStates.go +++ b/service/ssm/api_op_DescribeInstancePatchStates.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -115,6 +116,89 @@ func addOperationDescribeInstancePatchStatesMiddlewares(stack *middleware.Stack, return nil } +// DescribeInstancePatchStatesAPIClient is a client that implements the +// DescribeInstancePatchStates operation. +type DescribeInstancePatchStatesAPIClient interface { + DescribeInstancePatchStates(context.Context, *DescribeInstancePatchStatesInput, ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) +} + +var _ DescribeInstancePatchStatesAPIClient = (*Client)(nil) + +// DescribeInstancePatchStatesPaginatorOptions is the paginator options for +// DescribeInstancePatchStates +type DescribeInstancePatchStatesPaginatorOptions struct { + // The maximum number of instances to return (per page). + 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 +} + +// DescribeInstancePatchStatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatchStates +type DescribeInstancePatchStatesPaginator struct { + options DescribeInstancePatchStatesPaginatorOptions + client DescribeInstancePatchStatesAPIClient + params *DescribeInstancePatchStatesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstancePatchStatesPaginator returns a new +// DescribeInstancePatchStatesPaginator +func NewDescribeInstancePatchStatesPaginator(client DescribeInstancePatchStatesAPIClient, params *DescribeInstancePatchStatesInput, optFns ...func(*DescribeInstancePatchStatesPaginatorOptions)) *DescribeInstancePatchStatesPaginator { + options := DescribeInstancePatchStatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchStatesInput{} + } + + return &DescribeInstancePatchStatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchStatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstancePatchStates page. +func (p *DescribeInstancePatchStatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstancePatchStates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatchStates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go b/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go index a326f07969a..06fed811519 100644 --- a/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go +++ b/service/ssm/api_op_DescribeInstancePatchStatesForPatchGroup.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -122,6 +123,89 @@ func addOperationDescribeInstancePatchStatesForPatchGroupMiddlewares(stack *midd return nil } +// DescribeInstancePatchStatesForPatchGroupAPIClient is a client that implements +// the DescribeInstancePatchStatesForPatchGroup operation. +type DescribeInstancePatchStatesForPatchGroupAPIClient interface { + DescribeInstancePatchStatesForPatchGroup(context.Context, *DescribeInstancePatchStatesForPatchGroupInput, ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) +} + +var _ DescribeInstancePatchStatesForPatchGroupAPIClient = (*Client)(nil) + +// DescribeInstancePatchStatesForPatchGroupPaginatorOptions is the paginator +// options for DescribeInstancePatchStatesForPatchGroup +type DescribeInstancePatchStatesForPatchGroupPaginatorOptions struct { + // The maximum number of patches to return (per page). + 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 +} + +// DescribeInstancePatchStatesForPatchGroupPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatchStatesForPatchGroup +type DescribeInstancePatchStatesForPatchGroupPaginator struct { + options DescribeInstancePatchStatesForPatchGroupPaginatorOptions + client DescribeInstancePatchStatesForPatchGroupAPIClient + params *DescribeInstancePatchStatesForPatchGroupInput + nextToken *string + firstPage bool +} + +// NewDescribeInstancePatchStatesForPatchGroupPaginator returns a new +// DescribeInstancePatchStatesForPatchGroupPaginator +func NewDescribeInstancePatchStatesForPatchGroupPaginator(client DescribeInstancePatchStatesForPatchGroupAPIClient, params *DescribeInstancePatchStatesForPatchGroupInput, optFns ...func(*DescribeInstancePatchStatesForPatchGroupPaginatorOptions)) *DescribeInstancePatchStatesForPatchGroupPaginator { + options := DescribeInstancePatchStatesForPatchGroupPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchStatesForPatchGroupInput{} + } + + return &DescribeInstancePatchStatesForPatchGroupPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchStatesForPatchGroupPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstancePatchStatesForPatchGroup page. +func (p *DescribeInstancePatchStatesForPatchGroupPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchStatesForPatchGroupOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstancePatchStatesForPatchGroup(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatchStatesForPatchGroup(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInstancePatches.go b/service/ssm/api_op_DescribeInstancePatches.go index bae2750715f..ec3d8b9a757 100644 --- a/service/ssm/api_op_DescribeInstancePatches.go +++ b/service/ssm/api_op_DescribeInstancePatches.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -123,6 +124,89 @@ func addOperationDescribeInstancePatchesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeInstancePatchesAPIClient is a client that implements the +// DescribeInstancePatches operation. +type DescribeInstancePatchesAPIClient interface { + DescribeInstancePatches(context.Context, *DescribeInstancePatchesInput, ...func(*Options)) (*DescribeInstancePatchesOutput, error) +} + +var _ DescribeInstancePatchesAPIClient = (*Client)(nil) + +// DescribeInstancePatchesPaginatorOptions is the paginator options for +// DescribeInstancePatches +type DescribeInstancePatchesPaginatorOptions struct { + // The maximum number of patches to return (per page). + 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 +} + +// DescribeInstancePatchesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInstancePatches +type DescribeInstancePatchesPaginator struct { + options DescribeInstancePatchesPaginatorOptions + client DescribeInstancePatchesAPIClient + params *DescribeInstancePatchesInput + nextToken *string + firstPage bool +} + +// NewDescribeInstancePatchesPaginator returns a new +// DescribeInstancePatchesPaginator +func NewDescribeInstancePatchesPaginator(client DescribeInstancePatchesAPIClient, params *DescribeInstancePatchesInput, optFns ...func(*DescribeInstancePatchesPaginatorOptions)) *DescribeInstancePatchesPaginator { + options := DescribeInstancePatchesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInstancePatchesInput{} + } + + return &DescribeInstancePatchesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInstancePatchesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInstancePatches page. +func (p *DescribeInstancePatchesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInstancePatchesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInstancePatches(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInstancePatches(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeInventoryDeletions.go b/service/ssm/api_op_DescribeInventoryDeletions.go index d786c064f25..e0176996277 100644 --- a/service/ssm/api_op_DescribeInventoryDeletions.go +++ b/service/ssm/api_op_DescribeInventoryDeletions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -111,6 +112,90 @@ func addOperationDescribeInventoryDeletionsMiddlewares(stack *middleware.Stack, return nil } +// DescribeInventoryDeletionsAPIClient is a client that implements the +// DescribeInventoryDeletions operation. +type DescribeInventoryDeletionsAPIClient interface { + DescribeInventoryDeletions(context.Context, *DescribeInventoryDeletionsInput, ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) +} + +var _ DescribeInventoryDeletionsAPIClient = (*Client)(nil) + +// DescribeInventoryDeletionsPaginatorOptions is the paginator options for +// DescribeInventoryDeletions +type DescribeInventoryDeletionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeInventoryDeletionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeInventoryDeletions +type DescribeInventoryDeletionsPaginator struct { + options DescribeInventoryDeletionsPaginatorOptions + client DescribeInventoryDeletionsAPIClient + params *DescribeInventoryDeletionsInput + nextToken *string + firstPage bool +} + +// NewDescribeInventoryDeletionsPaginator returns a new +// DescribeInventoryDeletionsPaginator +func NewDescribeInventoryDeletionsPaginator(client DescribeInventoryDeletionsAPIClient, params *DescribeInventoryDeletionsInput, optFns ...func(*DescribeInventoryDeletionsPaginatorOptions)) *DescribeInventoryDeletionsPaginator { + options := DescribeInventoryDeletionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeInventoryDeletionsInput{} + } + + return &DescribeInventoryDeletionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeInventoryDeletionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeInventoryDeletions page. +func (p *DescribeInventoryDeletionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeInventoryDeletionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeInventoryDeletions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeInventoryDeletions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go index eb1f731e5c2..92f3441276f 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTaskInvocations.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -128,6 +129,91 @@ func addOperationDescribeMaintenanceWindowExecutionTaskInvocationsMiddlewares(st return nil } +// DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient is a client that +// implements the DescribeMaintenanceWindowExecutionTaskInvocations operation. +type DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient interface { + DescribeMaintenanceWindowExecutionTaskInvocations(context.Context, *DescribeMaintenanceWindowExecutionTaskInvocationsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions is the +// paginator options for DescribeMaintenanceWindowExecutionTaskInvocations +type DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutionTaskInvocations +type DescribeMaintenanceWindowExecutionTaskInvocationsPaginator struct { + options DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions + client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient + params *DescribeMaintenanceWindowExecutionTaskInvocationsInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator returns a new +// DescribeMaintenanceWindowExecutionTaskInvocationsPaginator +func NewDescribeMaintenanceWindowExecutionTaskInvocationsPaginator(client DescribeMaintenanceWindowExecutionTaskInvocationsAPIClient, params *DescribeMaintenanceWindowExecutionTaskInvocationsInput, optFns ...func(*DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions)) *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator { + options := DescribeMaintenanceWindowExecutionTaskInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionTaskInvocationsInput{} + } + + return &DescribeMaintenanceWindowExecutionTaskInvocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutionTaskInvocations +// page. +func (p *DescribeMaintenanceWindowExecutionTaskInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTaskInvocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowExecutionTaskInvocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTaskInvocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go index 0eaef568934..7a1f1751118 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutionTasks.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -122,6 +123,90 @@ func addOperationDescribeMaintenanceWindowExecutionTasksMiddlewares(stack *middl return nil } +// DescribeMaintenanceWindowExecutionTasksAPIClient is a client that implements the +// DescribeMaintenanceWindowExecutionTasks operation. +type DescribeMaintenanceWindowExecutionTasksAPIClient interface { + DescribeMaintenanceWindowExecutionTasks(context.Context, *DescribeMaintenanceWindowExecutionTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionTasksAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionTasksPaginatorOptions is the paginator options +// for DescribeMaintenanceWindowExecutionTasks +type DescribeMaintenanceWindowExecutionTasksPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowExecutionTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutionTasks +type DescribeMaintenanceWindowExecutionTasksPaginator struct { + options DescribeMaintenanceWindowExecutionTasksPaginatorOptions + client DescribeMaintenanceWindowExecutionTasksAPIClient + params *DescribeMaintenanceWindowExecutionTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowExecutionTasksPaginator returns a new +// DescribeMaintenanceWindowExecutionTasksPaginator +func NewDescribeMaintenanceWindowExecutionTasksPaginator(client DescribeMaintenanceWindowExecutionTasksAPIClient, params *DescribeMaintenanceWindowExecutionTasksInput, optFns ...func(*DescribeMaintenanceWindowExecutionTasksPaginatorOptions)) *DescribeMaintenanceWindowExecutionTasksPaginator { + options := DescribeMaintenanceWindowExecutionTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionTasksInput{} + } + + return &DescribeMaintenanceWindowExecutionTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutionTasks page. +func (p *DescribeMaintenanceWindowExecutionTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowExecutionTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutionTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go b/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go index 5648e09406f..4928bfe58dd 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowExecutions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -124,6 +125,90 @@ func addOperationDescribeMaintenanceWindowExecutionsMiddlewares(stack *middlewar return nil } +// DescribeMaintenanceWindowExecutionsAPIClient is a client that implements the +// DescribeMaintenanceWindowExecutions operation. +type DescribeMaintenanceWindowExecutionsAPIClient interface { + DescribeMaintenanceWindowExecutions(context.Context, *DescribeMaintenanceWindowExecutionsInput, ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) +} + +var _ DescribeMaintenanceWindowExecutionsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowExecutionsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowExecutions +type DescribeMaintenanceWindowExecutionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowExecutions +type DescribeMaintenanceWindowExecutionsPaginator struct { + options DescribeMaintenanceWindowExecutionsPaginatorOptions + client DescribeMaintenanceWindowExecutionsAPIClient + params *DescribeMaintenanceWindowExecutionsInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowExecutionsPaginator returns a new +// DescribeMaintenanceWindowExecutionsPaginator +func NewDescribeMaintenanceWindowExecutionsPaginator(client DescribeMaintenanceWindowExecutionsAPIClient, params *DescribeMaintenanceWindowExecutionsInput, optFns ...func(*DescribeMaintenanceWindowExecutionsPaginatorOptions)) *DescribeMaintenanceWindowExecutionsPaginator { + options := DescribeMaintenanceWindowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowExecutionsInput{} + } + + return &DescribeMaintenanceWindowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowExecutions page. +func (p *DescribeMaintenanceWindowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go b/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go index 034e42c0a16..d7f3726f847 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowSchedule.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -124,6 +125,90 @@ func addOperationDescribeMaintenanceWindowScheduleMiddlewares(stack *middleware. return nil } +// DescribeMaintenanceWindowScheduleAPIClient is a client that implements the +// DescribeMaintenanceWindowSchedule operation. +type DescribeMaintenanceWindowScheduleAPIClient interface { + DescribeMaintenanceWindowSchedule(context.Context, *DescribeMaintenanceWindowScheduleInput, ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) +} + +var _ DescribeMaintenanceWindowScheduleAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowSchedulePaginatorOptions is the paginator options for +// DescribeMaintenanceWindowSchedule +type DescribeMaintenanceWindowSchedulePaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowSchedulePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowSchedule +type DescribeMaintenanceWindowSchedulePaginator struct { + options DescribeMaintenanceWindowSchedulePaginatorOptions + client DescribeMaintenanceWindowScheduleAPIClient + params *DescribeMaintenanceWindowScheduleInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowSchedulePaginator returns a new +// DescribeMaintenanceWindowSchedulePaginator +func NewDescribeMaintenanceWindowSchedulePaginator(client DescribeMaintenanceWindowScheduleAPIClient, params *DescribeMaintenanceWindowScheduleInput, optFns ...func(*DescribeMaintenanceWindowSchedulePaginatorOptions)) *DescribeMaintenanceWindowSchedulePaginator { + options := DescribeMaintenanceWindowSchedulePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowScheduleInput{} + } + + return &DescribeMaintenanceWindowSchedulePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowSchedulePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowSchedule page. +func (p *DescribeMaintenanceWindowSchedulePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowScheduleOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowSchedule(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowSchedule(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowTargets.go b/service/ssm/api_op_DescribeMaintenanceWindowTargets.go index 9d7a8164e31..fbf4f560233 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowTargets.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowTargets.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -121,6 +122,90 @@ func addOperationDescribeMaintenanceWindowTargetsMiddlewares(stack *middleware.S return nil } +// DescribeMaintenanceWindowTargetsAPIClient is a client that implements the +// DescribeMaintenanceWindowTargets operation. +type DescribeMaintenanceWindowTargetsAPIClient interface { + DescribeMaintenanceWindowTargets(context.Context, *DescribeMaintenanceWindowTargetsInput, ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) +} + +var _ DescribeMaintenanceWindowTargetsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowTargetsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowTargets +type DescribeMaintenanceWindowTargetsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowTargetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowTargets +type DescribeMaintenanceWindowTargetsPaginator struct { + options DescribeMaintenanceWindowTargetsPaginatorOptions + client DescribeMaintenanceWindowTargetsAPIClient + params *DescribeMaintenanceWindowTargetsInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowTargetsPaginator returns a new +// DescribeMaintenanceWindowTargetsPaginator +func NewDescribeMaintenanceWindowTargetsPaginator(client DescribeMaintenanceWindowTargetsAPIClient, params *DescribeMaintenanceWindowTargetsInput, optFns ...func(*DescribeMaintenanceWindowTargetsPaginatorOptions)) *DescribeMaintenanceWindowTargetsPaginator { + options := DescribeMaintenanceWindowTargetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowTargetsInput{} + } + + return &DescribeMaintenanceWindowTargetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowTargetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowTargets page. +func (p *DescribeMaintenanceWindowTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTargetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowTargets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTargets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go index a8bc989da2e..043a57e2815 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -120,6 +121,90 @@ func addOperationDescribeMaintenanceWindowTasksMiddlewares(stack *middleware.Sta return nil } +// DescribeMaintenanceWindowTasksAPIClient is a client that implements the +// DescribeMaintenanceWindowTasks operation. +type DescribeMaintenanceWindowTasksAPIClient interface { + DescribeMaintenanceWindowTasks(context.Context, *DescribeMaintenanceWindowTasksInput, ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) +} + +var _ DescribeMaintenanceWindowTasksAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowTasksPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowTasks +type DescribeMaintenanceWindowTasksPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowTasksPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowTasks +type DescribeMaintenanceWindowTasksPaginator struct { + options DescribeMaintenanceWindowTasksPaginatorOptions + client DescribeMaintenanceWindowTasksAPIClient + params *DescribeMaintenanceWindowTasksInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowTasksPaginator returns a new +// DescribeMaintenanceWindowTasksPaginator +func NewDescribeMaintenanceWindowTasksPaginator(client DescribeMaintenanceWindowTasksAPIClient, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*DescribeMaintenanceWindowTasksPaginatorOptions)) *DescribeMaintenanceWindowTasksPaginator { + options := DescribeMaintenanceWindowTasksPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowTasksInput{} + } + + return &DescribeMaintenanceWindowTasksPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowTasksPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowTasks page. +func (p *DescribeMaintenanceWindowTasksPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowTasks(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowTasks(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindows.go b/service/ssm/api_op_DescribeMaintenanceWindows.go index 78a037a6c09..3f8d08e9243 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindows.go +++ b/service/ssm/api_op_DescribeMaintenanceWindows.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -112,6 +113,90 @@ func addOperationDescribeMaintenanceWindowsMiddlewares(stack *middleware.Stack, return nil } +// DescribeMaintenanceWindowsAPIClient is a client that implements the +// DescribeMaintenanceWindows operation. +type DescribeMaintenanceWindowsAPIClient interface { + DescribeMaintenanceWindows(context.Context, *DescribeMaintenanceWindowsInput, ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) +} + +var _ DescribeMaintenanceWindowsAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowsPaginatorOptions is the paginator options for +// DescribeMaintenanceWindows +type DescribeMaintenanceWindowsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindows +type DescribeMaintenanceWindowsPaginator struct { + options DescribeMaintenanceWindowsPaginatorOptions + client DescribeMaintenanceWindowsAPIClient + params *DescribeMaintenanceWindowsInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowsPaginator returns a new +// DescribeMaintenanceWindowsPaginator +func NewDescribeMaintenanceWindowsPaginator(client DescribeMaintenanceWindowsAPIClient, params *DescribeMaintenanceWindowsInput, optFns ...func(*DescribeMaintenanceWindowsPaginatorOptions)) *DescribeMaintenanceWindowsPaginator { + options := DescribeMaintenanceWindowsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowsInput{} + } + + return &DescribeMaintenanceWindowsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindows page. +func (p *DescribeMaintenanceWindowsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindows(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindows(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go b/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go index 6f4f358e8b0..dc6679a01c7 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowsForTarget.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -124,6 +125,90 @@ func addOperationDescribeMaintenanceWindowsForTargetMiddlewares(stack *middlewar return nil } +// DescribeMaintenanceWindowsForTargetAPIClient is a client that implements the +// DescribeMaintenanceWindowsForTarget operation. +type DescribeMaintenanceWindowsForTargetAPIClient interface { + DescribeMaintenanceWindowsForTarget(context.Context, *DescribeMaintenanceWindowsForTargetInput, ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) +} + +var _ DescribeMaintenanceWindowsForTargetAPIClient = (*Client)(nil) + +// DescribeMaintenanceWindowsForTargetPaginatorOptions is the paginator options for +// DescribeMaintenanceWindowsForTarget +type DescribeMaintenanceWindowsForTargetPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeMaintenanceWindowsForTargetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeMaintenanceWindowsForTarget +type DescribeMaintenanceWindowsForTargetPaginator struct { + options DescribeMaintenanceWindowsForTargetPaginatorOptions + client DescribeMaintenanceWindowsForTargetAPIClient + params *DescribeMaintenanceWindowsForTargetInput + nextToken *string + firstPage bool +} + +// NewDescribeMaintenanceWindowsForTargetPaginator returns a new +// DescribeMaintenanceWindowsForTargetPaginator +func NewDescribeMaintenanceWindowsForTargetPaginator(client DescribeMaintenanceWindowsForTargetAPIClient, params *DescribeMaintenanceWindowsForTargetInput, optFns ...func(*DescribeMaintenanceWindowsForTargetPaginatorOptions)) *DescribeMaintenanceWindowsForTargetPaginator { + options := DescribeMaintenanceWindowsForTargetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeMaintenanceWindowsForTargetInput{} + } + + return &DescribeMaintenanceWindowsForTargetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeMaintenanceWindowsForTargetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeMaintenanceWindowsForTarget page. +func (p *DescribeMaintenanceWindowsForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeMaintenanceWindowsForTargetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeMaintenanceWindowsForTarget(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeMaintenanceWindowsForTarget(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeOpsItems.go b/service/ssm/api_op_DescribeOpsItems.go index 1562df198f5..f04e90a8da8 100644 --- a/service/ssm/api_op_DescribeOpsItems.go +++ b/service/ssm/api_op_DescribeOpsItems.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -160,6 +161,88 @@ func addOperationDescribeOpsItemsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeOpsItemsAPIClient is a client that implements the DescribeOpsItems +// operation. +type DescribeOpsItemsAPIClient interface { + DescribeOpsItems(context.Context, *DescribeOpsItemsInput, ...func(*Options)) (*DescribeOpsItemsOutput, error) +} + +var _ DescribeOpsItemsAPIClient = (*Client)(nil) + +// DescribeOpsItemsPaginatorOptions is the paginator options for DescribeOpsItems +type DescribeOpsItemsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeOpsItemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeOpsItems +type DescribeOpsItemsPaginator struct { + options DescribeOpsItemsPaginatorOptions + client DescribeOpsItemsAPIClient + params *DescribeOpsItemsInput + nextToken *string + firstPage bool +} + +// NewDescribeOpsItemsPaginator returns a new DescribeOpsItemsPaginator +func NewDescribeOpsItemsPaginator(client DescribeOpsItemsAPIClient, params *DescribeOpsItemsInput, optFns ...func(*DescribeOpsItemsPaginatorOptions)) *DescribeOpsItemsPaginator { + options := DescribeOpsItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeOpsItemsInput{} + } + + return &DescribeOpsItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeOpsItemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeOpsItems page. +func (p *DescribeOpsItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeOpsItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeOpsItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeOpsItems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeParameters.go b/service/ssm/api_op_DescribeParameters.go index b49f39cf097..6469e08d934 100644 --- a/service/ssm/api_op_DescribeParameters.go +++ b/service/ssm/api_op_DescribeParameters.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -122,6 +123,89 @@ func addOperationDescribeParametersMiddlewares(stack *middleware.Stack, options return nil } +// DescribeParametersAPIClient is a client that implements the DescribeParameters +// operation. +type DescribeParametersAPIClient interface { + DescribeParameters(context.Context, *DescribeParametersInput, ...func(*Options)) (*DescribeParametersOutput, error) +} + +var _ DescribeParametersAPIClient = (*Client)(nil) + +// DescribeParametersPaginatorOptions is the paginator options for +// DescribeParameters +type DescribeParametersPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeParametersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeParameters +type DescribeParametersPaginator struct { + options DescribeParametersPaginatorOptions + client DescribeParametersAPIClient + params *DescribeParametersInput + nextToken *string + firstPage bool +} + +// NewDescribeParametersPaginator returns a new DescribeParametersPaginator +func NewDescribeParametersPaginator(client DescribeParametersAPIClient, params *DescribeParametersInput, optFns ...func(*DescribeParametersPaginatorOptions)) *DescribeParametersPaginator { + options := DescribeParametersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeParametersInput{} + } + + return &DescribeParametersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeParametersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeParameters page. +func (p *DescribeParametersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeParametersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeParameters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeParameters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchBaselines.go b/service/ssm/api_op_DescribePatchBaselines.go index dc012882f49..57ad6d2048a 100644 --- a/service/ssm/api_op_DescribePatchBaselines.go +++ b/service/ssm/api_op_DescribePatchBaselines.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -112,6 +113,88 @@ func addOperationDescribePatchBaselinesMiddlewares(stack *middleware.Stack, opti return nil } +// DescribePatchBaselinesAPIClient is a client that implements the +// DescribePatchBaselines operation. +type DescribePatchBaselinesAPIClient interface { + DescribePatchBaselines(context.Context, *DescribePatchBaselinesInput, ...func(*Options)) (*DescribePatchBaselinesOutput, error) +} + +var _ DescribePatchBaselinesAPIClient = (*Client)(nil) + +// DescribePatchBaselinesPaginatorOptions is the paginator options for +// DescribePatchBaselines +type DescribePatchBaselinesPaginatorOptions struct { + // The maximum number of patch baselines to return (per page). + 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 +} + +// DescribePatchBaselinesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchBaselines +type DescribePatchBaselinesPaginator struct { + options DescribePatchBaselinesPaginatorOptions + client DescribePatchBaselinesAPIClient + params *DescribePatchBaselinesInput + nextToken *string + firstPage bool +} + +// NewDescribePatchBaselinesPaginator returns a new DescribePatchBaselinesPaginator +func NewDescribePatchBaselinesPaginator(client DescribePatchBaselinesAPIClient, params *DescribePatchBaselinesInput, optFns ...func(*DescribePatchBaselinesPaginatorOptions)) *DescribePatchBaselinesPaginator { + options := DescribePatchBaselinesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchBaselinesInput{} + } + + return &DescribePatchBaselinesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchBaselinesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePatchBaselines page. +func (p *DescribePatchBaselinesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchBaselinesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePatchBaselines(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchBaselines(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchGroups.go b/service/ssm/api_op_DescribePatchGroups.go index 4e1d1ce1045..6ffd9a64681 100644 --- a/service/ssm/api_op_DescribePatchGroups.go +++ b/service/ssm/api_op_DescribePatchGroups.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -127,6 +128,88 @@ func addOperationDescribePatchGroupsMiddlewares(stack *middleware.Stack, options return nil } +// DescribePatchGroupsAPIClient is a client that implements the DescribePatchGroups +// operation. +type DescribePatchGroupsAPIClient interface { + DescribePatchGroups(context.Context, *DescribePatchGroupsInput, ...func(*Options)) (*DescribePatchGroupsOutput, error) +} + +var _ DescribePatchGroupsAPIClient = (*Client)(nil) + +// DescribePatchGroupsPaginatorOptions is the paginator options for +// DescribePatchGroups +type DescribePatchGroupsPaginatorOptions struct { + // The maximum number of patch groups to return (per page). + 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 +} + +// DescribePatchGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchGroups +type DescribePatchGroupsPaginator struct { + options DescribePatchGroupsPaginatorOptions + client DescribePatchGroupsAPIClient + params *DescribePatchGroupsInput + nextToken *string + firstPage bool +} + +// NewDescribePatchGroupsPaginator returns a new DescribePatchGroupsPaginator +func NewDescribePatchGroupsPaginator(client DescribePatchGroupsAPIClient, params *DescribePatchGroupsInput, optFns ...func(*DescribePatchGroupsPaginatorOptions)) *DescribePatchGroupsPaginator { + options := DescribePatchGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchGroupsInput{} + } + + return &DescribePatchGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePatchGroups page. +func (p *DescribePatchGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePatchGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribePatchProperties.go b/service/ssm/api_op_DescribePatchProperties.go index e2eb920e98c..3ee82bea79b 100644 --- a/service/ssm/api_op_DescribePatchProperties.go +++ b/service/ssm/api_op_DescribePatchProperties.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -137,6 +138,90 @@ func addOperationDescribePatchPropertiesMiddlewares(stack *middleware.Stack, opt return nil } +// DescribePatchPropertiesAPIClient is a client that implements the +// DescribePatchProperties operation. +type DescribePatchPropertiesAPIClient interface { + DescribePatchProperties(context.Context, *DescribePatchPropertiesInput, ...func(*Options)) (*DescribePatchPropertiesOutput, error) +} + +var _ DescribePatchPropertiesAPIClient = (*Client)(nil) + +// DescribePatchPropertiesPaginatorOptions is the paginator options for +// DescribePatchProperties +type DescribePatchPropertiesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribePatchPropertiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribePatchProperties +type DescribePatchPropertiesPaginator struct { + options DescribePatchPropertiesPaginatorOptions + client DescribePatchPropertiesAPIClient + params *DescribePatchPropertiesInput + nextToken *string + firstPage bool +} + +// NewDescribePatchPropertiesPaginator returns a new +// DescribePatchPropertiesPaginator +func NewDescribePatchPropertiesPaginator(client DescribePatchPropertiesAPIClient, params *DescribePatchPropertiesInput, optFns ...func(*DescribePatchPropertiesPaginatorOptions)) *DescribePatchPropertiesPaginator { + options := DescribePatchPropertiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePatchPropertiesInput{} + } + + return &DescribePatchPropertiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePatchPropertiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePatchProperties page. +func (p *DescribePatchPropertiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePatchPropertiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribePatchProperties(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribePatchProperties(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_DescribeSessions.go b/service/ssm/api_op_DescribeSessions.go index 6a0615278d1..ff578f892da 100644 --- a/service/ssm/api_op_DescribeSessions.go +++ b/service/ssm/api_op_DescribeSessions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -120,6 +121,88 @@ func addOperationDescribeSessionsMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeSessionsAPIClient is a client that implements the DescribeSessions +// operation. +type DescribeSessionsAPIClient interface { + DescribeSessions(context.Context, *DescribeSessionsInput, ...func(*Options)) (*DescribeSessionsOutput, error) +} + +var _ DescribeSessionsAPIClient = (*Client)(nil) + +// DescribeSessionsPaginatorOptions is the paginator options for DescribeSessions +type DescribeSessionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// DescribeSessionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.DescribeSessions +type DescribeSessionsPaginator struct { + options DescribeSessionsPaginatorOptions + client DescribeSessionsAPIClient + params *DescribeSessionsInput + nextToken *string + firstPage bool +} + +// NewDescribeSessionsPaginator returns a new DescribeSessionsPaginator +func NewDescribeSessionsPaginator(client DescribeSessionsAPIClient, params *DescribeSessionsInput, optFns ...func(*DescribeSessionsPaginatorOptions)) *DescribeSessionsPaginator { + options := DescribeSessionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeSessionsInput{} + } + + return &DescribeSessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeSessionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeSessions page. +func (p *DescribeSessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeSessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.DescribeSessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeSessions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetInventory.go b/service/ssm/api_op_GetInventory.go index fa9e1af39e0..b1616a18881 100644 --- a/service/ssm/api_op_GetInventory.go +++ b/service/ssm/api_op_GetInventory.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -123,6 +124,87 @@ func addOperationGetInventoryMiddlewares(stack *middleware.Stack, options Option return nil } +// GetInventoryAPIClient is a client that implements the GetInventory operation. +type GetInventoryAPIClient interface { + GetInventory(context.Context, *GetInventoryInput, ...func(*Options)) (*GetInventoryOutput, error) +} + +var _ GetInventoryAPIClient = (*Client)(nil) + +// GetInventoryPaginatorOptions is the paginator options for GetInventory +type GetInventoryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// GetInventoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetInventory +type GetInventoryPaginator struct { + options GetInventoryPaginatorOptions + client GetInventoryAPIClient + params *GetInventoryInput + nextToken *string + firstPage bool +} + +// NewGetInventoryPaginator returns a new GetInventoryPaginator +func NewGetInventoryPaginator(client GetInventoryAPIClient, params *GetInventoryInput, optFns ...func(*GetInventoryPaginatorOptions)) *GetInventoryPaginator { + options := GetInventoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInventoryInput{} + } + + return &GetInventoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInventoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetInventory page. +func (p *GetInventoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetInventory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInventory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetInventorySchema.go b/service/ssm/api_op_GetInventorySchema.go index 2cdebf58fe5..59f02c74712 100644 --- a/service/ssm/api_op_GetInventorySchema.go +++ b/service/ssm/api_op_GetInventorySchema.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -120,6 +121,89 @@ func addOperationGetInventorySchemaMiddlewares(stack *middleware.Stack, options return nil } +// GetInventorySchemaAPIClient is a client that implements the GetInventorySchema +// operation. +type GetInventorySchemaAPIClient interface { + GetInventorySchema(context.Context, *GetInventorySchemaInput, ...func(*Options)) (*GetInventorySchemaOutput, error) +} + +var _ GetInventorySchemaAPIClient = (*Client)(nil) + +// GetInventorySchemaPaginatorOptions is the paginator options for +// GetInventorySchema +type GetInventorySchemaPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// GetInventorySchemaPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetInventorySchema +type GetInventorySchemaPaginator struct { + options GetInventorySchemaPaginatorOptions + client GetInventorySchemaAPIClient + params *GetInventorySchemaInput + nextToken *string + firstPage bool +} + +// NewGetInventorySchemaPaginator returns a new GetInventorySchemaPaginator +func NewGetInventorySchemaPaginator(client GetInventorySchemaAPIClient, params *GetInventorySchemaInput, optFns ...func(*GetInventorySchemaPaginatorOptions)) *GetInventorySchemaPaginator { + options := GetInventorySchemaPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetInventorySchemaInput{} + } + + return &GetInventorySchemaPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetInventorySchemaPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetInventorySchema page. +func (p *GetInventorySchemaPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetInventorySchemaOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetInventorySchema(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetInventorySchema(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetOpsSummary.go b/service/ssm/api_op_GetOpsSummary.go index 9cef14adca5..14d3ecb610c 100644 --- a/service/ssm/api_op_GetOpsSummary.go +++ b/service/ssm/api_op_GetOpsSummary.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -123,6 +124,87 @@ func addOperationGetOpsSummaryMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetOpsSummaryAPIClient is a client that implements the GetOpsSummary operation. +type GetOpsSummaryAPIClient interface { + GetOpsSummary(context.Context, *GetOpsSummaryInput, ...func(*Options)) (*GetOpsSummaryOutput, error) +} + +var _ GetOpsSummaryAPIClient = (*Client)(nil) + +// GetOpsSummaryPaginatorOptions is the paginator options for GetOpsSummary +type GetOpsSummaryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// GetOpsSummaryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetOpsSummary +type GetOpsSummaryPaginator struct { + options GetOpsSummaryPaginatorOptions + client GetOpsSummaryAPIClient + params *GetOpsSummaryInput + nextToken *string + firstPage bool +} + +// NewGetOpsSummaryPaginator returns a new GetOpsSummaryPaginator +func NewGetOpsSummaryPaginator(client GetOpsSummaryAPIClient, params *GetOpsSummaryInput, optFns ...func(*GetOpsSummaryPaginatorOptions)) *GetOpsSummaryPaginator { + options := GetOpsSummaryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetOpsSummaryInput{} + } + + return &GetOpsSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetOpsSummaryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetOpsSummary page. +func (p *GetOpsSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetOpsSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetOpsSummary(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetOpsSummary(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetParameterHistory.go b/service/ssm/api_op_GetParameterHistory.go index 0cf29e67116..235443b6580 100644 --- a/service/ssm/api_op_GetParameterHistory.go +++ b/service/ssm/api_op_GetParameterHistory.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -120,6 +121,89 @@ func addOperationGetParameterHistoryMiddlewares(stack *middleware.Stack, options return nil } +// GetParameterHistoryAPIClient is a client that implements the GetParameterHistory +// operation. +type GetParameterHistoryAPIClient interface { + GetParameterHistory(context.Context, *GetParameterHistoryInput, ...func(*Options)) (*GetParameterHistoryOutput, error) +} + +var _ GetParameterHistoryAPIClient = (*Client)(nil) + +// GetParameterHistoryPaginatorOptions is the paginator options for +// GetParameterHistory +type GetParameterHistoryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// GetParameterHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetParameterHistory +type GetParameterHistoryPaginator struct { + options GetParameterHistoryPaginatorOptions + client GetParameterHistoryAPIClient + params *GetParameterHistoryInput + nextToken *string + firstPage bool +} + +// NewGetParameterHistoryPaginator returns a new GetParameterHistoryPaginator +func NewGetParameterHistoryPaginator(client GetParameterHistoryAPIClient, params *GetParameterHistoryInput, optFns ...func(*GetParameterHistoryPaginatorOptions)) *GetParameterHistoryPaginator { + options := GetParameterHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetParameterHistoryInput{} + } + + return &GetParameterHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetParameterHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetParameterHistory page. +func (p *GetParameterHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParameterHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetParameterHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetParameterHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_GetParametersByPath.go b/service/ssm/api_op_GetParametersByPath.go index 7671d335c3a..526ba5c9bfa 100644 --- a/service/ssm/api_op_GetParametersByPath.go +++ b/service/ssm/api_op_GetParametersByPath.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -140,6 +141,89 @@ func addOperationGetParametersByPathMiddlewares(stack *middleware.Stack, options return nil } +// GetParametersByPathAPIClient is a client that implements the GetParametersByPath +// operation. +type GetParametersByPathAPIClient interface { + GetParametersByPath(context.Context, *GetParametersByPathInput, ...func(*Options)) (*GetParametersByPathOutput, error) +} + +var _ GetParametersByPathAPIClient = (*Client)(nil) + +// GetParametersByPathPaginatorOptions is the paginator options for +// GetParametersByPath +type GetParametersByPathPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// GetParametersByPathPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.GetParametersByPath +type GetParametersByPathPaginator struct { + options GetParametersByPathPaginatorOptions + client GetParametersByPathAPIClient + params *GetParametersByPathInput + nextToken *string + firstPage bool +} + +// NewGetParametersByPathPaginator returns a new GetParametersByPathPaginator +func NewGetParametersByPathPaginator(client GetParametersByPathAPIClient, params *GetParametersByPathInput, optFns ...func(*GetParametersByPathPaginatorOptions)) *GetParametersByPathPaginator { + options := GetParametersByPathPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetParametersByPathInput{} + } + + return &GetParametersByPathPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetParametersByPathPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetParametersByPath page. +func (p *GetParametersByPathPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetParametersByPathOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.GetParametersByPath(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetParametersByPath(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListAssociationVersions.go b/service/ssm/api_op_ListAssociationVersions.go index 4f01b27e601..d5c76656348 100644 --- a/service/ssm/api_op_ListAssociationVersions.go +++ b/service/ssm/api_op_ListAssociationVersions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -116,6 +117,90 @@ func addOperationListAssociationVersionsMiddlewares(stack *middleware.Stack, opt return nil } +// ListAssociationVersionsAPIClient is a client that implements the +// ListAssociationVersions operation. +type ListAssociationVersionsAPIClient interface { + ListAssociationVersions(context.Context, *ListAssociationVersionsInput, ...func(*Options)) (*ListAssociationVersionsOutput, error) +} + +var _ ListAssociationVersionsAPIClient = (*Client)(nil) + +// ListAssociationVersionsPaginatorOptions is the paginator options for +// ListAssociationVersions +type ListAssociationVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListAssociationVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListAssociationVersions +type ListAssociationVersionsPaginator struct { + options ListAssociationVersionsPaginatorOptions + client ListAssociationVersionsAPIClient + params *ListAssociationVersionsInput + nextToken *string + firstPage bool +} + +// NewListAssociationVersionsPaginator returns a new +// ListAssociationVersionsPaginator +func NewListAssociationVersionsPaginator(client ListAssociationVersionsAPIClient, params *ListAssociationVersionsInput, optFns ...func(*ListAssociationVersionsPaginatorOptions)) *ListAssociationVersionsPaginator { + options := ListAssociationVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociationVersionsInput{} + } + + return &ListAssociationVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociationVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssociationVersions page. +func (p *ListAssociationVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAssociationVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociationVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListAssociations.go b/service/ssm/api_op_ListAssociations.go index b54717c794f..0daf0590261 100644 --- a/service/ssm/api_op_ListAssociations.go +++ b/service/ssm/api_op_ListAssociations.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -116,6 +117,88 @@ func addOperationListAssociationsMiddlewares(stack *middleware.Stack, options Op return nil } +// ListAssociationsAPIClient is a client that implements the ListAssociations +// operation. +type ListAssociationsAPIClient interface { + ListAssociations(context.Context, *ListAssociationsInput, ...func(*Options)) (*ListAssociationsOutput, error) +} + +var _ ListAssociationsAPIClient = (*Client)(nil) + +// ListAssociationsPaginatorOptions is the paginator options for ListAssociations +type ListAssociationsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListAssociationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListAssociations +type ListAssociationsPaginator struct { + options ListAssociationsPaginatorOptions + client ListAssociationsAPIClient + params *ListAssociationsInput + nextToken *string + firstPage bool +} + +// NewListAssociationsPaginator returns a new ListAssociationsPaginator +func NewListAssociationsPaginator(client ListAssociationsAPIClient, params *ListAssociationsInput, optFns ...func(*ListAssociationsPaginatorOptions)) *ListAssociationsPaginator { + options := ListAssociationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAssociationsInput{} + } + + return &ListAssociationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAssociationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAssociations page. +func (p *ListAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAssociationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListAssociations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAssociations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListCommandInvocations.go b/service/ssm/api_op_ListCommandInvocations.go index 8bb77fe8b3d..949df18a552 100644 --- a/service/ssm/api_op_ListCommandInvocations.go +++ b/service/ssm/api_op_ListCommandInvocations.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -130,6 +131,90 @@ func addOperationListCommandInvocationsMiddlewares(stack *middleware.Stack, opti return nil } +// ListCommandInvocationsAPIClient is a client that implements the +// ListCommandInvocations operation. +type ListCommandInvocationsAPIClient interface { + ListCommandInvocations(context.Context, *ListCommandInvocationsInput, ...func(*Options)) (*ListCommandInvocationsOutput, error) +} + +var _ ListCommandInvocationsAPIClient = (*Client)(nil) + +// ListCommandInvocationsPaginatorOptions is the paginator options for +// ListCommandInvocations +type ListCommandInvocationsPaginatorOptions struct { + // (Optional) The maximum number of items to return for this call. The call also + // returns a token that you can specify in a subsequent call to get the next set of + // results. + 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 +} + +// ListCommandInvocationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListCommandInvocations +type ListCommandInvocationsPaginator struct { + options ListCommandInvocationsPaginatorOptions + client ListCommandInvocationsAPIClient + params *ListCommandInvocationsInput + nextToken *string + firstPage bool +} + +// NewListCommandInvocationsPaginator returns a new ListCommandInvocationsPaginator +func NewListCommandInvocationsPaginator(client ListCommandInvocationsAPIClient, params *ListCommandInvocationsInput, optFns ...func(*ListCommandInvocationsPaginatorOptions)) *ListCommandInvocationsPaginator { + options := ListCommandInvocationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCommandInvocationsInput{} + } + + return &ListCommandInvocationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandInvocationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCommandInvocations page. +func (p *ListCommandInvocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandInvocationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListCommandInvocations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCommandInvocations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListCommands.go b/service/ssm/api_op_ListCommands.go index 6ff520d7976..30823fa7040 100644 --- a/service/ssm/api_op_ListCommands.go +++ b/service/ssm/api_op_ListCommands.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -124,6 +125,88 @@ func addOperationListCommandsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListCommandsAPIClient is a client that implements the ListCommands operation. +type ListCommandsAPIClient interface { + ListCommands(context.Context, *ListCommandsInput, ...func(*Options)) (*ListCommandsOutput, error) +} + +var _ ListCommandsAPIClient = (*Client)(nil) + +// ListCommandsPaginatorOptions is the paginator options for ListCommands +type ListCommandsPaginatorOptions struct { + // (Optional) The maximum number of items to return for this call. The call also + // returns a token that you can specify in a subsequent call to get the next set of + // results. + 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 +} + +// ListCommandsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListCommands +type ListCommandsPaginator struct { + options ListCommandsPaginatorOptions + client ListCommandsAPIClient + params *ListCommandsInput + nextToken *string + firstPage bool +} + +// NewListCommandsPaginator returns a new ListCommandsPaginator +func NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator { + options := ListCommandsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCommandsInput{} + } + + return &ListCommandsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCommands page. +func (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListCommands(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListCommands(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListComplianceItems.go b/service/ssm/api_op_ListComplianceItems.go index 89c6f919cc0..cfb31f0201a 100644 --- a/service/ssm/api_op_ListComplianceItems.go +++ b/service/ssm/api_op_ListComplianceItems.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -122,6 +123,89 @@ func addOperationListComplianceItemsMiddlewares(stack *middleware.Stack, options return nil } +// ListComplianceItemsAPIClient is a client that implements the ListComplianceItems +// operation. +type ListComplianceItemsAPIClient interface { + ListComplianceItems(context.Context, *ListComplianceItemsInput, ...func(*Options)) (*ListComplianceItemsOutput, error) +} + +var _ ListComplianceItemsAPIClient = (*Client)(nil) + +// ListComplianceItemsPaginatorOptions is the paginator options for +// ListComplianceItems +type ListComplianceItemsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListComplianceItemsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListComplianceItems +type ListComplianceItemsPaginator struct { + options ListComplianceItemsPaginatorOptions + client ListComplianceItemsAPIClient + params *ListComplianceItemsInput + nextToken *string + firstPage bool +} + +// NewListComplianceItemsPaginator returns a new ListComplianceItemsPaginator +func NewListComplianceItemsPaginator(client ListComplianceItemsAPIClient, params *ListComplianceItemsInput, optFns ...func(*ListComplianceItemsPaginatorOptions)) *ListComplianceItemsPaginator { + options := ListComplianceItemsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceItemsInput{} + } + + return &ListComplianceItemsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceItemsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComplianceItems page. +func (p *ListComplianceItemsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceItemsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListComplianceItems(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceItems(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListComplianceSummaries.go b/service/ssm/api_op_ListComplianceSummaries.go index e0009482749..0fa372ff572 100644 --- a/service/ssm/api_op_ListComplianceSummaries.go +++ b/service/ssm/api_op_ListComplianceSummaries.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -117,6 +118,91 @@ func addOperationListComplianceSummariesMiddlewares(stack *middleware.Stack, opt return nil } +// ListComplianceSummariesAPIClient is a client that implements the +// ListComplianceSummaries operation. +type ListComplianceSummariesAPIClient interface { + ListComplianceSummaries(context.Context, *ListComplianceSummariesInput, ...func(*Options)) (*ListComplianceSummariesOutput, error) +} + +var _ ListComplianceSummariesAPIClient = (*Client)(nil) + +// ListComplianceSummariesPaginatorOptions is the paginator options for +// ListComplianceSummaries +type ListComplianceSummariesPaginatorOptions struct { + // The maximum number of items to return for this call. Currently, you can specify + // null or 50. The call also returns a token that you can specify in a subsequent + // call to get the next set of results. + 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 +} + +// ListComplianceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListComplianceSummaries +type ListComplianceSummariesPaginator struct { + options ListComplianceSummariesPaginatorOptions + client ListComplianceSummariesAPIClient + params *ListComplianceSummariesInput + nextToken *string + firstPage bool +} + +// NewListComplianceSummariesPaginator returns a new +// ListComplianceSummariesPaginator +func NewListComplianceSummariesPaginator(client ListComplianceSummariesAPIClient, params *ListComplianceSummariesInput, optFns ...func(*ListComplianceSummariesPaginatorOptions)) *ListComplianceSummariesPaginator { + options := ListComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComplianceSummariesInput{} + } + + return &ListComplianceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComplianceSummariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComplianceSummaries page. +func (p *ListComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComplianceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListComplianceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListDocumentVersions.go b/service/ssm/api_op_ListDocumentVersions.go index a1703674355..992fe4cd3a5 100644 --- a/service/ssm/api_op_ListDocumentVersions.go +++ b/service/ssm/api_op_ListDocumentVersions.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -116,6 +117,89 @@ func addOperationListDocumentVersionsMiddlewares(stack *middleware.Stack, option return nil } +// ListDocumentVersionsAPIClient is a client that implements the +// ListDocumentVersions operation. +type ListDocumentVersionsAPIClient interface { + ListDocumentVersions(context.Context, *ListDocumentVersionsInput, ...func(*Options)) (*ListDocumentVersionsOutput, error) +} + +var _ ListDocumentVersionsAPIClient = (*Client)(nil) + +// ListDocumentVersionsPaginatorOptions is the paginator options for +// ListDocumentVersions +type ListDocumentVersionsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListDocumentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListDocumentVersions +type ListDocumentVersionsPaginator struct { + options ListDocumentVersionsPaginatorOptions + client ListDocumentVersionsAPIClient + params *ListDocumentVersionsInput + nextToken *string + firstPage bool +} + +// NewListDocumentVersionsPaginator returns a new ListDocumentVersionsPaginator +func NewListDocumentVersionsPaginator(client ListDocumentVersionsAPIClient, params *ListDocumentVersionsInput, optFns ...func(*ListDocumentVersionsPaginatorOptions)) *ListDocumentVersionsPaginator { + options := ListDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentVersionsInput{} + } + + return &ListDocumentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDocumentVersions page. +func (p *ListDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDocumentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocumentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListDocuments.go b/service/ssm/api_op_ListDocuments.go index 11b24c0eee2..ce54f0ee54b 100644 --- a/service/ssm/api_op_ListDocuments.go +++ b/service/ssm/api_op_ListDocuments.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -123,6 +124,87 @@ func addOperationListDocumentsMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListDocumentsAPIClient is a client that implements the ListDocuments operation. +type ListDocumentsAPIClient interface { + ListDocuments(context.Context, *ListDocumentsInput, ...func(*Options)) (*ListDocumentsOutput, error) +} + +var _ ListDocumentsAPIClient = (*Client)(nil) + +// ListDocumentsPaginatorOptions is the paginator options for ListDocuments +type ListDocumentsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListDocumentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListDocuments +type ListDocumentsPaginator struct { + options ListDocumentsPaginatorOptions + client ListDocumentsAPIClient + params *ListDocumentsInput + nextToken *string + firstPage bool +} + +// NewListDocumentsPaginator returns a new ListDocumentsPaginator +func NewListDocumentsPaginator(client ListDocumentsAPIClient, params *ListDocumentsInput, optFns ...func(*ListDocumentsPaginatorOptions)) *ListDocumentsPaginator { + options := ListDocumentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDocumentsInput{} + } + + return &ListDocumentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDocumentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDocuments page. +func (p *ListDocumentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDocumentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListDocuments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDocuments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListResourceComplianceSummaries.go b/service/ssm/api_op_ListResourceComplianceSummaries.go index 71f9b482042..515c4a40e58 100644 --- a/service/ssm/api_op_ListResourceComplianceSummaries.go +++ b/service/ssm/api_op_ListResourceComplianceSummaries.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -115,6 +116,90 @@ func addOperationListResourceComplianceSummariesMiddlewares(stack *middleware.St return nil } +// ListResourceComplianceSummariesAPIClient is a client that implements the +// ListResourceComplianceSummaries operation. +type ListResourceComplianceSummariesAPIClient interface { + ListResourceComplianceSummaries(context.Context, *ListResourceComplianceSummariesInput, ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) +} + +var _ ListResourceComplianceSummariesAPIClient = (*Client)(nil) + +// ListResourceComplianceSummariesPaginatorOptions is the paginator options for +// ListResourceComplianceSummaries +type ListResourceComplianceSummariesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListResourceComplianceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListResourceComplianceSummaries +type ListResourceComplianceSummariesPaginator struct { + options ListResourceComplianceSummariesPaginatorOptions + client ListResourceComplianceSummariesAPIClient + params *ListResourceComplianceSummariesInput + nextToken *string + firstPage bool +} + +// NewListResourceComplianceSummariesPaginator returns a new +// ListResourceComplianceSummariesPaginator +func NewListResourceComplianceSummariesPaginator(client ListResourceComplianceSummariesAPIClient, params *ListResourceComplianceSummariesInput, optFns ...func(*ListResourceComplianceSummariesPaginatorOptions)) *ListResourceComplianceSummariesPaginator { + options := ListResourceComplianceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceComplianceSummariesInput{} + } + + return &ListResourceComplianceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceComplianceSummariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourceComplianceSummaries page. +func (p *ListResourceComplianceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceComplianceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListResourceComplianceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceComplianceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_ListResourceDataSync.go b/service/ssm/api_op_ListResourceDataSync.go index 8138502bfc9..2f74a04b2c4 100644 --- a/service/ssm/api_op_ListResourceDataSync.go +++ b/service/ssm/api_op_ListResourceDataSync.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -121,6 +122,89 @@ func addOperationListResourceDataSyncMiddlewares(stack *middleware.Stack, option return nil } +// ListResourceDataSyncAPIClient is a client that implements the +// ListResourceDataSync operation. +type ListResourceDataSyncAPIClient interface { + ListResourceDataSync(context.Context, *ListResourceDataSyncInput, ...func(*Options)) (*ListResourceDataSyncOutput, error) +} + +var _ ListResourceDataSyncAPIClient = (*Client)(nil) + +// ListResourceDataSyncPaginatorOptions is the paginator options for +// ListResourceDataSync +type ListResourceDataSyncPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + 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 +} + +// ListResourceDataSyncPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssm.ListResourceDataSync +type ListResourceDataSyncPaginator struct { + options ListResourceDataSyncPaginatorOptions + client ListResourceDataSyncAPIClient + params *ListResourceDataSyncInput + nextToken *string + firstPage bool +} + +// NewListResourceDataSyncPaginator returns a new ListResourceDataSyncPaginator +func NewListResourceDataSyncPaginator(client ListResourceDataSyncAPIClient, params *ListResourceDataSyncInput, optFns ...func(*ListResourceDataSyncPaginatorOptions)) *ListResourceDataSyncPaginator { + options := ListResourceDataSyncPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceDataSyncInput{} + } + + return &ListResourceDataSyncPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceDataSyncPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourceDataSync page. +func (p *ListResourceDataSyncPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceDataSyncOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = p.options.Limit + } + + result, err := p.client.ListResourceDataSync(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceDataSync(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/endpoints.go b/service/ssm/endpoints.go index e08e1b2d0c3..1f61d8059de 100644 --- a/service/ssm/endpoints.go +++ b/service/ssm/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sso/api_op_ListAccountRoles.go b/service/sso/api_op_ListAccountRoles.go index c0f04b86407..2ad87cd06ff 100644 --- a/service/sso/api_op_ListAccountRoles.go +++ b/service/sso/api_op_ListAccountRoles.go @@ -4,6 +4,7 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/awslabs/smithy-go/middleware" @@ -116,6 +117,87 @@ func addOperationListAccountRolesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListAccountRolesAPIClient is a client that implements the ListAccountRoles +// operation. +type ListAccountRolesAPIClient interface { + ListAccountRoles(context.Context, *ListAccountRolesInput, ...func(*Options)) (*ListAccountRolesOutput, error) +} + +var _ ListAccountRolesAPIClient = (*Client)(nil) + +// ListAccountRolesPaginatorOptions is the paginator options for ListAccountRoles +type ListAccountRolesPaginatorOptions struct { + // The number of items that clients can request per page. + 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 +} + +// ListAccountRolesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sso.ListAccountRoles +type ListAccountRolesPaginator struct { + options ListAccountRolesPaginatorOptions + client ListAccountRolesAPIClient + params *ListAccountRolesInput + nextToken *string + firstPage bool +} + +// NewListAccountRolesPaginator returns a new ListAccountRolesPaginator +func NewListAccountRolesPaginator(client ListAccountRolesAPIClient, params *ListAccountRolesInput, optFns ...func(*ListAccountRolesPaginatorOptions)) *ListAccountRolesPaginator { + options := ListAccountRolesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountRolesInput{} + } + + return &ListAccountRolesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountRolesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountRoles page. +func (p *ListAccountRolesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountRolesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountRoles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountRoles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sso/api_op_ListAccounts.go b/service/sso/api_op_ListAccounts.go index 354a683220a..e7a67e6053f 100644 --- a/service/sso/api_op_ListAccounts.go +++ b/service/sso/api_op_ListAccounts.go @@ -4,6 +4,7 @@ package sso import ( "context" + "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/service/sso/types" "github.com/awslabs/smithy-go/middleware" @@ -114,6 +115,86 @@ func addOperationListAccountsMiddlewares(stack *middleware.Stack, options Option return nil } +// ListAccountsAPIClient is a client that implements the ListAccounts operation. +type ListAccountsAPIClient interface { + ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) +} + +var _ ListAccountsAPIClient = (*Client)(nil) + +// ListAccountsPaginatorOptions is the paginator options for ListAccounts +type ListAccountsPaginatorOptions struct { + // This is the number of items clients can request per page. + 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 +} + +// ListAccountsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/sso.ListAccounts +type ListAccountsPaginator struct { + options ListAccountsPaginatorOptions + client ListAccountsAPIClient + params *ListAccountsInput + nextToken *string + firstPage bool +} + +// NewListAccountsPaginator returns a new ListAccountsPaginator +func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { + options := ListAccountsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsInput{} + } + + return &ListAccountsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccounts page. +func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/sso/endpoints.go b/service/sso/endpoints.go index 6ca1a76d770..c2c212c3025 100644 --- a/service/sso/endpoints.go +++ b/service/sso/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go b/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go index 870cf04770d..9e1295fe20c 100644 --- a/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go +++ b/service/ssoadmin/api_op_ListAccountAssignmentCreationStatus.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -121,6 +122,89 @@ func addOperationListAccountAssignmentCreationStatusMiddlewares(stack *middlewar return nil } +// ListAccountAssignmentCreationStatusAPIClient is a client that implements the +// ListAccountAssignmentCreationStatus operation. +type ListAccountAssignmentCreationStatusAPIClient interface { + ListAccountAssignmentCreationStatus(context.Context, *ListAccountAssignmentCreationStatusInput, ...func(*Options)) (*ListAccountAssignmentCreationStatusOutput, error) +} + +var _ ListAccountAssignmentCreationStatusAPIClient = (*Client)(nil) + +// ListAccountAssignmentCreationStatusPaginatorOptions is the paginator options for +// ListAccountAssignmentCreationStatus +type ListAccountAssignmentCreationStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListAccountAssignmentCreationStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignmentCreationStatus +type ListAccountAssignmentCreationStatusPaginator struct { + options ListAccountAssignmentCreationStatusPaginatorOptions + client ListAccountAssignmentCreationStatusAPIClient + params *ListAccountAssignmentCreationStatusInput + nextToken *string + firstPage bool +} + +// NewListAccountAssignmentCreationStatusPaginator returns a new +// ListAccountAssignmentCreationStatusPaginator +func NewListAccountAssignmentCreationStatusPaginator(client ListAccountAssignmentCreationStatusAPIClient, params *ListAccountAssignmentCreationStatusInput, optFns ...func(*ListAccountAssignmentCreationStatusPaginatorOptions)) *ListAccountAssignmentCreationStatusPaginator { + options := ListAccountAssignmentCreationStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentCreationStatusInput{} + } + + return &ListAccountAssignmentCreationStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentCreationStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountAssignmentCreationStatus page. +func (p *ListAccountAssignmentCreationStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentCreationStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountAssignmentCreationStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignmentCreationStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go b/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go index 22e8e98af90..ab638b6d45e 100644 --- a/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go +++ b/service/ssoadmin/api_op_ListAccountAssignmentDeletionStatus.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -121,6 +122,89 @@ func addOperationListAccountAssignmentDeletionStatusMiddlewares(stack *middlewar return nil } +// ListAccountAssignmentDeletionStatusAPIClient is a client that implements the +// ListAccountAssignmentDeletionStatus operation. +type ListAccountAssignmentDeletionStatusAPIClient interface { + ListAccountAssignmentDeletionStatus(context.Context, *ListAccountAssignmentDeletionStatusInput, ...func(*Options)) (*ListAccountAssignmentDeletionStatusOutput, error) +} + +var _ ListAccountAssignmentDeletionStatusAPIClient = (*Client)(nil) + +// ListAccountAssignmentDeletionStatusPaginatorOptions is the paginator options for +// ListAccountAssignmentDeletionStatus +type ListAccountAssignmentDeletionStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListAccountAssignmentDeletionStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignmentDeletionStatus +type ListAccountAssignmentDeletionStatusPaginator struct { + options ListAccountAssignmentDeletionStatusPaginatorOptions + client ListAccountAssignmentDeletionStatusAPIClient + params *ListAccountAssignmentDeletionStatusInput + nextToken *string + firstPage bool +} + +// NewListAccountAssignmentDeletionStatusPaginator returns a new +// ListAccountAssignmentDeletionStatusPaginator +func NewListAccountAssignmentDeletionStatusPaginator(client ListAccountAssignmentDeletionStatusAPIClient, params *ListAccountAssignmentDeletionStatusInput, optFns ...func(*ListAccountAssignmentDeletionStatusPaginatorOptions)) *ListAccountAssignmentDeletionStatusPaginator { + options := ListAccountAssignmentDeletionStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentDeletionStatusInput{} + } + + return &ListAccountAssignmentDeletionStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentDeletionStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountAssignmentDeletionStatus page. +func (p *ListAccountAssignmentDeletionStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentDeletionStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountAssignmentDeletionStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignmentDeletionStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountAssignments.go b/service/ssoadmin/api_op_ListAccountAssignments.go index b92da8c6ba3..4d61958bfeb 100644 --- a/service/ssoadmin/api_op_ListAccountAssignments.go +++ b/service/ssoadmin/api_op_ListAccountAssignments.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -128,6 +129,88 @@ func addOperationListAccountAssignmentsMiddlewares(stack *middleware.Stack, opti return nil } +// ListAccountAssignmentsAPIClient is a client that implements the +// ListAccountAssignments operation. +type ListAccountAssignmentsAPIClient interface { + ListAccountAssignments(context.Context, *ListAccountAssignmentsInput, ...func(*Options)) (*ListAccountAssignmentsOutput, error) +} + +var _ ListAccountAssignmentsAPIClient = (*Client)(nil) + +// ListAccountAssignmentsPaginatorOptions is the paginator options for +// ListAccountAssignments +type ListAccountAssignmentsPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListAccountAssignmentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountAssignments +type ListAccountAssignmentsPaginator struct { + options ListAccountAssignmentsPaginatorOptions + client ListAccountAssignmentsAPIClient + params *ListAccountAssignmentsInput + nextToken *string + firstPage bool +} + +// NewListAccountAssignmentsPaginator returns a new ListAccountAssignmentsPaginator +func NewListAccountAssignmentsPaginator(client ListAccountAssignmentsAPIClient, params *ListAccountAssignmentsInput, optFns ...func(*ListAccountAssignmentsPaginatorOptions)) *ListAccountAssignmentsPaginator { + options := ListAccountAssignmentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountAssignmentsInput{} + } + + return &ListAccountAssignmentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountAssignmentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountAssignments page. +func (p *ListAccountAssignmentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountAssignmentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountAssignments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountAssignments(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go b/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go index 729e596336d..f2abb17958d 100644 --- a/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go +++ b/service/ssoadmin/api_op_ListAccountsForProvisionedPermissionSet.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -126,6 +127,89 @@ func addOperationListAccountsForProvisionedPermissionSetMiddlewares(stack *middl return nil } +// ListAccountsForProvisionedPermissionSetAPIClient is a client that implements the +// ListAccountsForProvisionedPermissionSet operation. +type ListAccountsForProvisionedPermissionSetAPIClient interface { + ListAccountsForProvisionedPermissionSet(context.Context, *ListAccountsForProvisionedPermissionSetInput, ...func(*Options)) (*ListAccountsForProvisionedPermissionSetOutput, error) +} + +var _ ListAccountsForProvisionedPermissionSetAPIClient = (*Client)(nil) + +// ListAccountsForProvisionedPermissionSetPaginatorOptions is the paginator options +// for ListAccountsForProvisionedPermissionSet +type ListAccountsForProvisionedPermissionSetPaginatorOptions struct { + // The maximum number of results to display for the PermissionSet. + 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 +} + +// ListAccountsForProvisionedPermissionSetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListAccountsForProvisionedPermissionSet +type ListAccountsForProvisionedPermissionSetPaginator struct { + options ListAccountsForProvisionedPermissionSetPaginatorOptions + client ListAccountsForProvisionedPermissionSetAPIClient + params *ListAccountsForProvisionedPermissionSetInput + nextToken *string + firstPage bool +} + +// NewListAccountsForProvisionedPermissionSetPaginator returns a new +// ListAccountsForProvisionedPermissionSetPaginator +func NewListAccountsForProvisionedPermissionSetPaginator(client ListAccountsForProvisionedPermissionSetAPIClient, params *ListAccountsForProvisionedPermissionSetInput, optFns ...func(*ListAccountsForProvisionedPermissionSetPaginatorOptions)) *ListAccountsForProvisionedPermissionSetPaginator { + options := ListAccountsForProvisionedPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAccountsForProvisionedPermissionSetInput{} + } + + return &ListAccountsForProvisionedPermissionSetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAccountsForProvisionedPermissionSetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAccountsForProvisionedPermissionSet page. +func (p *ListAccountsForProvisionedPermissionSetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForProvisionedPermissionSetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAccountsForProvisionedPermissionSet(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAccountsForProvisionedPermissionSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListInstances.go b/service/ssoadmin/api_op_ListInstances.go index 1b17585ca36..63748b163ab 100644 --- a/service/ssoadmin/api_op_ListInstances.go +++ b/service/ssoadmin/api_op_ListInstances.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -107,6 +108,86 @@ func addOperationListInstancesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListInstancesAPIClient is a client that implements the ListInstances operation. +type ListInstancesAPIClient interface { + ListInstances(context.Context, *ListInstancesInput, ...func(*Options)) (*ListInstancesOutput, error) +} + +var _ ListInstancesAPIClient = (*Client)(nil) + +// ListInstancesPaginatorOptions is the paginator options for ListInstances +type ListInstancesPaginatorOptions struct { + // The maximum number of results to display for the instance. + 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 +} + +// ListInstancesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListInstances +type ListInstancesPaginator struct { + options ListInstancesPaginatorOptions + client ListInstancesAPIClient + params *ListInstancesInput + nextToken *string + firstPage bool +} + +// NewListInstancesPaginator returns a new ListInstancesPaginator +func NewListInstancesPaginator(client ListInstancesAPIClient, params *ListInstancesInput, optFns ...func(*ListInstancesPaginatorOptions)) *ListInstancesPaginator { + options := ListInstancesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstancesInput{} + } + + return &ListInstancesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstancesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstances page. +func (p *ListInstancesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstancesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListInstances(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListInstances(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go b/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go index 593ef4a3d2e..5170a87bffa 100644 --- a/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go +++ b/service/ssoadmin/api_op_ListManagedPoliciesInPermissionSet.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -122,6 +123,89 @@ func addOperationListManagedPoliciesInPermissionSetMiddlewares(stack *middleware return nil } +// ListManagedPoliciesInPermissionSetAPIClient is a client that implements the +// ListManagedPoliciesInPermissionSet operation. +type ListManagedPoliciesInPermissionSetAPIClient interface { + ListManagedPoliciesInPermissionSet(context.Context, *ListManagedPoliciesInPermissionSetInput, ...func(*Options)) (*ListManagedPoliciesInPermissionSetOutput, error) +} + +var _ ListManagedPoliciesInPermissionSetAPIClient = (*Client)(nil) + +// ListManagedPoliciesInPermissionSetPaginatorOptions is the paginator options for +// ListManagedPoliciesInPermissionSet +type ListManagedPoliciesInPermissionSetPaginatorOptions struct { + // The maximum number of results to display for the PermissionSet. + 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 +} + +// ListManagedPoliciesInPermissionSetPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListManagedPoliciesInPermissionSet +type ListManagedPoliciesInPermissionSetPaginator struct { + options ListManagedPoliciesInPermissionSetPaginatorOptions + client ListManagedPoliciesInPermissionSetAPIClient + params *ListManagedPoliciesInPermissionSetInput + nextToken *string + firstPage bool +} + +// NewListManagedPoliciesInPermissionSetPaginator returns a new +// ListManagedPoliciesInPermissionSetPaginator +func NewListManagedPoliciesInPermissionSetPaginator(client ListManagedPoliciesInPermissionSetAPIClient, params *ListManagedPoliciesInPermissionSetInput, optFns ...func(*ListManagedPoliciesInPermissionSetPaginatorOptions)) *ListManagedPoliciesInPermissionSetPaginator { + options := ListManagedPoliciesInPermissionSetPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListManagedPoliciesInPermissionSetInput{} + } + + return &ListManagedPoliciesInPermissionSetPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListManagedPoliciesInPermissionSetPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListManagedPoliciesInPermissionSet page. +func (p *ListManagedPoliciesInPermissionSetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListManagedPoliciesInPermissionSetOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListManagedPoliciesInPermissionSet(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListManagedPoliciesInPermissionSet(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go b/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go index a6281cb7f6c..15c8fef3ec5 100644 --- a/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go +++ b/service/ssoadmin/api_op_ListPermissionSetProvisioningStatus.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -121,6 +122,89 @@ func addOperationListPermissionSetProvisioningStatusMiddlewares(stack *middlewar return nil } +// ListPermissionSetProvisioningStatusAPIClient is a client that implements the +// ListPermissionSetProvisioningStatus operation. +type ListPermissionSetProvisioningStatusAPIClient interface { + ListPermissionSetProvisioningStatus(context.Context, *ListPermissionSetProvisioningStatusInput, ...func(*Options)) (*ListPermissionSetProvisioningStatusOutput, error) +} + +var _ ListPermissionSetProvisioningStatusAPIClient = (*Client)(nil) + +// ListPermissionSetProvisioningStatusPaginatorOptions is the paginator options for +// ListPermissionSetProvisioningStatus +type ListPermissionSetProvisioningStatusPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListPermissionSetProvisioningStatusPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSetProvisioningStatus +type ListPermissionSetProvisioningStatusPaginator struct { + options ListPermissionSetProvisioningStatusPaginatorOptions + client ListPermissionSetProvisioningStatusAPIClient + params *ListPermissionSetProvisioningStatusInput + nextToken *string + firstPage bool +} + +// NewListPermissionSetProvisioningStatusPaginator returns a new +// ListPermissionSetProvisioningStatusPaginator +func NewListPermissionSetProvisioningStatusPaginator(client ListPermissionSetProvisioningStatusAPIClient, params *ListPermissionSetProvisioningStatusInput, optFns ...func(*ListPermissionSetProvisioningStatusPaginatorOptions)) *ListPermissionSetProvisioningStatusPaginator { + options := ListPermissionSetProvisioningStatusPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetProvisioningStatusInput{} + } + + return &ListPermissionSetProvisioningStatusPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetProvisioningStatusPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPermissionSetProvisioningStatus page. +func (p *ListPermissionSetProvisioningStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetProvisioningStatusOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPermissionSetProvisioningStatus(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSetProvisioningStatus(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSets.go b/service/ssoadmin/api_op_ListPermissionSets.go index 2df92a4a793..8c2d6cd62d6 100644 --- a/service/ssoadmin/api_op_ListPermissionSets.go +++ b/service/ssoadmin/api_op_ListPermissionSets.go @@ -4,6 +4,7 @@ package ssoadmin 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/awslabs/smithy-go/middleware" @@ -116,6 +117,88 @@ func addOperationListPermissionSetsMiddlewares(stack *middleware.Stack, options return nil } +// ListPermissionSetsAPIClient is a client that implements the ListPermissionSets +// operation. +type ListPermissionSetsAPIClient interface { + ListPermissionSets(context.Context, *ListPermissionSetsInput, ...func(*Options)) (*ListPermissionSetsOutput, error) +} + +var _ ListPermissionSetsAPIClient = (*Client)(nil) + +// ListPermissionSetsPaginatorOptions is the paginator options for +// ListPermissionSets +type ListPermissionSetsPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListPermissionSetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSets +type ListPermissionSetsPaginator struct { + options ListPermissionSetsPaginatorOptions + client ListPermissionSetsAPIClient + params *ListPermissionSetsInput + nextToken *string + firstPage bool +} + +// NewListPermissionSetsPaginator returns a new ListPermissionSetsPaginator +func NewListPermissionSetsPaginator(client ListPermissionSetsAPIClient, params *ListPermissionSetsInput, optFns ...func(*ListPermissionSetsPaginatorOptions)) *ListPermissionSetsPaginator { + options := ListPermissionSetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetsInput{} + } + + return &ListPermissionSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPermissionSets page. +func (p *ListPermissionSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPermissionSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go b/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go index 8469f83888f..562ecb2a787 100644 --- a/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go +++ b/service/ssoadmin/api_op_ListPermissionSetsProvisionedToAccount.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -125,6 +126,89 @@ func addOperationListPermissionSetsProvisionedToAccountMiddlewares(stack *middle return nil } +// ListPermissionSetsProvisionedToAccountAPIClient is a client that implements the +// ListPermissionSetsProvisionedToAccount operation. +type ListPermissionSetsProvisionedToAccountAPIClient interface { + ListPermissionSetsProvisionedToAccount(context.Context, *ListPermissionSetsProvisionedToAccountInput, ...func(*Options)) (*ListPermissionSetsProvisionedToAccountOutput, error) +} + +var _ ListPermissionSetsProvisionedToAccountAPIClient = (*Client)(nil) + +// ListPermissionSetsProvisionedToAccountPaginatorOptions is the paginator options +// for ListPermissionSetsProvisionedToAccount +type ListPermissionSetsProvisionedToAccountPaginatorOptions struct { + // The maximum number of results to display for the assignment. + 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 +} + +// ListPermissionSetsProvisionedToAccountPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListPermissionSetsProvisionedToAccount +type ListPermissionSetsProvisionedToAccountPaginator struct { + options ListPermissionSetsProvisionedToAccountPaginatorOptions + client ListPermissionSetsProvisionedToAccountAPIClient + params *ListPermissionSetsProvisionedToAccountInput + nextToken *string + firstPage bool +} + +// NewListPermissionSetsProvisionedToAccountPaginator returns a new +// ListPermissionSetsProvisionedToAccountPaginator +func NewListPermissionSetsProvisionedToAccountPaginator(client ListPermissionSetsProvisionedToAccountAPIClient, params *ListPermissionSetsProvisionedToAccountInput, optFns ...func(*ListPermissionSetsProvisionedToAccountPaginatorOptions)) *ListPermissionSetsProvisionedToAccountPaginator { + options := ListPermissionSetsProvisionedToAccountPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListPermissionSetsProvisionedToAccountInput{} + } + + return &ListPermissionSetsProvisionedToAccountPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPermissionSetsProvisionedToAccountPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListPermissionSetsProvisionedToAccount page. +func (p *ListPermissionSetsProvisionedToAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionSetsProvisionedToAccountOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListPermissionSetsProvisionedToAccount(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListPermissionSetsProvisionedToAccount(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/api_op_ListTagsForResource.go b/service/ssoadmin/api_op_ListTagsForResource.go index 0c74f0d2b54..e4b967ba60a 100644 --- a/service/ssoadmin/api_op_ListTagsForResource.go +++ b/service/ssoadmin/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package ssoadmin 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/ssoadmin/types" @@ -119,6 +120,81 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/ssoadmin.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssoadmin/endpoints.go b/service/ssoadmin/endpoints.go index c11ccdf6050..3720c3175ec 100644 --- a/service/ssoadmin/endpoints.go +++ b/service/ssoadmin/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/ssooidc/endpoints.go b/service/ssooidc/endpoints.go index e20c519b076..a4967ae790f 100644 --- a/service/ssooidc/endpoints.go +++ b/service/ssooidc/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/storagegateway/api_op_DescribeTapeArchives.go b/service/storagegateway/api_op_DescribeTapeArchives.go index 637941acdff..22ecec4b602 100644 --- a/service/storagegateway/api_op_DescribeTapeArchives.go +++ b/service/storagegateway/api_op_DescribeTapeArchives.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -124,6 +125,89 @@ func addOperationDescribeTapeArchivesMiddlewares(stack *middleware.Stack, option return nil } +// DescribeTapeArchivesAPIClient is a client that implements the +// DescribeTapeArchives operation. +type DescribeTapeArchivesAPIClient interface { + DescribeTapeArchives(context.Context, *DescribeTapeArchivesInput, ...func(*Options)) (*DescribeTapeArchivesOutput, error) +} + +var _ DescribeTapeArchivesAPIClient = (*Client)(nil) + +// DescribeTapeArchivesPaginatorOptions is the paginator options for +// DescribeTapeArchives +type DescribeTapeArchivesPaginatorOptions struct { + // Specifies that the number of virtual tapes described be limited to the specified + // number. + 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 +} + +// DescribeTapeArchivesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapeArchives +type DescribeTapeArchivesPaginator struct { + options DescribeTapeArchivesPaginatorOptions + client DescribeTapeArchivesAPIClient + params *DescribeTapeArchivesInput + nextToken *string + firstPage bool +} + +// NewDescribeTapeArchivesPaginator returns a new DescribeTapeArchivesPaginator +func NewDescribeTapeArchivesPaginator(client DescribeTapeArchivesAPIClient, params *DescribeTapeArchivesInput, optFns ...func(*DescribeTapeArchivesPaginatorOptions)) *DescribeTapeArchivesPaginator { + options := DescribeTapeArchivesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapeArchivesInput{} + } + + return &DescribeTapeArchivesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapeArchivesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTapeArchives page. +func (p *DescribeTapeArchivesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeArchivesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeTapeArchives(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapeArchives(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go b/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go index 765bb034f59..70a87d70b90 100644 --- a/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go +++ b/service/storagegateway/api_op_DescribeTapeRecoveryPoints.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -130,6 +131,90 @@ func addOperationDescribeTapeRecoveryPointsMiddlewares(stack *middleware.Stack, return nil } +// DescribeTapeRecoveryPointsAPIClient is a client that implements the +// DescribeTapeRecoveryPoints operation. +type DescribeTapeRecoveryPointsAPIClient interface { + DescribeTapeRecoveryPoints(context.Context, *DescribeTapeRecoveryPointsInput, ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) +} + +var _ DescribeTapeRecoveryPointsAPIClient = (*Client)(nil) + +// DescribeTapeRecoveryPointsPaginatorOptions is the paginator options for +// DescribeTapeRecoveryPoints +type DescribeTapeRecoveryPointsPaginatorOptions struct { + // Specifies that the number of virtual tape recovery points that are described be + // limited to the specified number. + 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 +} + +// DescribeTapeRecoveryPointsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapeRecoveryPoints +type DescribeTapeRecoveryPointsPaginator struct { + options DescribeTapeRecoveryPointsPaginatorOptions + client DescribeTapeRecoveryPointsAPIClient + params *DescribeTapeRecoveryPointsInput + nextToken *string + firstPage bool +} + +// NewDescribeTapeRecoveryPointsPaginator returns a new +// DescribeTapeRecoveryPointsPaginator +func NewDescribeTapeRecoveryPointsPaginator(client DescribeTapeRecoveryPointsAPIClient, params *DescribeTapeRecoveryPointsInput, optFns ...func(*DescribeTapeRecoveryPointsPaginatorOptions)) *DescribeTapeRecoveryPointsPaginator { + options := DescribeTapeRecoveryPointsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapeRecoveryPointsInput{} + } + + return &DescribeTapeRecoveryPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapeRecoveryPointsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTapeRecoveryPoints page. +func (p *DescribeTapeRecoveryPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapeRecoveryPointsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeTapeRecoveryPoints(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapeRecoveryPoints(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeTapes.go b/service/storagegateway/api_op_DescribeTapes.go index c174055cd3c..2d970387f89 100644 --- a/service/storagegateway/api_op_DescribeTapes.go +++ b/service/storagegateway/api_op_DescribeTapes.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -130,6 +131,87 @@ func addOperationDescribeTapesMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeTapesAPIClient is a client that implements the DescribeTapes operation. +type DescribeTapesAPIClient interface { + DescribeTapes(context.Context, *DescribeTapesInput, ...func(*Options)) (*DescribeTapesOutput, error) +} + +var _ DescribeTapesAPIClient = (*Client)(nil) + +// DescribeTapesPaginatorOptions is the paginator options for DescribeTapes +type DescribeTapesPaginatorOptions struct { + // Specifies that the number of virtual tapes described be limited to the specified + // number. Amazon Web Services may impose its own limit, if this field is not set. + 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 +} + +// DescribeTapesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeTapes +type DescribeTapesPaginator struct { + options DescribeTapesPaginatorOptions + client DescribeTapesAPIClient + params *DescribeTapesInput + nextToken *string + firstPage bool +} + +// NewDescribeTapesPaginator returns a new DescribeTapesPaginator +func NewDescribeTapesPaginator(client DescribeTapesAPIClient, params *DescribeTapesInput, optFns ...func(*DescribeTapesPaginatorOptions)) *DescribeTapesPaginator { + options := DescribeTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeTapesInput{} + } + + return &DescribeTapesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeTapesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeTapes page. +func (p *DescribeTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeTapesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeTapes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeTapes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_DescribeVTLDevices.go b/service/storagegateway/api_op_DescribeVTLDevices.go index 9afb5b6f250..f0c7d4a877f 100644 --- a/service/storagegateway/api_op_DescribeVTLDevices.go +++ b/service/storagegateway/api_op_DescribeVTLDevices.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -134,6 +135,89 @@ func addOperationDescribeVTLDevicesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeVTLDevicesAPIClient is a client that implements the DescribeVTLDevices +// operation. +type DescribeVTLDevicesAPIClient interface { + DescribeVTLDevices(context.Context, *DescribeVTLDevicesInput, ...func(*Options)) (*DescribeVTLDevicesOutput, error) +} + +var _ DescribeVTLDevicesAPIClient = (*Client)(nil) + +// DescribeVTLDevicesPaginatorOptions is the paginator options for +// DescribeVTLDevices +type DescribeVTLDevicesPaginatorOptions struct { + // Specifies that the number of VTL devices described be limited to the specified + // number. + 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 +} + +// DescribeVTLDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.DescribeVTLDevices +type DescribeVTLDevicesPaginator struct { + options DescribeVTLDevicesPaginatorOptions + client DescribeVTLDevicesAPIClient + params *DescribeVTLDevicesInput + nextToken *string + firstPage bool +} + +// NewDescribeVTLDevicesPaginator returns a new DescribeVTLDevicesPaginator +func NewDescribeVTLDevicesPaginator(client DescribeVTLDevicesAPIClient, params *DescribeVTLDevicesInput, optFns ...func(*DescribeVTLDevicesPaginatorOptions)) *DescribeVTLDevicesPaginator { + options := DescribeVTLDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeVTLDevicesInput{} + } + + return &DescribeVTLDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeVTLDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeVTLDevices page. +func (p *DescribeVTLDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeVTLDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeVTLDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeVTLDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListFileShares.go b/service/storagegateway/api_op_ListFileShares.go index 5ccbfe047dd..8c4bcc0a635 100644 --- a/service/storagegateway/api_op_ListFileShares.go +++ b/service/storagegateway/api_op_ListFileShares.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -122,6 +123,88 @@ func addOperationListFileSharesMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListFileSharesAPIClient is a client that implements the ListFileShares +// operation. +type ListFileSharesAPIClient interface { + ListFileShares(context.Context, *ListFileSharesInput, ...func(*Options)) (*ListFileSharesOutput, error) +} + +var _ ListFileSharesAPIClient = (*Client)(nil) + +// ListFileSharesPaginatorOptions is the paginator options for ListFileShares +type ListFileSharesPaginatorOptions struct { + // The maximum number of file shares to return in the response. The value must be + // an integer with a value greater than zero. Optional. + 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 +} + +// ListFileSharesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListFileShares +type ListFileSharesPaginator struct { + options ListFileSharesPaginatorOptions + client ListFileSharesAPIClient + params *ListFileSharesInput + nextToken *string + firstPage bool +} + +// NewListFileSharesPaginator returns a new ListFileSharesPaginator +func NewListFileSharesPaginator(client ListFileSharesAPIClient, params *ListFileSharesInput, optFns ...func(*ListFileSharesPaginatorOptions)) *ListFileSharesPaginator { + options := ListFileSharesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFileSharesInput{} + } + + return &ListFileSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFileSharesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFileShares page. +func (p *ListFileSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFileSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListFileShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextMarker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFileShares(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListGateways.go b/service/storagegateway/api_op_ListGateways.go index c037e9eff7e..10998d943d8 100644 --- a/service/storagegateway/api_op_ListGateways.go +++ b/service/storagegateway/api_op_ListGateways.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -122,6 +123,87 @@ func addOperationListGatewaysMiddlewares(stack *middleware.Stack, options Option return nil } +// ListGatewaysAPIClient is a client that implements the ListGateways operation. +type ListGatewaysAPIClient interface { + ListGateways(context.Context, *ListGatewaysInput, ...func(*Options)) (*ListGatewaysOutput, error) +} + +var _ ListGatewaysAPIClient = (*Client)(nil) + +// ListGatewaysPaginatorOptions is the paginator options for ListGateways +type ListGatewaysPaginatorOptions struct { + // Specifies that the list of gateways returned be limited to the specified number + // of items. + 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 +} + +// ListGatewaysPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListGateways +type ListGatewaysPaginator struct { + options ListGatewaysPaginatorOptions + client ListGatewaysAPIClient + params *ListGatewaysInput + nextToken *string + firstPage bool +} + +// NewListGatewaysPaginator returns a new ListGatewaysPaginator +func NewListGatewaysPaginator(client ListGatewaysAPIClient, params *ListGatewaysInput, optFns ...func(*ListGatewaysPaginatorOptions)) *ListGatewaysPaginator { + options := ListGatewaysPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGatewaysInput{} + } + + return &ListGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGateways page. +func (p *ListGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGateways(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListTagsForResource.go b/service/storagegateway/api_op_ListTagsForResource.go index 03e6ab3338b..7999e0e6f53 100644 --- a/service/storagegateway/api_op_ListTagsForResource.go +++ b/service/storagegateway/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -122,6 +123,89 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Specifies that the list of tags returned be limited to the specified number of + // items. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListTapes.go b/service/storagegateway/api_op_ListTapes.go index 1db31a240af..ba468344db7 100644 --- a/service/storagegateway/api_op_ListTapes.go +++ b/service/storagegateway/api_op_ListTapes.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -138,6 +139,86 @@ func addOperationListTapesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTapesAPIClient is a client that implements the ListTapes operation. +type ListTapesAPIClient interface { + ListTapes(context.Context, *ListTapesInput, ...func(*Options)) (*ListTapesOutput, error) +} + +var _ ListTapesAPIClient = (*Client)(nil) + +// ListTapesPaginatorOptions is the paginator options for ListTapes +type ListTapesPaginatorOptions struct { + // An optional number limit for the tapes in the list returned by this call. + 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 +} + +// ListTapesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListTapes +type ListTapesPaginator struct { + options ListTapesPaginatorOptions + client ListTapesAPIClient + params *ListTapesInput + nextToken *string + firstPage bool +} + +// NewListTapesPaginator returns a new ListTapesPaginator +func NewListTapesPaginator(client ListTapesAPIClient, params *ListTapesInput, optFns ...func(*ListTapesPaginatorOptions)) *ListTapesPaginator { + options := ListTapesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTapesInput{} + } + + return &ListTapesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTapesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTapes page. +func (p *ListTapesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTapesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListTapes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTapes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/api_op_ListVolumes.go b/service/storagegateway/api_op_ListVolumes.go index 839834b5c45..c53a60fcf16 100644 --- a/service/storagegateway/api_op_ListVolumes.go +++ b/service/storagegateway/api_op_ListVolumes.go @@ -4,6 +4,7 @@ package storagegateway 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/storagegateway/types" @@ -140,6 +141,87 @@ func addOperationListVolumesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListVolumesAPIClient is a client that implements the ListVolumes operation. +type ListVolumesAPIClient interface { + ListVolumes(context.Context, *ListVolumesInput, ...func(*Options)) (*ListVolumesOutput, error) +} + +var _ ListVolumesAPIClient = (*Client)(nil) + +// ListVolumesPaginatorOptions is the paginator options for ListVolumes +type ListVolumesPaginatorOptions struct { + // Specifies that the list of volumes returned be limited to the specified number + // of items. + 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 +} + +// ListVolumesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/storagegateway.ListVolumes +type ListVolumesPaginator struct { + options ListVolumesPaginatorOptions + client ListVolumesAPIClient + params *ListVolumesInput + nextToken *string + firstPage bool +} + +// NewListVolumesPaginator returns a new ListVolumesPaginator +func NewListVolumesPaginator(client ListVolumesAPIClient, params *ListVolumesInput, optFns ...func(*ListVolumesPaginatorOptions)) *ListVolumesPaginator { + options := ListVolumesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVolumesInput{} + } + + return &ListVolumesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVolumesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVolumes page. +func (p *ListVolumesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVolumesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.ListVolumes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVolumes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/storagegateway/endpoints.go b/service/storagegateway/endpoints.go index 58ed7fa6538..cf8f9b88a52 100644 --- a/service/storagegateway/endpoints.go +++ b/service/storagegateway/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/sts/endpoints.go b/service/sts/endpoints.go index 2586eab70a0..e477319c0c2 100644 --- a/service/sts/endpoints.go +++ b/service/sts/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/support/api_op_DescribeCases.go b/service/support/api_op_DescribeCases.go index dc0112319f2..324f4dba2fd 100644 --- a/service/support/api_op_DescribeCases.go +++ b/service/support/api_op_DescribeCases.go @@ -4,6 +4,7 @@ package support 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/support/types" @@ -160,6 +161,86 @@ func addOperationDescribeCasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeCasesAPIClient is a client that implements the DescribeCases operation. +type DescribeCasesAPIClient interface { + DescribeCases(context.Context, *DescribeCasesInput, ...func(*Options)) (*DescribeCasesOutput, error) +} + +var _ DescribeCasesAPIClient = (*Client)(nil) + +// DescribeCasesPaginatorOptions is the paginator options for DescribeCases +type DescribeCasesPaginatorOptions struct { + // The maximum number of results to return before paginating. + 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 +} + +// DescribeCasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/support.DescribeCases +type DescribeCasesPaginator struct { + options DescribeCasesPaginatorOptions + client DescribeCasesAPIClient + params *DescribeCasesInput + nextToken *string + firstPage bool +} + +// NewDescribeCasesPaginator returns a new DescribeCasesPaginator +func NewDescribeCasesPaginator(client DescribeCasesAPIClient, params *DescribeCasesInput, optFns ...func(*DescribeCasesPaginatorOptions)) *DescribeCasesPaginator { + options := DescribeCasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCasesInput{} + } + + return &DescribeCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCases page. +func (p *DescribeCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/support/api_op_DescribeCommunications.go b/service/support/api_op_DescribeCommunications.go index 8c6bfd94c4a..5ead63bbaae 100644 --- a/service/support/api_op_DescribeCommunications.go +++ b/service/support/api_op_DescribeCommunications.go @@ -4,6 +4,7 @@ package support 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/support/types" @@ -140,6 +141,88 @@ func addOperationDescribeCommunicationsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeCommunicationsAPIClient is a client that implements the +// DescribeCommunications operation. +type DescribeCommunicationsAPIClient interface { + DescribeCommunications(context.Context, *DescribeCommunicationsInput, ...func(*Options)) (*DescribeCommunicationsOutput, error) +} + +var _ DescribeCommunicationsAPIClient = (*Client)(nil) + +// DescribeCommunicationsPaginatorOptions is the paginator options for +// DescribeCommunications +type DescribeCommunicationsPaginatorOptions struct { + // The maximum number of results to return before paginating. + 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 +} + +// DescribeCommunicationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/support.DescribeCommunications +type DescribeCommunicationsPaginator struct { + options DescribeCommunicationsPaginatorOptions + client DescribeCommunicationsAPIClient + params *DescribeCommunicationsInput + nextToken *string + firstPage bool +} + +// NewDescribeCommunicationsPaginator returns a new DescribeCommunicationsPaginator +func NewDescribeCommunicationsPaginator(client DescribeCommunicationsAPIClient, params *DescribeCommunicationsInput, optFns ...func(*DescribeCommunicationsPaginatorOptions)) *DescribeCommunicationsPaginator { + options := DescribeCommunicationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCommunicationsInput{} + } + + return &DescribeCommunicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCommunicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCommunications page. +func (p *DescribeCommunicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCommunicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeCommunications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCommunications(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/support/endpoints.go b/service/support/endpoints.go index 30927ce6c4b..6ff9ac46049 100644 --- a/service/support/endpoints.go +++ b/service/support/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/swf/api_op_GetWorkflowExecutionHistory.go b/service/swf/api_op_GetWorkflowExecutionHistory.go index 9dc9f23d2c7..10f12c855b2 100644 --- a/service/swf/api_op_GetWorkflowExecutionHistory.go +++ b/service/swf/api_op_GetWorkflowExecutionHistory.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -160,6 +161,90 @@ func addOperationGetWorkflowExecutionHistoryMiddlewares(stack *middleware.Stack, return nil } +// GetWorkflowExecutionHistoryAPIClient is a client that implements the +// GetWorkflowExecutionHistory operation. +type GetWorkflowExecutionHistoryAPIClient interface { + GetWorkflowExecutionHistory(context.Context, *GetWorkflowExecutionHistoryInput, ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) +} + +var _ GetWorkflowExecutionHistoryAPIClient = (*Client)(nil) + +// GetWorkflowExecutionHistoryPaginatorOptions is the paginator options for +// GetWorkflowExecutionHistory +type GetWorkflowExecutionHistoryPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// GetWorkflowExecutionHistoryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.GetWorkflowExecutionHistory +type GetWorkflowExecutionHistoryPaginator struct { + options GetWorkflowExecutionHistoryPaginatorOptions + client GetWorkflowExecutionHistoryAPIClient + params *GetWorkflowExecutionHistoryInput + nextToken *string + firstPage bool +} + +// NewGetWorkflowExecutionHistoryPaginator returns a new +// GetWorkflowExecutionHistoryPaginator +func NewGetWorkflowExecutionHistoryPaginator(client GetWorkflowExecutionHistoryAPIClient, params *GetWorkflowExecutionHistoryInput, optFns ...func(*GetWorkflowExecutionHistoryPaginatorOptions)) *GetWorkflowExecutionHistoryPaginator { + options := GetWorkflowExecutionHistoryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetWorkflowExecutionHistoryInput{} + } + + return &GetWorkflowExecutionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetWorkflowExecutionHistoryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetWorkflowExecutionHistory page. +func (p *GetWorkflowExecutionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetWorkflowExecutionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.GetWorkflowExecutionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetWorkflowExecutionHistory(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListActivityTypes.go b/service/swf/api_op_ListActivityTypes.go index 1fc37d09ae6..615eb641cdf 100644 --- a/service/swf/api_op_ListActivityTypes.go +++ b/service/swf/api_op_ListActivityTypes.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -162,6 +163,88 @@ func addOperationListActivityTypesMiddlewares(stack *middleware.Stack, options O return nil } +// ListActivityTypesAPIClient is a client that implements the ListActivityTypes +// operation. +type ListActivityTypesAPIClient interface { + ListActivityTypes(context.Context, *ListActivityTypesInput, ...func(*Options)) (*ListActivityTypesOutput, error) +} + +var _ ListActivityTypesAPIClient = (*Client)(nil) + +// ListActivityTypesPaginatorOptions is the paginator options for ListActivityTypes +type ListActivityTypesPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// ListActivityTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListActivityTypes +type ListActivityTypesPaginator struct { + options ListActivityTypesPaginatorOptions + client ListActivityTypesAPIClient + params *ListActivityTypesInput + nextToken *string + firstPage bool +} + +// NewListActivityTypesPaginator returns a new ListActivityTypesPaginator +func NewListActivityTypesPaginator(client ListActivityTypesAPIClient, params *ListActivityTypesInput, optFns ...func(*ListActivityTypesPaginatorOptions)) *ListActivityTypesPaginator { + options := ListActivityTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListActivityTypesInput{} + } + + return &ListActivityTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListActivityTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListActivityTypes page. +func (p *ListActivityTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListActivityTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.ListActivityTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListActivityTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListClosedWorkflowExecutions.go b/service/swf/api_op_ListClosedWorkflowExecutions.go index b9c71af9bfc..dfbba7cb6ac 100644 --- a/service/swf/api_op_ListClosedWorkflowExecutions.go +++ b/service/swf/api_op_ListClosedWorkflowExecutions.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -201,6 +202,90 @@ func addOperationListClosedWorkflowExecutionsMiddlewares(stack *middleware.Stack return nil } +// ListClosedWorkflowExecutionsAPIClient is a client that implements the +// ListClosedWorkflowExecutions operation. +type ListClosedWorkflowExecutionsAPIClient interface { + ListClosedWorkflowExecutions(context.Context, *ListClosedWorkflowExecutionsInput, ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) +} + +var _ ListClosedWorkflowExecutionsAPIClient = (*Client)(nil) + +// ListClosedWorkflowExecutionsPaginatorOptions is the paginator options for +// ListClosedWorkflowExecutions +type ListClosedWorkflowExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// ListClosedWorkflowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListClosedWorkflowExecutions +type ListClosedWorkflowExecutionsPaginator struct { + options ListClosedWorkflowExecutionsPaginatorOptions + client ListClosedWorkflowExecutionsAPIClient + params *ListClosedWorkflowExecutionsInput + nextToken *string + firstPage bool +} + +// NewListClosedWorkflowExecutionsPaginator returns a new +// ListClosedWorkflowExecutionsPaginator +func NewListClosedWorkflowExecutionsPaginator(client ListClosedWorkflowExecutionsAPIClient, params *ListClosedWorkflowExecutionsInput, optFns ...func(*ListClosedWorkflowExecutionsPaginatorOptions)) *ListClosedWorkflowExecutionsPaginator { + options := ListClosedWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListClosedWorkflowExecutionsInput{} + } + + return &ListClosedWorkflowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListClosedWorkflowExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListClosedWorkflowExecutions page. +func (p *ListClosedWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListClosedWorkflowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.ListClosedWorkflowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListClosedWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListDomains.go b/service/swf/api_op_ListDomains.go index de5ea583343..9dfa9a6819a 100644 --- a/service/swf/api_op_ListDomains.go +++ b/service/swf/api_op_ListDomains.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -155,6 +156,87 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListOpenWorkflowExecutions.go b/service/swf/api_op_ListOpenWorkflowExecutions.go index e58decee9bb..bab8de618e4 100644 --- a/service/swf/api_op_ListOpenWorkflowExecutions.go +++ b/service/swf/api_op_ListOpenWorkflowExecutions.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -184,6 +185,90 @@ func addOperationListOpenWorkflowExecutionsMiddlewares(stack *middleware.Stack, return nil } +// ListOpenWorkflowExecutionsAPIClient is a client that implements the +// ListOpenWorkflowExecutions operation. +type ListOpenWorkflowExecutionsAPIClient interface { + ListOpenWorkflowExecutions(context.Context, *ListOpenWorkflowExecutionsInput, ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) +} + +var _ ListOpenWorkflowExecutionsAPIClient = (*Client)(nil) + +// ListOpenWorkflowExecutionsPaginatorOptions is the paginator options for +// ListOpenWorkflowExecutions +type ListOpenWorkflowExecutionsPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// ListOpenWorkflowExecutionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListOpenWorkflowExecutions +type ListOpenWorkflowExecutionsPaginator struct { + options ListOpenWorkflowExecutionsPaginatorOptions + client ListOpenWorkflowExecutionsAPIClient + params *ListOpenWorkflowExecutionsInput + nextToken *string + firstPage bool +} + +// NewListOpenWorkflowExecutionsPaginator returns a new +// ListOpenWorkflowExecutionsPaginator +func NewListOpenWorkflowExecutionsPaginator(client ListOpenWorkflowExecutionsAPIClient, params *ListOpenWorkflowExecutionsInput, optFns ...func(*ListOpenWorkflowExecutionsPaginatorOptions)) *ListOpenWorkflowExecutionsPaginator { + options := ListOpenWorkflowExecutionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOpenWorkflowExecutionsInput{} + } + + return &ListOpenWorkflowExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpenWorkflowExecutionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOpenWorkflowExecutions page. +func (p *ListOpenWorkflowExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpenWorkflowExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.ListOpenWorkflowExecutions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOpenWorkflowExecutions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_ListWorkflowTypes.go b/service/swf/api_op_ListWorkflowTypes.go index d6e10994c04..e1d464f598a 100644 --- a/service/swf/api_op_ListWorkflowTypes.go +++ b/service/swf/api_op_ListWorkflowTypes.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -159,6 +160,88 @@ func addOperationListWorkflowTypesMiddlewares(stack *middleware.Stack, options O return nil } +// ListWorkflowTypesAPIClient is a client that implements the ListWorkflowTypes +// operation. +type ListWorkflowTypesAPIClient interface { + ListWorkflowTypes(context.Context, *ListWorkflowTypesInput, ...func(*Options)) (*ListWorkflowTypesOutput, error) +} + +var _ ListWorkflowTypesAPIClient = (*Client)(nil) + +// ListWorkflowTypesPaginatorOptions is the paginator options for ListWorkflowTypes +type ListWorkflowTypesPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. + 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 +} + +// ListWorkflowTypesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.ListWorkflowTypes +type ListWorkflowTypesPaginator struct { + options ListWorkflowTypesPaginatorOptions + client ListWorkflowTypesAPIClient + params *ListWorkflowTypesInput + nextToken *string + firstPage bool +} + +// NewListWorkflowTypesPaginator returns a new ListWorkflowTypesPaginator +func NewListWorkflowTypesPaginator(client ListWorkflowTypesAPIClient, params *ListWorkflowTypesInput, optFns ...func(*ListWorkflowTypesPaginatorOptions)) *ListWorkflowTypesPaginator { + options := ListWorkflowTypesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkflowTypesInput{} + } + + return &ListWorkflowTypesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkflowTypesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkflowTypes page. +func (p *ListWorkflowTypesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkflowTypesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.ListWorkflowTypes(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWorkflowTypes(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/api_op_PollForDecisionTask.go b/service/swf/api_op_PollForDecisionTask.go index 163e8ee0dc4..1ebf1cad0c5 100644 --- a/service/swf/api_op_PollForDecisionTask.go +++ b/service/swf/api_op_PollForDecisionTask.go @@ -4,6 +4,7 @@ package swf 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/swf/types" @@ -214,6 +215,90 @@ func addOperationPollForDecisionTaskMiddlewares(stack *middleware.Stack, options return nil } +// PollForDecisionTaskAPIClient is a client that implements the PollForDecisionTask +// operation. +type PollForDecisionTaskAPIClient interface { + PollForDecisionTask(context.Context, *PollForDecisionTaskInput, ...func(*Options)) (*PollForDecisionTaskOutput, error) +} + +var _ PollForDecisionTaskAPIClient = (*Client)(nil) + +// PollForDecisionTaskPaginatorOptions is the paginator options for +// PollForDecisionTask +type PollForDecisionTaskPaginatorOptions struct { + // The maximum number of results that are returned per call. Use nextPageToken to + // obtain further pages of results. This is an upper limit only; the actual number + // of results returned per call may be fewer than the specified maximum. + 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 +} + +// PollForDecisionTaskPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/swf.PollForDecisionTask +type PollForDecisionTaskPaginator struct { + options PollForDecisionTaskPaginatorOptions + client PollForDecisionTaskAPIClient + params *PollForDecisionTaskInput + nextToken *string + firstPage bool +} + +// NewPollForDecisionTaskPaginator returns a new PollForDecisionTaskPaginator +func NewPollForDecisionTaskPaginator(client PollForDecisionTaskAPIClient, params *PollForDecisionTaskInput, optFns ...func(*PollForDecisionTaskPaginatorOptions)) *PollForDecisionTaskPaginator { + options := PollForDecisionTaskPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &PollForDecisionTaskInput{} + } + + return &PollForDecisionTaskPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *PollForDecisionTaskPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next PollForDecisionTask page. +func (p *PollForDecisionTaskPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*PollForDecisionTaskOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextPageToken = p.nextToken + if p.options.Limit > 0 { + params.MaximumPageSize = p.options.Limit + } + + result, err := p.client.PollForDecisionTask(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opPollForDecisionTask(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/swf/endpoints.go b/service/swf/endpoints.go index 8447400ea4a..68ee7272532 100644 --- a/service/swf/endpoints.go +++ b/service/swf/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/synthetics/api_op_DescribeCanaries.go b/service/synthetics/api_op_DescribeCanaries.go index 477b6da4680..dd8fad869be 100644 --- a/service/synthetics/api_op_DescribeCanaries.go +++ b/service/synthetics/api_op_DescribeCanaries.go @@ -4,6 +4,7 @@ package synthetics 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/synthetics/types" @@ -114,6 +115,89 @@ func addOperationDescribeCanariesMiddlewares(stack *middleware.Stack, options Op return nil } +// DescribeCanariesAPIClient is a client that implements the DescribeCanaries +// operation. +type DescribeCanariesAPIClient interface { + DescribeCanaries(context.Context, *DescribeCanariesInput, ...func(*Options)) (*DescribeCanariesOutput, error) +} + +var _ DescribeCanariesAPIClient = (*Client)(nil) + +// DescribeCanariesPaginatorOptions is the paginator options for DescribeCanaries +type DescribeCanariesPaginatorOptions struct { + // Specify this parameter to limit how many canaries are returned each time you use + // the DescribeCanaries operation. If you omit this parameter, the default of 100 + // is used. + 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 +} + +// DescribeCanariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeCanaries +type DescribeCanariesPaginator struct { + options DescribeCanariesPaginatorOptions + client DescribeCanariesAPIClient + params *DescribeCanariesInput + nextToken *string + firstPage bool +} + +// NewDescribeCanariesPaginator returns a new DescribeCanariesPaginator +func NewDescribeCanariesPaginator(client DescribeCanariesAPIClient, params *DescribeCanariesInput, optFns ...func(*DescribeCanariesPaginatorOptions)) *DescribeCanariesPaginator { + options := DescribeCanariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCanariesInput{} + } + + return &DescribeCanariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCanariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCanaries page. +func (p *DescribeCanariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeCanaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCanaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_DescribeCanariesLastRun.go b/service/synthetics/api_op_DescribeCanariesLastRun.go index 5221dee7bad..0b9f82de0e3 100644 --- a/service/synthetics/api_op_DescribeCanariesLastRun.go +++ b/service/synthetics/api_op_DescribeCanariesLastRun.go @@ -4,6 +4,7 @@ package synthetics 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/synthetics/types" @@ -111,6 +112,91 @@ func addOperationDescribeCanariesLastRunMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeCanariesLastRunAPIClient is a client that implements the +// DescribeCanariesLastRun operation. +type DescribeCanariesLastRunAPIClient interface { + DescribeCanariesLastRun(context.Context, *DescribeCanariesLastRunInput, ...func(*Options)) (*DescribeCanariesLastRunOutput, error) +} + +var _ DescribeCanariesLastRunAPIClient = (*Client)(nil) + +// DescribeCanariesLastRunPaginatorOptions is the paginator options for +// DescribeCanariesLastRun +type DescribeCanariesLastRunPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // DescribeLastRun operation. If you omit this parameter, the default of 100 is + // used. + 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 +} + +// DescribeCanariesLastRunPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeCanariesLastRun +type DescribeCanariesLastRunPaginator struct { + options DescribeCanariesLastRunPaginatorOptions + client DescribeCanariesLastRunAPIClient + params *DescribeCanariesLastRunInput + nextToken *string + firstPage bool +} + +// NewDescribeCanariesLastRunPaginator returns a new +// DescribeCanariesLastRunPaginator +func NewDescribeCanariesLastRunPaginator(client DescribeCanariesLastRunAPIClient, params *DescribeCanariesLastRunInput, optFns ...func(*DescribeCanariesLastRunPaginatorOptions)) *DescribeCanariesLastRunPaginator { + options := DescribeCanariesLastRunPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeCanariesLastRunInput{} + } + + return &DescribeCanariesLastRunPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCanariesLastRunPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeCanariesLastRun page. +func (p *DescribeCanariesLastRunPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCanariesLastRunOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeCanariesLastRun(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeCanariesLastRun(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_DescribeRuntimeVersions.go b/service/synthetics/api_op_DescribeRuntimeVersions.go index 9d2703945b5..c89dd1532db 100644 --- a/service/synthetics/api_op_DescribeRuntimeVersions.go +++ b/service/synthetics/api_op_DescribeRuntimeVersions.go @@ -4,6 +4,7 @@ package synthetics 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/synthetics/types" @@ -114,6 +115,91 @@ func addOperationDescribeRuntimeVersionsMiddlewares(stack *middleware.Stack, opt return nil } +// DescribeRuntimeVersionsAPIClient is a client that implements the +// DescribeRuntimeVersions operation. +type DescribeRuntimeVersionsAPIClient interface { + DescribeRuntimeVersions(context.Context, *DescribeRuntimeVersionsInput, ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) +} + +var _ DescribeRuntimeVersionsAPIClient = (*Client)(nil) + +// DescribeRuntimeVersionsPaginatorOptions is the paginator options for +// DescribeRuntimeVersions +type DescribeRuntimeVersionsPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // DescribeRuntimeVersions operation. If you omit this parameter, the default of + // 100 is used. + 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 +} + +// DescribeRuntimeVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.DescribeRuntimeVersions +type DescribeRuntimeVersionsPaginator struct { + options DescribeRuntimeVersionsPaginatorOptions + client DescribeRuntimeVersionsAPIClient + params *DescribeRuntimeVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeRuntimeVersionsPaginator returns a new +// DescribeRuntimeVersionsPaginator +func NewDescribeRuntimeVersionsPaginator(client DescribeRuntimeVersionsAPIClient, params *DescribeRuntimeVersionsInput, optFns ...func(*DescribeRuntimeVersionsPaginatorOptions)) *DescribeRuntimeVersionsPaginator { + options := DescribeRuntimeVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeRuntimeVersionsInput{} + } + + return &DescribeRuntimeVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeRuntimeVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeRuntimeVersions page. +func (p *DescribeRuntimeVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeRuntimeVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.DescribeRuntimeVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeRuntimeVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/api_op_GetCanaryRuns.go b/service/synthetics/api_op_GetCanaryRuns.go index f52b2365f6c..729cd48a8bf 100644 --- a/service/synthetics/api_op_GetCanaryRuns.go +++ b/service/synthetics/api_op_GetCanaryRuns.go @@ -4,6 +4,7 @@ package synthetics 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/synthetics/types" @@ -117,6 +118,87 @@ func addOperationGetCanaryRunsMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetCanaryRunsAPIClient is a client that implements the GetCanaryRuns operation. +type GetCanaryRunsAPIClient interface { + GetCanaryRuns(context.Context, *GetCanaryRunsInput, ...func(*Options)) (*GetCanaryRunsOutput, error) +} + +var _ GetCanaryRunsAPIClient = (*Client)(nil) + +// GetCanaryRunsPaginatorOptions is the paginator options for GetCanaryRuns +type GetCanaryRunsPaginatorOptions struct { + // Specify this parameter to limit how many runs are returned each time you use the + // GetCanaryRuns operation. If you omit this parameter, the default of 100 is used. + 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 +} + +// GetCanaryRunsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/synthetics.GetCanaryRuns +type GetCanaryRunsPaginator struct { + options GetCanaryRunsPaginatorOptions + client GetCanaryRunsAPIClient + params *GetCanaryRunsInput + nextToken *string + firstPage bool +} + +// NewGetCanaryRunsPaginator returns a new GetCanaryRunsPaginator +func NewGetCanaryRunsPaginator(client GetCanaryRunsAPIClient, params *GetCanaryRunsInput, optFns ...func(*GetCanaryRunsPaginatorOptions)) *GetCanaryRunsPaginator { + options := GetCanaryRunsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetCanaryRunsInput{} + } + + return &GetCanaryRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetCanaryRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetCanaryRuns page. +func (p *GetCanaryRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCanaryRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.GetCanaryRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetCanaryRuns(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/synthetics/endpoints.go b/service/synthetics/endpoints.go index 0e4a78db71c..12495d0688e 100644 --- a/service/synthetics/endpoints.go +++ b/service/synthetics/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/textract/endpoints.go b/service/textract/endpoints.go index ab07116a6d6..0fdbc907202 100644 --- a/service/textract/endpoints.go +++ b/service/textract/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/timestreamquery/api_op_Query.go b/service/timestreamquery/api_op_Query.go index 93a03a0cd14..3cedd340929 100644 --- a/service/timestreamquery/api_op_Query.go +++ b/service/timestreamquery/api_op_Query.go @@ -153,6 +153,89 @@ func addOperationQueryMiddlewares(stack *middleware.Stack, options Options) (err return nil } +// QueryAPIClient is a client that implements the Query operation. +type QueryAPIClient interface { + Query(context.Context, *QueryInput, ...func(*Options)) (*QueryOutput, error) +} + +var _ QueryAPIClient = (*Client)(nil) + +// QueryPaginatorOptions is the paginator options for Query +type QueryPaginatorOptions struct { + // The total number of rows to return in the output. If the total number of rows + // available is more than the value specified, a NextToken is provided in the + // command's output. To resume pagination, provide the NextToken value in the + // starting-token argument of a subsequent command. + 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 +} + +// QueryPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamquery.Query +type QueryPaginator struct { + options QueryPaginatorOptions + client QueryAPIClient + params *QueryInput + nextToken *string + firstPage bool +} + +// NewQueryPaginator returns a new QueryPaginator +func NewQueryPaginator(client QueryAPIClient, params *QueryInput, optFns ...func(*QueryPaginatorOptions)) *QueryPaginator { + options := QueryPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &QueryInput{} + } + + return &QueryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *QueryPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next Query page. +func (p *QueryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*QueryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxRows = &p.options.Limit + } + + result, err := p.client.Query(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + type idempotencyToken_initializeOpQuery struct { tokenProvider IdempotencyTokenProvider } diff --git a/service/timestreamquery/endpoints.go b/service/timestreamquery/endpoints.go index 9d652808320..d84121985cf 100644 --- a/service/timestreamquery/endpoints.go +++ b/service/timestreamquery/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/timestreamwrite/api_op_ListDatabases.go b/service/timestreamwrite/api_op_ListDatabases.go index 98ec4a6276c..e133ee35f4c 100644 --- a/service/timestreamwrite/api_op_ListDatabases.go +++ b/service/timestreamwrite/api_op_ListDatabases.go @@ -4,6 +4,7 @@ package timestreamwrite 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/timestreamwrite/types" @@ -112,6 +113,89 @@ func addOperationListDatabasesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListDatabasesAPIClient is a client that implements the ListDatabases operation. +type ListDatabasesAPIClient interface { + ListDatabases(context.Context, *ListDatabasesInput, ...func(*Options)) (*ListDatabasesOutput, error) +} + +var _ ListDatabasesAPIClient = (*Client)(nil) + +// ListDatabasesPaginatorOptions is the paginator options for ListDatabases +type ListDatabasesPaginatorOptions struct { + // The total number of items to return in the output. If the total number of items + // available is more than the value specified, a NextToken is provided in the + // output. To resume pagination, provide the NextToken value as argument of a + // subsequent API invocation. + 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 +} + +// ListDatabasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamwrite.ListDatabases +type ListDatabasesPaginator struct { + options ListDatabasesPaginatorOptions + client ListDatabasesAPIClient + params *ListDatabasesInput + nextToken *string + firstPage bool +} + +// NewListDatabasesPaginator returns a new ListDatabasesPaginator +func NewListDatabasesPaginator(client ListDatabasesAPIClient, params *ListDatabasesInput, optFns ...func(*ListDatabasesPaginatorOptions)) *ListDatabasesPaginator { + options := ListDatabasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDatabasesInput{} + } + + return &ListDatabasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDatabasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDatabases page. +func (p *ListDatabasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDatabasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDatabases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDatabases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/timestreamwrite/api_op_ListTables.go b/service/timestreamwrite/api_op_ListTables.go index bec2b7d35a1..47859fb7b1b 100644 --- a/service/timestreamwrite/api_op_ListTables.go +++ b/service/timestreamwrite/api_op_ListTables.go @@ -4,6 +4,7 @@ package timestreamwrite 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/timestreamwrite/types" @@ -114,6 +115,89 @@ func addOperationListTablesMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListTablesAPIClient is a client that implements the ListTables operation. +type ListTablesAPIClient interface { + ListTables(context.Context, *ListTablesInput, ...func(*Options)) (*ListTablesOutput, error) +} + +var _ ListTablesAPIClient = (*Client)(nil) + +// ListTablesPaginatorOptions is the paginator options for ListTables +type ListTablesPaginatorOptions struct { + // The total number of items to return in the output. If the total number of items + // available is more than the value specified, a NextToken is provided in the + // output. To resume pagination, provide the NextToken value as argument of a + // subsequent API invocation. + 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 +} + +// ListTablesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/timestreamwrite.ListTables +type ListTablesPaginator struct { + options ListTablesPaginatorOptions + client ListTablesAPIClient + params *ListTablesInput + nextToken *string + firstPage bool +} + +// NewListTablesPaginator returns a new ListTablesPaginator +func NewListTablesPaginator(client ListTablesAPIClient, params *ListTablesInput, optFns ...func(*ListTablesPaginatorOptions)) *ListTablesPaginator { + options := ListTablesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTablesInput{} + } + + return &ListTablesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTablesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTables page. +func (p *ListTablesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTablesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTables(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTables(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/timestreamwrite/endpoints.go b/service/timestreamwrite/endpoints.go index 3bab81a218f..85534c68651 100644 --- a/service/timestreamwrite/endpoints.go +++ b/service/timestreamwrite/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/transcribe/api_op_ListLanguageModels.go b/service/transcribe/api_op_ListLanguageModels.go index de8380355cb..47846a7c92a 100644 --- a/service/transcribe/api_op_ListLanguageModels.go +++ b/service/transcribe/api_op_ListLanguageModels.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -123,6 +124,89 @@ func addOperationListLanguageModelsMiddlewares(stack *middleware.Stack, options return nil } +// ListLanguageModelsAPIClient is a client that implements the ListLanguageModels +// operation. +type ListLanguageModelsAPIClient interface { + ListLanguageModels(context.Context, *ListLanguageModelsInput, ...func(*Options)) (*ListLanguageModelsOutput, error) +} + +var _ ListLanguageModelsAPIClient = (*Client)(nil) + +// ListLanguageModelsPaginatorOptions is the paginator options for +// ListLanguageModels +type ListLanguageModelsPaginatorOptions struct { + // The maximum number of language models to return in the response. If there are + // fewer results in the list, the response contains only the actual results. + 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 +} + +// ListLanguageModelsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListLanguageModels +type ListLanguageModelsPaginator struct { + options ListLanguageModelsPaginatorOptions + client ListLanguageModelsAPIClient + params *ListLanguageModelsInput + nextToken *string + firstPage bool +} + +// NewListLanguageModelsPaginator returns a new ListLanguageModelsPaginator +func NewListLanguageModelsPaginator(client ListLanguageModelsAPIClient, params *ListLanguageModelsInput, optFns ...func(*ListLanguageModelsPaginatorOptions)) *ListLanguageModelsPaginator { + options := ListLanguageModelsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLanguageModelsInput{} + } + + return &ListLanguageModelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLanguageModelsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLanguageModels page. +func (p *ListLanguageModelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLanguageModelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListLanguageModels(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListLanguageModels(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListMedicalTranscriptionJobs.go b/service/transcribe/api_op_ListMedicalTranscriptionJobs.go index a28786a2bae..fbda90862cd 100644 --- a/service/transcribe/api_op_ListMedicalTranscriptionJobs.go +++ b/service/transcribe/api_op_ListMedicalTranscriptionJobs.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -126,6 +127,91 @@ func addOperationListMedicalTranscriptionJobsMiddlewares(stack *middleware.Stack return nil } +// ListMedicalTranscriptionJobsAPIClient is a client that implements the +// ListMedicalTranscriptionJobs operation. +type ListMedicalTranscriptionJobsAPIClient interface { + ListMedicalTranscriptionJobs(context.Context, *ListMedicalTranscriptionJobsInput, ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) +} + +var _ ListMedicalTranscriptionJobsAPIClient = (*Client)(nil) + +// ListMedicalTranscriptionJobsPaginatorOptions is the paginator options for +// ListMedicalTranscriptionJobs +type ListMedicalTranscriptionJobsPaginatorOptions struct { + // The maximum number of medical transcription jobs to return in the response. IF + // there are fewer results in the list, this response contains only the actual + // results. + 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 +} + +// ListMedicalTranscriptionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListMedicalTranscriptionJobs +type ListMedicalTranscriptionJobsPaginator struct { + options ListMedicalTranscriptionJobsPaginatorOptions + client ListMedicalTranscriptionJobsAPIClient + params *ListMedicalTranscriptionJobsInput + nextToken *string + firstPage bool +} + +// NewListMedicalTranscriptionJobsPaginator returns a new +// ListMedicalTranscriptionJobsPaginator +func NewListMedicalTranscriptionJobsPaginator(client ListMedicalTranscriptionJobsAPIClient, params *ListMedicalTranscriptionJobsInput, optFns ...func(*ListMedicalTranscriptionJobsPaginatorOptions)) *ListMedicalTranscriptionJobsPaginator { + options := ListMedicalTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMedicalTranscriptionJobsInput{} + } + + return &ListMedicalTranscriptionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMedicalTranscriptionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMedicalTranscriptionJobs page. +func (p *ListMedicalTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalTranscriptionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMedicalTranscriptionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMedicalTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListMedicalVocabularies.go b/service/transcribe/api_op_ListMedicalVocabularies.go index b3ede438a12..b8851e9014d 100644 --- a/service/transcribe/api_op_ListMedicalVocabularies.go +++ b/service/transcribe/api_op_ListMedicalVocabularies.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -127,6 +128,89 @@ func addOperationListMedicalVocabulariesMiddlewares(stack *middleware.Stack, opt return nil } +// ListMedicalVocabulariesAPIClient is a client that implements the +// ListMedicalVocabularies operation. +type ListMedicalVocabulariesAPIClient interface { + ListMedicalVocabularies(context.Context, *ListMedicalVocabulariesInput, ...func(*Options)) (*ListMedicalVocabulariesOutput, error) +} + +var _ ListMedicalVocabulariesAPIClient = (*Client)(nil) + +// ListMedicalVocabulariesPaginatorOptions is the paginator options for +// ListMedicalVocabularies +type ListMedicalVocabulariesPaginatorOptions struct { + // The maximum number of vocabularies to return in the response. + 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 +} + +// ListMedicalVocabulariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListMedicalVocabularies +type ListMedicalVocabulariesPaginator struct { + options ListMedicalVocabulariesPaginatorOptions + client ListMedicalVocabulariesAPIClient + params *ListMedicalVocabulariesInput + nextToken *string + firstPage bool +} + +// NewListMedicalVocabulariesPaginator returns a new +// ListMedicalVocabulariesPaginator +func NewListMedicalVocabulariesPaginator(client ListMedicalVocabulariesAPIClient, params *ListMedicalVocabulariesInput, optFns ...func(*ListMedicalVocabulariesPaginatorOptions)) *ListMedicalVocabulariesPaginator { + options := ListMedicalVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMedicalVocabulariesInput{} + } + + return &ListMedicalVocabulariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMedicalVocabulariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMedicalVocabularies page. +func (p *ListMedicalVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMedicalVocabulariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMedicalVocabularies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMedicalVocabularies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListTranscriptionJobs.go b/service/transcribe/api_op_ListTranscriptionJobs.go index 74d5b086f0a..8309ba84adc 100644 --- a/service/transcribe/api_op_ListTranscriptionJobs.go +++ b/service/transcribe/api_op_ListTranscriptionJobs.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -124,6 +125,89 @@ func addOperationListTranscriptionJobsMiddlewares(stack *middleware.Stack, optio return nil } +// ListTranscriptionJobsAPIClient is a client that implements the +// ListTranscriptionJobs operation. +type ListTranscriptionJobsAPIClient interface { + ListTranscriptionJobs(context.Context, *ListTranscriptionJobsInput, ...func(*Options)) (*ListTranscriptionJobsOutput, error) +} + +var _ ListTranscriptionJobsAPIClient = (*Client)(nil) + +// ListTranscriptionJobsPaginatorOptions is the paginator options for +// ListTranscriptionJobs +type ListTranscriptionJobsPaginatorOptions struct { + // The maximum number of jobs to return in the response. If there are fewer results + // in the list, this response contains only the actual results. + 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 +} + +// ListTranscriptionJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListTranscriptionJobs +type ListTranscriptionJobsPaginator struct { + options ListTranscriptionJobsPaginatorOptions + client ListTranscriptionJobsAPIClient + params *ListTranscriptionJobsInput + nextToken *string + firstPage bool +} + +// NewListTranscriptionJobsPaginator returns a new ListTranscriptionJobsPaginator +func NewListTranscriptionJobsPaginator(client ListTranscriptionJobsAPIClient, params *ListTranscriptionJobsInput, optFns ...func(*ListTranscriptionJobsPaginatorOptions)) *ListTranscriptionJobsPaginator { + options := ListTranscriptionJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTranscriptionJobsInput{} + } + + return &ListTranscriptionJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTranscriptionJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTranscriptionJobs page. +func (p *ListTranscriptionJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTranscriptionJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTranscriptionJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTranscriptionJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListVocabularies.go b/service/transcribe/api_op_ListVocabularies.go index 1e5f12844e3..026170c3b79 100644 --- a/service/transcribe/api_op_ListVocabularies.go +++ b/service/transcribe/api_op_ListVocabularies.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -126,6 +127,88 @@ func addOperationListVocabulariesMiddlewares(stack *middleware.Stack, options Op return nil } +// ListVocabulariesAPIClient is a client that implements the ListVocabularies +// operation. +type ListVocabulariesAPIClient interface { + ListVocabularies(context.Context, *ListVocabulariesInput, ...func(*Options)) (*ListVocabulariesOutput, error) +} + +var _ ListVocabulariesAPIClient = (*Client)(nil) + +// ListVocabulariesPaginatorOptions is the paginator options for ListVocabularies +type ListVocabulariesPaginatorOptions struct { + // The maximum number of vocabularies to return in the response. If there are fewer + // results in the list, this response contains only the actual results. + 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 +} + +// ListVocabulariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListVocabularies +type ListVocabulariesPaginator struct { + options ListVocabulariesPaginatorOptions + client ListVocabulariesAPIClient + params *ListVocabulariesInput + nextToken *string + firstPage bool +} + +// NewListVocabulariesPaginator returns a new ListVocabulariesPaginator +func NewListVocabulariesPaginator(client ListVocabulariesAPIClient, params *ListVocabulariesInput, optFns ...func(*ListVocabulariesPaginatorOptions)) *ListVocabulariesPaginator { + options := ListVocabulariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVocabulariesInput{} + } + + return &ListVocabulariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVocabulariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVocabularies page. +func (p *ListVocabulariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabulariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListVocabularies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVocabularies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/api_op_ListVocabularyFilters.go b/service/transcribe/api_op_ListVocabularyFilters.go index b56fe3a4550..ff23bdb91b3 100644 --- a/service/transcribe/api_op_ListVocabularyFilters.go +++ b/service/transcribe/api_op_ListVocabularyFilters.go @@ -4,6 +4,7 @@ package transcribe 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/transcribe/types" @@ -118,6 +119,89 @@ func addOperationListVocabularyFiltersMiddlewares(stack *middleware.Stack, optio return nil } +// ListVocabularyFiltersAPIClient is a client that implements the +// ListVocabularyFilters operation. +type ListVocabularyFiltersAPIClient interface { + ListVocabularyFilters(context.Context, *ListVocabularyFiltersInput, ...func(*Options)) (*ListVocabularyFiltersOutput, error) +} + +var _ ListVocabularyFiltersAPIClient = (*Client)(nil) + +// ListVocabularyFiltersPaginatorOptions is the paginator options for +// ListVocabularyFilters +type ListVocabularyFiltersPaginatorOptions struct { + // The maximum number of filters to return in the response. If there are fewer + // results in the list, this response contains only the actual results. + 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 +} + +// ListVocabularyFiltersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transcribe.ListVocabularyFilters +type ListVocabularyFiltersPaginator struct { + options ListVocabularyFiltersPaginatorOptions + client ListVocabularyFiltersAPIClient + params *ListVocabularyFiltersInput + nextToken *string + firstPage bool +} + +// NewListVocabularyFiltersPaginator returns a new ListVocabularyFiltersPaginator +func NewListVocabularyFiltersPaginator(client ListVocabularyFiltersAPIClient, params *ListVocabularyFiltersInput, optFns ...func(*ListVocabularyFiltersPaginatorOptions)) *ListVocabularyFiltersPaginator { + options := ListVocabularyFiltersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListVocabularyFiltersInput{} + } + + return &ListVocabularyFiltersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVocabularyFiltersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListVocabularyFilters page. +func (p *ListVocabularyFiltersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVocabularyFiltersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListVocabularyFilters(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListVocabularyFilters(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transcribe/endpoints.go b/service/transcribe/endpoints.go index 35fd05b0e80..147d6f23833 100644 --- a/service/transcribe/endpoints.go +++ b/service/transcribe/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/transfer/api_op_ListSecurityPolicies.go b/service/transfer/api_op_ListSecurityPolicies.go index 097606f3f02..79a6312a30b 100644 --- a/service/transfer/api_op_ListSecurityPolicies.go +++ b/service/transfer/api_op_ListSecurityPolicies.go @@ -4,6 +4,7 @@ package transfer 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/awslabs/smithy-go/middleware" @@ -113,6 +114,89 @@ func addOperationListSecurityPoliciesMiddlewares(stack *middleware.Stack, option return nil } +// ListSecurityPoliciesAPIClient is a client that implements the +// ListSecurityPolicies operation. +type ListSecurityPoliciesAPIClient interface { + ListSecurityPolicies(context.Context, *ListSecurityPoliciesInput, ...func(*Options)) (*ListSecurityPoliciesOutput, error) +} + +var _ ListSecurityPoliciesAPIClient = (*Client)(nil) + +// ListSecurityPoliciesPaginatorOptions is the paginator options for +// ListSecurityPolicies +type ListSecurityPoliciesPaginatorOptions struct { + // Specifies the number of security policies to return as a response to the + // ListSecurityPolicies query. + 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 +} + +// ListSecurityPoliciesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListSecurityPolicies +type ListSecurityPoliciesPaginator struct { + options ListSecurityPoliciesPaginatorOptions + client ListSecurityPoliciesAPIClient + params *ListSecurityPoliciesInput + nextToken *string + firstPage bool +} + +// NewListSecurityPoliciesPaginator returns a new ListSecurityPoliciesPaginator +func NewListSecurityPoliciesPaginator(client ListSecurityPoliciesAPIClient, params *ListSecurityPoliciesInput, optFns ...func(*ListSecurityPoliciesPaginatorOptions)) *ListSecurityPoliciesPaginator { + options := ListSecurityPoliciesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSecurityPoliciesInput{} + } + + return &ListSecurityPoliciesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSecurityPoliciesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSecurityPolicies page. +func (p *ListSecurityPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSecurityPoliciesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListSecurityPolicies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListSecurityPolicies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListServers.go b/service/transfer/api_op_ListServers.go index 92474d3f709..e06c21c8120 100644 --- a/service/transfer/api_op_ListServers.go +++ b/service/transfer/api_op_ListServers.go @@ -4,6 +4,7 @@ package transfer 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/transfer/types" @@ -113,6 +114,87 @@ func addOperationListServersMiddlewares(stack *middleware.Stack, options Options return nil } +// ListServersAPIClient is a client that implements the ListServers operation. +type ListServersAPIClient interface { + ListServers(context.Context, *ListServersInput, ...func(*Options)) (*ListServersOutput, error) +} + +var _ ListServersAPIClient = (*Client)(nil) + +// ListServersPaginatorOptions is the paginator options for ListServers +type ListServersPaginatorOptions struct { + // Specifies the number of servers to return as a response to the ListServers + // query. + 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 +} + +// ListServersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListServers +type ListServersPaginator struct { + options ListServersPaginatorOptions + client ListServersAPIClient + params *ListServersInput + nextToken *string + firstPage bool +} + +// NewListServersPaginator returns a new ListServersPaginator +func NewListServersPaginator(client ListServersAPIClient, params *ListServersInput, optFns ...func(*ListServersPaginatorOptions)) *ListServersPaginator { + options := ListServersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServersInput{} + } + + return &ListServersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServers page. +func (p *ListServersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListServers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListServers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListTagsForResource.go b/service/transfer/api_op_ListTagsForResource.go index 576d7561b05..333d2a3dba7 100644 --- a/service/transfer/api_op_ListTagsForResource.go +++ b/service/transfer/api_op_ListTagsForResource.go @@ -4,6 +4,7 @@ package transfer 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/transfer/types" @@ -125,6 +126,89 @@ func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options return nil } +// ListTagsForResourceAPIClient is a client that implements the ListTagsForResource +// operation. +type ListTagsForResourceAPIClient interface { + ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) +} + +var _ ListTagsForResourceAPIClient = (*Client)(nil) + +// ListTagsForResourcePaginatorOptions is the paginator options for +// ListTagsForResource +type ListTagsForResourcePaginatorOptions struct { + // Specifies the number of tags to return as a response to the ListTagsForResource + // request. + 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 +} + +// ListTagsForResourcePaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListTagsForResource +type ListTagsForResourcePaginator struct { + options ListTagsForResourcePaginatorOptions + client ListTagsForResourceAPIClient + params *ListTagsForResourceInput + nextToken *string + firstPage bool +} + +// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator +func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { + options := ListTagsForResourcePaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTagsForResourceInput{} + } + + return &ListTagsForResourcePaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTagsForResourcePaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTagsForResource page. +func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/api_op_ListUsers.go b/service/transfer/api_op_ListUsers.go index c6f46002666..35a56f4381e 100644 --- a/service/transfer/api_op_ListUsers.go +++ b/service/transfer/api_op_ListUsers.go @@ -4,6 +4,7 @@ package transfer 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/transfer/types" @@ -126,6 +127,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // Specifies the number of users to return as a response to the ListUsers request. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/transfer.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/transfer/endpoints.go b/service/transfer/endpoints.go index 1b1baaa05b7..e2e0e9346c9 100644 --- a/service/transfer/endpoints.go +++ b/service/transfer/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/translate/api_op_ListTerminologies.go b/service/translate/api_op_ListTerminologies.go index fe61481a056..98e6b801301 100644 --- a/service/translate/api_op_ListTerminologies.go +++ b/service/translate/api_op_ListTerminologies.go @@ -4,6 +4,7 @@ package translate 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/translate/types" @@ -107,6 +108,87 @@ func addOperationListTerminologiesMiddlewares(stack *middleware.Stack, options O return nil } +// ListTerminologiesAPIClient is a client that implements the ListTerminologies +// operation. +type ListTerminologiesAPIClient interface { + ListTerminologies(context.Context, *ListTerminologiesInput, ...func(*Options)) (*ListTerminologiesOutput, error) +} + +var _ ListTerminologiesAPIClient = (*Client)(nil) + +// ListTerminologiesPaginatorOptions is the paginator options for ListTerminologies +type ListTerminologiesPaginatorOptions struct { + // The maximum number of custom terminologies returned per list request. + 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 +} + +// ListTerminologiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/translate.ListTerminologies +type ListTerminologiesPaginator struct { + options ListTerminologiesPaginatorOptions + client ListTerminologiesAPIClient + params *ListTerminologiesInput + nextToken *string + firstPage bool +} + +// NewListTerminologiesPaginator returns a new ListTerminologiesPaginator +func NewListTerminologiesPaginator(client ListTerminologiesAPIClient, params *ListTerminologiesInput, optFns ...func(*ListTerminologiesPaginatorOptions)) *ListTerminologiesPaginator { + options := ListTerminologiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTerminologiesInput{} + } + + return &ListTerminologiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTerminologiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTerminologies page. +func (p *ListTerminologiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTerminologiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTerminologies(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTerminologies(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/translate/api_op_ListTextTranslationJobs.go b/service/translate/api_op_ListTextTranslationJobs.go index 4a604778f74..272733cce16 100644 --- a/service/translate/api_op_ListTextTranslationJobs.go +++ b/service/translate/api_op_ListTextTranslationJobs.go @@ -4,6 +4,7 @@ package translate 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/translate/types" @@ -111,6 +112,89 @@ func addOperationListTextTranslationJobsMiddlewares(stack *middleware.Stack, opt return nil } +// ListTextTranslationJobsAPIClient is a client that implements the +// ListTextTranslationJobs operation. +type ListTextTranslationJobsAPIClient interface { + ListTextTranslationJobs(context.Context, *ListTextTranslationJobsInput, ...func(*Options)) (*ListTextTranslationJobsOutput, error) +} + +var _ ListTextTranslationJobsAPIClient = (*Client)(nil) + +// ListTextTranslationJobsPaginatorOptions is the paginator options for +// ListTextTranslationJobs +type ListTextTranslationJobsPaginatorOptions struct { + // The maximum number of results to return in each page. The default value is 100. + 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 +} + +// ListTextTranslationJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/translate.ListTextTranslationJobs +type ListTextTranslationJobsPaginator struct { + options ListTextTranslationJobsPaginatorOptions + client ListTextTranslationJobsAPIClient + params *ListTextTranslationJobsInput + nextToken *string + firstPage bool +} + +// NewListTextTranslationJobsPaginator returns a new +// ListTextTranslationJobsPaginator +func NewListTextTranslationJobsPaginator(client ListTextTranslationJobsAPIClient, params *ListTextTranslationJobsInput, optFns ...func(*ListTextTranslationJobsPaginatorOptions)) *ListTextTranslationJobsPaginator { + options := ListTextTranslationJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTextTranslationJobsInput{} + } + + return &ListTextTranslationJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTextTranslationJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTextTranslationJobs page. +func (p *ListTextTranslationJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTextTranslationJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListTextTranslationJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListTextTranslationJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/translate/endpoints.go b/service/translate/endpoints.go index 6cb1eb98d9a..cf170755a86 100644 --- a/service/translate/endpoints.go +++ b/service/translate/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/waf/endpoints.go b/service/waf/endpoints.go index dab0c2687ff..6ca4323f5ab 100644 --- a/service/waf/endpoints.go +++ b/service/waf/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/wafregional/endpoints.go b/service/wafregional/endpoints.go index 71320cc11f3..92c730efa2c 100644 --- a/service/wafregional/endpoints.go +++ b/service/wafregional/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/wafv2/endpoints.go b/service/wafv2/endpoints.go index 882f46baf82..4e43a6a1e74 100644 --- a/service/wafv2/endpoints.go +++ b/service/wafv2/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/workdocs/api_op_DescribeDocumentVersions.go b/service/workdocs/api_op_DescribeDocumentVersions.go index 88a2c89f223..22f731337af 100644 --- a/service/workdocs/api_op_DescribeDocumentVersions.go +++ b/service/workdocs/api_op_DescribeDocumentVersions.go @@ -4,6 +4,7 @@ package workdocs 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/workdocs/types" @@ -128,6 +129,89 @@ func addOperationDescribeDocumentVersionsMiddlewares(stack *middleware.Stack, op return nil } +// DescribeDocumentVersionsAPIClient is a client that implements the +// DescribeDocumentVersions operation. +type DescribeDocumentVersionsAPIClient interface { + DescribeDocumentVersions(context.Context, *DescribeDocumentVersionsInput, ...func(*Options)) (*DescribeDocumentVersionsOutput, error) +} + +var _ DescribeDocumentVersionsAPIClient = (*Client)(nil) + +// DescribeDocumentVersionsPaginatorOptions is the paginator options for +// DescribeDocumentVersions +type DescribeDocumentVersionsPaginatorOptions struct { + // The maximum number of versions to return with this call. + 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 +} + +// DescribeDocumentVersionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeDocumentVersions +type DescribeDocumentVersionsPaginator struct { + options DescribeDocumentVersionsPaginatorOptions + client DescribeDocumentVersionsAPIClient + params *DescribeDocumentVersionsInput + nextToken *string + firstPage bool +} + +// NewDescribeDocumentVersionsPaginator returns a new +// DescribeDocumentVersionsPaginator +func NewDescribeDocumentVersionsPaginator(client DescribeDocumentVersionsAPIClient, params *DescribeDocumentVersionsInput, optFns ...func(*DescribeDocumentVersionsPaginatorOptions)) *DescribeDocumentVersionsPaginator { + options := DescribeDocumentVersionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeDocumentVersionsInput{} + } + + return &DescribeDocumentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDocumentVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeDocumentVersions page. +func (p *DescribeDocumentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDocumentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeDocumentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeDocumentVersions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/api_op_DescribeFolderContents.go b/service/workdocs/api_op_DescribeFolderContents.go index 0c67941fa4e..e30da131ff2 100644 --- a/service/workdocs/api_op_DescribeFolderContents.go +++ b/service/workdocs/api_op_DescribeFolderContents.go @@ -4,6 +4,7 @@ package workdocs 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/workdocs/types" @@ -138,6 +139,88 @@ func addOperationDescribeFolderContentsMiddlewares(stack *middleware.Stack, opti return nil } +// DescribeFolderContentsAPIClient is a client that implements the +// DescribeFolderContents operation. +type DescribeFolderContentsAPIClient interface { + DescribeFolderContents(context.Context, *DescribeFolderContentsInput, ...func(*Options)) (*DescribeFolderContentsOutput, error) +} + +var _ DescribeFolderContentsAPIClient = (*Client)(nil) + +// DescribeFolderContentsPaginatorOptions is the paginator options for +// DescribeFolderContents +type DescribeFolderContentsPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// DescribeFolderContentsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeFolderContents +type DescribeFolderContentsPaginator struct { + options DescribeFolderContentsPaginatorOptions + client DescribeFolderContentsAPIClient + params *DescribeFolderContentsInput + nextToken *string + firstPage bool +} + +// NewDescribeFolderContentsPaginator returns a new DescribeFolderContentsPaginator +func NewDescribeFolderContentsPaginator(client DescribeFolderContentsAPIClient, params *DescribeFolderContentsInput, optFns ...func(*DescribeFolderContentsPaginatorOptions)) *DescribeFolderContentsPaginator { + options := DescribeFolderContentsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeFolderContentsInput{} + } + + return &DescribeFolderContentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeFolderContentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeFolderContents page. +func (p *DescribeFolderContentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeFolderContentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeFolderContents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeFolderContents(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/api_op_DescribeUsers.go b/service/workdocs/api_op_DescribeUsers.go index 405508e1e10..d9a2ccbaf00 100644 --- a/service/workdocs/api_op_DescribeUsers.go +++ b/service/workdocs/api_op_DescribeUsers.go @@ -4,6 +4,7 @@ package workdocs 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/workdocs/types" @@ -139,6 +140,86 @@ func addOperationDescribeUsersMiddlewares(stack *middleware.Stack, options Optio return nil } +// DescribeUsersAPIClient is a client that implements the DescribeUsers operation. +type DescribeUsersAPIClient interface { + DescribeUsers(context.Context, *DescribeUsersInput, ...func(*Options)) (*DescribeUsersOutput, error) +} + +var _ DescribeUsersAPIClient = (*Client)(nil) + +// DescribeUsersPaginatorOptions is the paginator options for DescribeUsers +type DescribeUsersPaginatorOptions struct { + // The maximum number of items 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 +} + +// DescribeUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workdocs.DescribeUsers +type DescribeUsersPaginator struct { + options DescribeUsersPaginatorOptions + client DescribeUsersAPIClient + params *DescribeUsersInput + nextToken *string + firstPage bool +} + +// NewDescribeUsersPaginator returns a new DescribeUsersPaginator +func NewDescribeUsersPaginator(client DescribeUsersAPIClient, params *DescribeUsersInput, optFns ...func(*DescribeUsersPaginatorOptions)) *DescribeUsersPaginator { + options := DescribeUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeUsersInput{} + } + + return &DescribeUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeUsers page. +func (p *DescribeUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.Marker = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.Marker + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workdocs/endpoints.go b/service/workdocs/endpoints.go index 47387dcc37f..861d084781f 100644 --- a/service/workdocs/endpoints.go +++ b/service/workdocs/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/worklink/api_op_ListDevices.go b/service/worklink/api_op_ListDevices.go index 1fc078cd2d3..0b5d8cc8364 100644 --- a/service/worklink/api_op_ListDevices.go +++ b/service/worklink/api_op_ListDevices.go @@ -4,6 +4,7 @@ package worklink 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/worklink/types" @@ -115,6 +116,86 @@ func addOperationListDevicesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDevicesAPIClient is a client that implements the ListDevices operation. +type ListDevicesAPIClient interface { + ListDevices(context.Context, *ListDevicesInput, ...func(*Options)) (*ListDevicesOutput, error) +} + +var _ ListDevicesAPIClient = (*Client)(nil) + +// ListDevicesPaginatorOptions is the paginator options for ListDevices +type ListDevicesPaginatorOptions struct { + // The maximum number of results to be included in the next page. + 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 +} + +// ListDevicesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListDevices +type ListDevicesPaginator struct { + options ListDevicesPaginatorOptions + client ListDevicesAPIClient + params *ListDevicesInput + nextToken *string + firstPage bool +} + +// NewListDevicesPaginator returns a new ListDevicesPaginator +func NewListDevicesPaginator(client ListDevicesAPIClient, params *ListDevicesInput, optFns ...func(*ListDevicesPaginatorOptions)) *ListDevicesPaginator { + options := ListDevicesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDevicesInput{} + } + + return &ListDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDevices page. +func (p *ListDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDevices(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListDomains.go b/service/worklink/api_op_ListDomains.go index a44e7ee8c7c..aaee702cf41 100644 --- a/service/worklink/api_op_ListDomains.go +++ b/service/worklink/api_op_ListDomains.go @@ -4,6 +4,7 @@ package worklink 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/worklink/types" @@ -115,6 +116,86 @@ func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options return nil } +// ListDomainsAPIClient is a client that implements the ListDomains operation. +type ListDomainsAPIClient interface { + ListDomains(context.Context, *ListDomainsInput, ...func(*Options)) (*ListDomainsOutput, error) +} + +var _ ListDomainsAPIClient = (*Client)(nil) + +// ListDomainsPaginatorOptions is the paginator options for ListDomains +type ListDomainsPaginatorOptions struct { + // The maximum number of results to be included in the next page. + 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 +} + +// ListDomainsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListDomains +type ListDomainsPaginator struct { + options ListDomainsPaginatorOptions + client ListDomainsAPIClient + params *ListDomainsInput + nextToken *string + firstPage bool +} + +// NewListDomainsPaginator returns a new ListDomainsPaginator +func NewListDomainsPaginator(client ListDomainsAPIClient, params *ListDomainsInput, optFns ...func(*ListDomainsPaginatorOptions)) *ListDomainsPaginator { + options := ListDomainsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDomainsInput{} + } + + return &ListDomainsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDomainsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDomains page. +func (p *ListDomainsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListDomains(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListFleets.go b/service/worklink/api_op_ListFleets.go index 47b5f8f58cc..64ae832bd08 100644 --- a/service/worklink/api_op_ListFleets.go +++ b/service/worklink/api_op_ListFleets.go @@ -4,6 +4,7 @@ package worklink 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/worklink/types" @@ -107,6 +108,86 @@ func addOperationListFleetsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListFleetsAPIClient is a client that implements the ListFleets operation. +type ListFleetsAPIClient interface { + ListFleets(context.Context, *ListFleetsInput, ...func(*Options)) (*ListFleetsOutput, error) +} + +var _ ListFleetsAPIClient = (*Client)(nil) + +// ListFleetsPaginatorOptions is the paginator options for ListFleets +type ListFleetsPaginatorOptions struct { + // The maximum number of results to be included in the next page. + 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 +} + +// ListFleetsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListFleets +type ListFleetsPaginator struct { + options ListFleetsPaginatorOptions + client ListFleetsAPIClient + params *ListFleetsInput + nextToken *string + firstPage bool +} + +// NewListFleetsPaginator returns a new ListFleetsPaginator +func NewListFleetsPaginator(client ListFleetsAPIClient, params *ListFleetsInput, optFns ...func(*ListFleetsPaginatorOptions)) *ListFleetsPaginator { + options := ListFleetsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListFleetsInput{} + } + + return &ListFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListFleetsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListFleets page. +func (p *ListFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListFleets(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListWebsiteAuthorizationProviders.go b/service/worklink/api_op_ListWebsiteAuthorizationProviders.go index c099938b2fd..6a6a13a4edb 100644 --- a/service/worklink/api_op_ListWebsiteAuthorizationProviders.go +++ b/service/worklink/api_op_ListWebsiteAuthorizationProviders.go @@ -4,6 +4,7 @@ package worklink 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/worklink/types" @@ -116,6 +117,89 @@ func addOperationListWebsiteAuthorizationProvidersMiddlewares(stack *middleware. return nil } +// ListWebsiteAuthorizationProvidersAPIClient is a client that implements the +// ListWebsiteAuthorizationProviders operation. +type ListWebsiteAuthorizationProvidersAPIClient interface { + ListWebsiteAuthorizationProviders(context.Context, *ListWebsiteAuthorizationProvidersInput, ...func(*Options)) (*ListWebsiteAuthorizationProvidersOutput, error) +} + +var _ ListWebsiteAuthorizationProvidersAPIClient = (*Client)(nil) + +// ListWebsiteAuthorizationProvidersPaginatorOptions is the paginator options for +// ListWebsiteAuthorizationProviders +type ListWebsiteAuthorizationProvidersPaginatorOptions struct { + // The maximum number of results to be included in the next page. + 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 +} + +// ListWebsiteAuthorizationProvidersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListWebsiteAuthorizationProviders +type ListWebsiteAuthorizationProvidersPaginator struct { + options ListWebsiteAuthorizationProvidersPaginatorOptions + client ListWebsiteAuthorizationProvidersAPIClient + params *ListWebsiteAuthorizationProvidersInput + nextToken *string + firstPage bool +} + +// NewListWebsiteAuthorizationProvidersPaginator returns a new +// ListWebsiteAuthorizationProvidersPaginator +func NewListWebsiteAuthorizationProvidersPaginator(client ListWebsiteAuthorizationProvidersAPIClient, params *ListWebsiteAuthorizationProvidersInput, optFns ...func(*ListWebsiteAuthorizationProvidersPaginatorOptions)) *ListWebsiteAuthorizationProvidersPaginator { + options := ListWebsiteAuthorizationProvidersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebsiteAuthorizationProvidersInput{} + } + + return &ListWebsiteAuthorizationProvidersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebsiteAuthorizationProvidersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWebsiteAuthorizationProviders page. +func (p *ListWebsiteAuthorizationProvidersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebsiteAuthorizationProvidersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWebsiteAuthorizationProviders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebsiteAuthorizationProviders(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/api_op_ListWebsiteCertificateAuthorities.go b/service/worklink/api_op_ListWebsiteCertificateAuthorities.go index 5621649f290..476e91168e5 100644 --- a/service/worklink/api_op_ListWebsiteCertificateAuthorities.go +++ b/service/worklink/api_op_ListWebsiteCertificateAuthorities.go @@ -4,6 +4,7 @@ package worklink 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/worklink/types" @@ -116,6 +117,89 @@ func addOperationListWebsiteCertificateAuthoritiesMiddlewares(stack *middleware. return nil } +// ListWebsiteCertificateAuthoritiesAPIClient is a client that implements the +// ListWebsiteCertificateAuthorities operation. +type ListWebsiteCertificateAuthoritiesAPIClient interface { + ListWebsiteCertificateAuthorities(context.Context, *ListWebsiteCertificateAuthoritiesInput, ...func(*Options)) (*ListWebsiteCertificateAuthoritiesOutput, error) +} + +var _ ListWebsiteCertificateAuthoritiesAPIClient = (*Client)(nil) + +// ListWebsiteCertificateAuthoritiesPaginatorOptions is the paginator options for +// ListWebsiteCertificateAuthorities +type ListWebsiteCertificateAuthoritiesPaginatorOptions struct { + // The maximum number of results to be included in the next page. + 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 +} + +// ListWebsiteCertificateAuthoritiesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/worklink.ListWebsiteCertificateAuthorities +type ListWebsiteCertificateAuthoritiesPaginator struct { + options ListWebsiteCertificateAuthoritiesPaginatorOptions + client ListWebsiteCertificateAuthoritiesAPIClient + params *ListWebsiteCertificateAuthoritiesInput + nextToken *string + firstPage bool +} + +// NewListWebsiteCertificateAuthoritiesPaginator returns a new +// ListWebsiteCertificateAuthoritiesPaginator +func NewListWebsiteCertificateAuthoritiesPaginator(client ListWebsiteCertificateAuthoritiesAPIClient, params *ListWebsiteCertificateAuthoritiesInput, optFns ...func(*ListWebsiteCertificateAuthoritiesPaginatorOptions)) *ListWebsiteCertificateAuthoritiesPaginator { + options := ListWebsiteCertificateAuthoritiesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWebsiteCertificateAuthoritiesInput{} + } + + return &ListWebsiteCertificateAuthoritiesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWebsiteCertificateAuthoritiesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWebsiteCertificateAuthorities page. +func (p *ListWebsiteCertificateAuthoritiesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWebsiteCertificateAuthoritiesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListWebsiteCertificateAuthorities(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListWebsiteCertificateAuthorities(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/worklink/endpoints.go b/service/worklink/endpoints.go index 192c0a6bc41..417682ee850 100644 --- a/service/worklink/endpoints.go +++ b/service/worklink/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/workmail/api_op_ListAliases.go b/service/workmail/api_op_ListAliases.go index 2eee01f20c5..f53e89dc9c0 100644 --- a/service/workmail/api_op_ListAliases.go +++ b/service/workmail/api_op_ListAliases.go @@ -4,6 +4,7 @@ package workmail 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/awslabs/smithy-go/middleware" @@ -119,6 +120,86 @@ func addOperationListAliasesMiddlewares(stack *middleware.Stack, options Options return nil } +// ListAliasesAPIClient is a client that implements the ListAliases operation. +type ListAliasesAPIClient interface { + ListAliases(context.Context, *ListAliasesInput, ...func(*Options)) (*ListAliasesOutput, error) +} + +var _ ListAliasesAPIClient = (*Client)(nil) + +// ListAliasesPaginatorOptions is the paginator options for ListAliases +type ListAliasesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListAliasesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListAliases +type ListAliasesPaginator struct { + options ListAliasesPaginatorOptions + client ListAliasesAPIClient + params *ListAliasesInput + nextToken *string + firstPage bool +} + +// NewListAliasesPaginator returns a new ListAliasesPaginator +func NewListAliasesPaginator(client ListAliasesAPIClient, params *ListAliasesInput, optFns ...func(*ListAliasesPaginatorOptions)) *ListAliasesPaginator { + options := ListAliasesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAliasesInput{} + } + + return &ListAliasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAliasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAliases page. +func (p *ListAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAliasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListAliases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListAliases(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListGroupMembers.go b/service/workmail/api_op_ListGroupMembers.go index 771db2da783..b03db48cdd8 100644 --- a/service/workmail/api_op_ListGroupMembers.go +++ b/service/workmail/api_op_ListGroupMembers.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -122,6 +123,87 @@ func addOperationListGroupMembersMiddlewares(stack *middleware.Stack, options Op return nil } +// ListGroupMembersAPIClient is a client that implements the ListGroupMembers +// operation. +type ListGroupMembersAPIClient interface { + ListGroupMembers(context.Context, *ListGroupMembersInput, ...func(*Options)) (*ListGroupMembersOutput, error) +} + +var _ ListGroupMembersAPIClient = (*Client)(nil) + +// ListGroupMembersPaginatorOptions is the paginator options for ListGroupMembers +type ListGroupMembersPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListGroupMembersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListGroupMembers +type ListGroupMembersPaginator struct { + options ListGroupMembersPaginatorOptions + client ListGroupMembersAPIClient + params *ListGroupMembersInput + nextToken *string + firstPage bool +} + +// NewListGroupMembersPaginator returns a new ListGroupMembersPaginator +func NewListGroupMembersPaginator(client ListGroupMembersAPIClient, params *ListGroupMembersInput, optFns ...func(*ListGroupMembersPaginatorOptions)) *ListGroupMembersPaginator { + options := ListGroupMembersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupMembersInput{} + } + + return &ListGroupMembersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupMembersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroupMembers page. +func (p *ListGroupMembersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupMembersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroupMembers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroupMembers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListGroups.go b/service/workmail/api_op_ListGroups.go index 0f90aa38f70..a8e4546bdfb 100644 --- a/service/workmail/api_op_ListGroups.go +++ b/service/workmail/api_op_ListGroups.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -115,6 +116,86 @@ func addOperationListGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListGroupsAPIClient is a client that implements the ListGroups operation. +type ListGroupsAPIClient interface { + ListGroups(context.Context, *ListGroupsInput, ...func(*Options)) (*ListGroupsOutput, error) +} + +var _ ListGroupsAPIClient = (*Client)(nil) + +// ListGroupsPaginatorOptions is the paginator options for ListGroups +type ListGroupsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListGroups +type ListGroupsPaginator struct { + options ListGroupsPaginatorOptions + client ListGroupsAPIClient + params *ListGroupsInput + nextToken *string + firstPage bool +} + +// NewListGroupsPaginator returns a new ListGroupsPaginator +func NewListGroupsPaginator(client ListGroupsAPIClient, params *ListGroupsInput, optFns ...func(*ListGroupsPaginatorOptions)) *ListGroupsPaginator { + options := ListGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListGroupsInput{} + } + + return &ListGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListGroups page. +func (p *ListGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListMailboxExportJobs.go b/service/workmail/api_op_ListMailboxExportJobs.go index f7cb5193ed6..4bd012087cb 100644 --- a/service/workmail/api_op_ListMailboxExportJobs.go +++ b/service/workmail/api_op_ListMailboxExportJobs.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -114,6 +115,88 @@ func addOperationListMailboxExportJobsMiddlewares(stack *middleware.Stack, optio return nil } +// ListMailboxExportJobsAPIClient is a client that implements the +// ListMailboxExportJobs operation. +type ListMailboxExportJobsAPIClient interface { + ListMailboxExportJobs(context.Context, *ListMailboxExportJobsInput, ...func(*Options)) (*ListMailboxExportJobsOutput, error) +} + +var _ ListMailboxExportJobsAPIClient = (*Client)(nil) + +// ListMailboxExportJobsPaginatorOptions is the paginator options for +// ListMailboxExportJobs +type ListMailboxExportJobsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListMailboxExportJobsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListMailboxExportJobs +type ListMailboxExportJobsPaginator struct { + options ListMailboxExportJobsPaginatorOptions + client ListMailboxExportJobsAPIClient + params *ListMailboxExportJobsInput + nextToken *string + firstPage bool +} + +// NewListMailboxExportJobsPaginator returns a new ListMailboxExportJobsPaginator +func NewListMailboxExportJobsPaginator(client ListMailboxExportJobsAPIClient, params *ListMailboxExportJobsInput, optFns ...func(*ListMailboxExportJobsPaginatorOptions)) *ListMailboxExportJobsPaginator { + options := ListMailboxExportJobsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMailboxExportJobsInput{} + } + + return &ListMailboxExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMailboxExportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMailboxExportJobs page. +func (p *ListMailboxExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMailboxExportJobsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMailboxExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMailboxExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListMailboxPermissions.go b/service/workmail/api_op_ListMailboxPermissions.go index d97ae616bc5..c2e0a1c16a9 100644 --- a/service/workmail/api_op_ListMailboxPermissions.go +++ b/service/workmail/api_op_ListMailboxPermissions.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -123,6 +124,88 @@ func addOperationListMailboxPermissionsMiddlewares(stack *middleware.Stack, opti return nil } +// ListMailboxPermissionsAPIClient is a client that implements the +// ListMailboxPermissions operation. +type ListMailboxPermissionsAPIClient interface { + ListMailboxPermissions(context.Context, *ListMailboxPermissionsInput, ...func(*Options)) (*ListMailboxPermissionsOutput, error) +} + +var _ ListMailboxPermissionsAPIClient = (*Client)(nil) + +// ListMailboxPermissionsPaginatorOptions is the paginator options for +// ListMailboxPermissions +type ListMailboxPermissionsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListMailboxPermissionsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListMailboxPermissions +type ListMailboxPermissionsPaginator struct { + options ListMailboxPermissionsPaginatorOptions + client ListMailboxPermissionsAPIClient + params *ListMailboxPermissionsInput + nextToken *string + firstPage bool +} + +// NewListMailboxPermissionsPaginator returns a new ListMailboxPermissionsPaginator +func NewListMailboxPermissionsPaginator(client ListMailboxPermissionsAPIClient, params *ListMailboxPermissionsInput, optFns ...func(*ListMailboxPermissionsPaginatorOptions)) *ListMailboxPermissionsPaginator { + options := ListMailboxPermissionsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMailboxPermissionsInput{} + } + + return &ListMailboxPermissionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMailboxPermissionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMailboxPermissions page. +func (p *ListMailboxPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMailboxPermissionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListMailboxPermissions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListMailboxPermissions(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListOrganizations.go b/service/workmail/api_op_ListOrganizations.go index 53c1af2c798..3e3453bf1e7 100644 --- a/service/workmail/api_op_ListOrganizations.go +++ b/service/workmail/api_op_ListOrganizations.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -108,6 +109,87 @@ func addOperationListOrganizationsMiddlewares(stack *middleware.Stack, options O return nil } +// ListOrganizationsAPIClient is a client that implements the ListOrganizations +// operation. +type ListOrganizationsAPIClient interface { + ListOrganizations(context.Context, *ListOrganizationsInput, ...func(*Options)) (*ListOrganizationsOutput, error) +} + +var _ ListOrganizationsAPIClient = (*Client)(nil) + +// ListOrganizationsPaginatorOptions is the paginator options for ListOrganizations +type ListOrganizationsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListOrganizationsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListOrganizations +type ListOrganizationsPaginator struct { + options ListOrganizationsPaginatorOptions + client ListOrganizationsAPIClient + params *ListOrganizationsInput + nextToken *string + firstPage bool +} + +// NewListOrganizationsPaginator returns a new ListOrganizationsPaginator +func NewListOrganizationsPaginator(client ListOrganizationsAPIClient, params *ListOrganizationsInput, optFns ...func(*ListOrganizationsPaginatorOptions)) *ListOrganizationsPaginator { + options := ListOrganizationsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOrganizationsInput{} + } + + return &ListOrganizationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOrganizationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOrganizations page. +func (p *ListOrganizationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListOrganizations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOrganizations(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListResourceDelegates.go b/service/workmail/api_op_ListResourceDelegates.go index 00ab7537d02..7dc8d00eedd 100644 --- a/service/workmail/api_op_ListResourceDelegates.go +++ b/service/workmail/api_op_ListResourceDelegates.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -122,6 +123,88 @@ func addOperationListResourceDelegatesMiddlewares(stack *middleware.Stack, optio return nil } +// ListResourceDelegatesAPIClient is a client that implements the +// ListResourceDelegates operation. +type ListResourceDelegatesAPIClient interface { + ListResourceDelegates(context.Context, *ListResourceDelegatesInput, ...func(*Options)) (*ListResourceDelegatesOutput, error) +} + +var _ ListResourceDelegatesAPIClient = (*Client)(nil) + +// ListResourceDelegatesPaginatorOptions is the paginator options for +// ListResourceDelegates +type ListResourceDelegatesPaginatorOptions struct { + // The number of maximum results in a page. + 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 +} + +// ListResourceDelegatesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListResourceDelegates +type ListResourceDelegatesPaginator struct { + options ListResourceDelegatesPaginatorOptions + client ListResourceDelegatesAPIClient + params *ListResourceDelegatesInput + nextToken *string + firstPage bool +} + +// NewListResourceDelegatesPaginator returns a new ListResourceDelegatesPaginator +func NewListResourceDelegatesPaginator(client ListResourceDelegatesAPIClient, params *ListResourceDelegatesInput, optFns ...func(*ListResourceDelegatesPaginatorOptions)) *ListResourceDelegatesPaginator { + options := ListResourceDelegatesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourceDelegatesInput{} + } + + return &ListResourceDelegatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourceDelegatesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResourceDelegates page. +func (p *ListResourceDelegatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourceDelegatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResourceDelegates(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResourceDelegates(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListResources.go b/service/workmail/api_op_ListResources.go index 90782762f2d..8bd39691797 100644 --- a/service/workmail/api_op_ListResources.go +++ b/service/workmail/api_op_ListResources.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -116,6 +117,86 @@ func addOperationListResourcesMiddlewares(stack *middleware.Stack, options Optio return nil } +// ListResourcesAPIClient is a client that implements the ListResources operation. +type ListResourcesAPIClient interface { + ListResources(context.Context, *ListResourcesInput, ...func(*Options)) (*ListResourcesOutput, error) +} + +var _ ListResourcesAPIClient = (*Client)(nil) + +// ListResourcesPaginatorOptions is the paginator options for ListResources +type ListResourcesPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListResourcesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListResources +type ListResourcesPaginator struct { + options ListResourcesPaginatorOptions + client ListResourcesAPIClient + params *ListResourcesInput + nextToken *string + firstPage bool +} + +// NewListResourcesPaginator returns a new ListResourcesPaginator +func NewListResourcesPaginator(client ListResourcesAPIClient, params *ListResourcesInput, optFns ...func(*ListResourcesPaginatorOptions)) *ListResourcesPaginator { + options := ListResourcesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListResourcesInput{} + } + + return &ListResourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListResourcesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListResources page. +func (p *ListResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListResourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListResources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListResources(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/api_op_ListUsers.go b/service/workmail/api_op_ListUsers.go index 236a4f23bbd..b83dee1af57 100644 --- a/service/workmail/api_op_ListUsers.go +++ b/service/workmail/api_op_ListUsers.go @@ -4,6 +4,7 @@ package workmail 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/workmail/types" @@ -115,6 +116,86 @@ func addOperationListUsersMiddlewares(stack *middleware.Stack, options Options) return nil } +// ListUsersAPIClient is a client that implements the ListUsers operation. +type ListUsersAPIClient interface { + ListUsers(context.Context, *ListUsersInput, ...func(*Options)) (*ListUsersOutput, error) +} + +var _ ListUsersAPIClient = (*Client)(nil) + +// ListUsersPaginatorOptions is the paginator options for ListUsers +type ListUsersPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListUsersPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workmail.ListUsers +type ListUsersPaginator struct { + options ListUsersPaginatorOptions + client ListUsersAPIClient + params *ListUsersInput + nextToken *string + firstPage bool +} + +// NewListUsersPaginator returns a new ListUsersPaginator +func NewListUsersPaginator(client ListUsersAPIClient, params *ListUsersInput, optFns ...func(*ListUsersPaginatorOptions)) *ListUsersPaginator { + options := ListUsersPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListUsersInput{} + } + + return &ListUsersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListUsers page. +func (p *ListUsersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.MaxResults = &p.options.Limit + } + + result, err := p.client.ListUsers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListUsers(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workmail/endpoints.go b/service/workmail/endpoints.go index b73e774b8b4..2c2c4b7653b 100644 --- a/service/workmail/endpoints.go +++ b/service/workmail/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/workmailmessageflow/endpoints.go b/service/workmailmessageflow/endpoints.go index 088ccc3bf75..b5c047fe87d 100644 --- a/service/workmailmessageflow/endpoints.go +++ b/service/workmailmessageflow/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/workspaces/api_op_DescribeWorkspaceBundles.go b/service/workspaces/api_op_DescribeWorkspaceBundles.go index 7a79785099c..b6bdc2a73ec 100644 --- a/service/workspaces/api_op_DescribeWorkspaceBundles.go +++ b/service/workspaces/api_op_DescribeWorkspaceBundles.go @@ -4,6 +4,7 @@ package workspaces 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/workspaces/types" @@ -115,6 +116,82 @@ func addOperationDescribeWorkspaceBundlesMiddlewares(stack *middleware.Stack, op return nil } +// DescribeWorkspaceBundlesAPIClient is a client that implements the +// DescribeWorkspaceBundles operation. +type DescribeWorkspaceBundlesAPIClient interface { + DescribeWorkspaceBundles(context.Context, *DescribeWorkspaceBundlesInput, ...func(*Options)) (*DescribeWorkspaceBundlesOutput, error) +} + +var _ DescribeWorkspaceBundlesAPIClient = (*Client)(nil) + +// DescribeWorkspaceBundlesPaginatorOptions is the paginator options for +// DescribeWorkspaceBundles +type DescribeWorkspaceBundlesPaginatorOptions struct { + // 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 +} + +// DescribeWorkspaceBundlesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaceBundles +type DescribeWorkspaceBundlesPaginator struct { + options DescribeWorkspaceBundlesPaginatorOptions + client DescribeWorkspaceBundlesAPIClient + params *DescribeWorkspaceBundlesInput + nextToken *string + firstPage bool +} + +// NewDescribeWorkspaceBundlesPaginator returns a new +// DescribeWorkspaceBundlesPaginator +func NewDescribeWorkspaceBundlesPaginator(client DescribeWorkspaceBundlesAPIClient, params *DescribeWorkspaceBundlesInput, optFns ...func(*DescribeWorkspaceBundlesPaginatorOptions)) *DescribeWorkspaceBundlesPaginator { + options := DescribeWorkspaceBundlesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspaceBundlesInput{} + } + + return &DescribeWorkspaceBundlesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspaceBundlesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeWorkspaceBundles page. +func (p *DescribeWorkspaceBundlesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspaceBundlesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeWorkspaceBundles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaceBundles(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/api_op_DescribeWorkspaceDirectories.go b/service/workspaces/api_op_DescribeWorkspaceDirectories.go index 33eb226d793..d2d7379cd47 100644 --- a/service/workspaces/api_op_DescribeWorkspaceDirectories.go +++ b/service/workspaces/api_op_DescribeWorkspaceDirectories.go @@ -4,6 +4,7 @@ package workspaces 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/workspaces/types" @@ -111,6 +112,82 @@ func addOperationDescribeWorkspaceDirectoriesMiddlewares(stack *middleware.Stack return nil } +// DescribeWorkspaceDirectoriesAPIClient is a client that implements the +// DescribeWorkspaceDirectories operation. +type DescribeWorkspaceDirectoriesAPIClient interface { + DescribeWorkspaceDirectories(context.Context, *DescribeWorkspaceDirectoriesInput, ...func(*Options)) (*DescribeWorkspaceDirectoriesOutput, error) +} + +var _ DescribeWorkspaceDirectoriesAPIClient = (*Client)(nil) + +// DescribeWorkspaceDirectoriesPaginatorOptions is the paginator options for +// DescribeWorkspaceDirectories +type DescribeWorkspaceDirectoriesPaginatorOptions struct { + // 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 +} + +// DescribeWorkspaceDirectoriesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaceDirectories +type DescribeWorkspaceDirectoriesPaginator struct { + options DescribeWorkspaceDirectoriesPaginatorOptions + client DescribeWorkspaceDirectoriesAPIClient + params *DescribeWorkspaceDirectoriesInput + nextToken *string + firstPage bool +} + +// NewDescribeWorkspaceDirectoriesPaginator returns a new +// DescribeWorkspaceDirectoriesPaginator +func NewDescribeWorkspaceDirectoriesPaginator(client DescribeWorkspaceDirectoriesAPIClient, params *DescribeWorkspaceDirectoriesInput, optFns ...func(*DescribeWorkspaceDirectoriesPaginatorOptions)) *DescribeWorkspaceDirectoriesPaginator { + options := DescribeWorkspaceDirectoriesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspaceDirectoriesInput{} + } + + return &DescribeWorkspaceDirectoriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspaceDirectoriesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeWorkspaceDirectories page. +func (p *DescribeWorkspaceDirectoriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspaceDirectoriesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.DescribeWorkspaceDirectories(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaceDirectories(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/api_op_DescribeWorkspaces.go b/service/workspaces/api_op_DescribeWorkspaces.go index fd81435e6a0..625aedc4eae 100644 --- a/service/workspaces/api_op_DescribeWorkspaces.go +++ b/service/workspaces/api_op_DescribeWorkspaces.go @@ -4,6 +4,7 @@ package workspaces 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/workspaces/types" @@ -129,6 +130,88 @@ func addOperationDescribeWorkspacesMiddlewares(stack *middleware.Stack, options return nil } +// DescribeWorkspacesAPIClient is a client that implements the DescribeWorkspaces +// operation. +type DescribeWorkspacesAPIClient interface { + DescribeWorkspaces(context.Context, *DescribeWorkspacesInput, ...func(*Options)) (*DescribeWorkspacesOutput, error) +} + +var _ DescribeWorkspacesAPIClient = (*Client)(nil) + +// DescribeWorkspacesPaginatorOptions is the paginator options for +// DescribeWorkspaces +type DescribeWorkspacesPaginatorOptions struct { + // The maximum number of items 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 +} + +// DescribeWorkspacesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/workspaces.DescribeWorkspaces +type DescribeWorkspacesPaginator struct { + options DescribeWorkspacesPaginatorOptions + client DescribeWorkspacesAPIClient + params *DescribeWorkspacesInput + nextToken *string + firstPage bool +} + +// NewDescribeWorkspacesPaginator returns a new DescribeWorkspacesPaginator +func NewDescribeWorkspacesPaginator(client DescribeWorkspacesAPIClient, params *DescribeWorkspacesInput, optFns ...func(*DescribeWorkspacesPaginatorOptions)) *DescribeWorkspacesPaginator { + options := DescribeWorkspacesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribeWorkspacesInput{} + } + + return &DescribeWorkspacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeWorkspacesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribeWorkspaces page. +func (p *DescribeWorkspacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeWorkspacesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + if p.options.Limit > 0 { + params.Limit = &p.options.Limit + } + + result, err := p.client.DescribeWorkspaces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opDescribeWorkspaces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/workspaces/endpoints.go b/service/workspaces/endpoints.go index d11de51fc84..986e82ae8f9 100644 --- a/service/workspaces/endpoints.go +++ b/service/workspaces/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { diff --git a/service/xray/api_op_BatchGetTraces.go b/service/xray/api_op_BatchGetTraces.go index cde5f97891b..1053247417d 100644 --- a/service/xray/api_op_BatchGetTraces.go +++ b/service/xray/api_op_BatchGetTraces.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -115,6 +116,80 @@ func addOperationBatchGetTracesMiddlewares(stack *middleware.Stack, options Opti return nil } +// BatchGetTracesAPIClient is a client that implements the BatchGetTraces +// operation. +type BatchGetTracesAPIClient interface { + BatchGetTraces(context.Context, *BatchGetTracesInput, ...func(*Options)) (*BatchGetTracesOutput, error) +} + +var _ BatchGetTracesAPIClient = (*Client)(nil) + +// BatchGetTracesPaginatorOptions is the paginator options for BatchGetTraces +type BatchGetTracesPaginatorOptions struct { + // 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 +} + +// BatchGetTracesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.BatchGetTraces +type BatchGetTracesPaginator struct { + options BatchGetTracesPaginatorOptions + client BatchGetTracesAPIClient + params *BatchGetTracesInput + nextToken *string + firstPage bool +} + +// NewBatchGetTracesPaginator returns a new BatchGetTracesPaginator +func NewBatchGetTracesPaginator(client BatchGetTracesAPIClient, params *BatchGetTracesInput, optFns ...func(*BatchGetTracesPaginatorOptions)) *BatchGetTracesPaginator { + options := BatchGetTracesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &BatchGetTracesInput{} + } + + return &BatchGetTracesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *BatchGetTracesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next BatchGetTraces page. +func (p *BatchGetTracesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*BatchGetTracesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.BatchGetTraces(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opBatchGetTraces(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetGroups.go b/service/xray/api_op_GetGroups.go index 1a9be96dd41..c3624844ffb 100644 --- a/service/xray/api_op_GetGroups.go +++ b/service/xray/api_op_GetGroups.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -102,6 +103,79 @@ func addOperationGetGroupsMiddlewares(stack *middleware.Stack, options Options) return nil } +// GetGroupsAPIClient is a client that implements the GetGroups operation. +type GetGroupsAPIClient interface { + GetGroups(context.Context, *GetGroupsInput, ...func(*Options)) (*GetGroupsOutput, error) +} + +var _ GetGroupsAPIClient = (*Client)(nil) + +// GetGroupsPaginatorOptions is the paginator options for GetGroups +type GetGroupsPaginatorOptions struct { + // 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 +} + +// GetGroupsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetGroups +type GetGroupsPaginator struct { + options GetGroupsPaginatorOptions + client GetGroupsAPIClient + params *GetGroupsInput + nextToken *string + firstPage bool +} + +// NewGetGroupsPaginator returns a new GetGroupsPaginator +func NewGetGroupsPaginator(client GetGroupsAPIClient, params *GetGroupsInput, optFns ...func(*GetGroupsPaginatorOptions)) *GetGroupsPaginator { + options := GetGroupsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetGroupsInput{} + } + + return &GetGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetGroupsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetGroups page. +func (p *GetGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetGroups(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetSamplingRules.go b/service/xray/api_op_GetSamplingRules.go index 4cc040460a8..da7b5e4380d 100644 --- a/service/xray/api_op_GetSamplingRules.go +++ b/service/xray/api_op_GetSamplingRules.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -102,6 +103,80 @@ func addOperationGetSamplingRulesMiddlewares(stack *middleware.Stack, options Op return nil } +// GetSamplingRulesAPIClient is a client that implements the GetSamplingRules +// operation. +type GetSamplingRulesAPIClient interface { + GetSamplingRules(context.Context, *GetSamplingRulesInput, ...func(*Options)) (*GetSamplingRulesOutput, error) +} + +var _ GetSamplingRulesAPIClient = (*Client)(nil) + +// GetSamplingRulesPaginatorOptions is the paginator options for GetSamplingRules +type GetSamplingRulesPaginatorOptions struct { + // 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 +} + +// GetSamplingRulesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetSamplingRules +type GetSamplingRulesPaginator struct { + options GetSamplingRulesPaginatorOptions + client GetSamplingRulesAPIClient + params *GetSamplingRulesInput + nextToken *string + firstPage bool +} + +// NewGetSamplingRulesPaginator returns a new GetSamplingRulesPaginator +func NewGetSamplingRulesPaginator(client GetSamplingRulesAPIClient, params *GetSamplingRulesInput, optFns ...func(*GetSamplingRulesPaginatorOptions)) *GetSamplingRulesPaginator { + options := GetSamplingRulesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSamplingRulesInput{} + } + + return &GetSamplingRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSamplingRulesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSamplingRules page. +func (p *GetSamplingRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSamplingRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetSamplingRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSamplingRules(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetSamplingStatisticSummaries.go b/service/xray/api_op_GetSamplingStatisticSummaries.go index 8c27ef76b96..ef2bb14b845 100644 --- a/service/xray/api_op_GetSamplingStatisticSummaries.go +++ b/service/xray/api_op_GetSamplingStatisticSummaries.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -102,6 +103,82 @@ func addOperationGetSamplingStatisticSummariesMiddlewares(stack *middleware.Stac return nil } +// GetSamplingStatisticSummariesAPIClient is a client that implements the +// GetSamplingStatisticSummaries operation. +type GetSamplingStatisticSummariesAPIClient interface { + GetSamplingStatisticSummaries(context.Context, *GetSamplingStatisticSummariesInput, ...func(*Options)) (*GetSamplingStatisticSummariesOutput, error) +} + +var _ GetSamplingStatisticSummariesAPIClient = (*Client)(nil) + +// GetSamplingStatisticSummariesPaginatorOptions is the paginator options for +// GetSamplingStatisticSummaries +type GetSamplingStatisticSummariesPaginatorOptions struct { + // 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 +} + +// GetSamplingStatisticSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetSamplingStatisticSummaries +type GetSamplingStatisticSummariesPaginator struct { + options GetSamplingStatisticSummariesPaginatorOptions + client GetSamplingStatisticSummariesAPIClient + params *GetSamplingStatisticSummariesInput + nextToken *string + firstPage bool +} + +// NewGetSamplingStatisticSummariesPaginator returns a new +// GetSamplingStatisticSummariesPaginator +func NewGetSamplingStatisticSummariesPaginator(client GetSamplingStatisticSummariesAPIClient, params *GetSamplingStatisticSummariesInput, optFns ...func(*GetSamplingStatisticSummariesPaginatorOptions)) *GetSamplingStatisticSummariesPaginator { + options := GetSamplingStatisticSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetSamplingStatisticSummariesInput{} + } + + return &GetSamplingStatisticSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetSamplingStatisticSummariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetSamplingStatisticSummaries page. +func (p *GetSamplingStatisticSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSamplingStatisticSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetSamplingStatisticSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetSamplingStatisticSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetServiceGraph.go b/service/xray/api_op_GetServiceGraph.go index b8e843e88b0..8213f17ba40 100644 --- a/service/xray/api_op_GetServiceGraph.go +++ b/service/xray/api_op_GetServiceGraph.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -140,6 +141,80 @@ func addOperationGetServiceGraphMiddlewares(stack *middleware.Stack, options Opt return nil } +// GetServiceGraphAPIClient is a client that implements the GetServiceGraph +// operation. +type GetServiceGraphAPIClient interface { + GetServiceGraph(context.Context, *GetServiceGraphInput, ...func(*Options)) (*GetServiceGraphOutput, error) +} + +var _ GetServiceGraphAPIClient = (*Client)(nil) + +// GetServiceGraphPaginatorOptions is the paginator options for GetServiceGraph +type GetServiceGraphPaginatorOptions struct { + // 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 +} + +// GetServiceGraphPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetServiceGraph +type GetServiceGraphPaginator struct { + options GetServiceGraphPaginatorOptions + client GetServiceGraphAPIClient + params *GetServiceGraphInput + nextToken *string + firstPage bool +} + +// NewGetServiceGraphPaginator returns a new GetServiceGraphPaginator +func NewGetServiceGraphPaginator(client GetServiceGraphAPIClient, params *GetServiceGraphInput, optFns ...func(*GetServiceGraphPaginatorOptions)) *GetServiceGraphPaginator { + options := GetServiceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetServiceGraphInput{} + } + + return &GetServiceGraphPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetServiceGraphPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetServiceGraph page. +func (p *GetServiceGraphPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetServiceGraphOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetServiceGraph(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetServiceGraph(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTimeSeriesServiceStatistics.go b/service/xray/api_op_GetTimeSeriesServiceStatistics.go index be36832b2c7..147c3947483 100644 --- a/service/xray/api_op_GetTimeSeriesServiceStatistics.go +++ b/service/xray/api_op_GetTimeSeriesServiceStatistics.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -135,6 +136,82 @@ func addOperationGetTimeSeriesServiceStatisticsMiddlewares(stack *middleware.Sta return nil } +// GetTimeSeriesServiceStatisticsAPIClient is a client that implements the +// GetTimeSeriesServiceStatistics operation. +type GetTimeSeriesServiceStatisticsAPIClient interface { + GetTimeSeriesServiceStatistics(context.Context, *GetTimeSeriesServiceStatisticsInput, ...func(*Options)) (*GetTimeSeriesServiceStatisticsOutput, error) +} + +var _ GetTimeSeriesServiceStatisticsAPIClient = (*Client)(nil) + +// GetTimeSeriesServiceStatisticsPaginatorOptions is the paginator options for +// GetTimeSeriesServiceStatistics +type GetTimeSeriesServiceStatisticsPaginatorOptions struct { + // 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 +} + +// GetTimeSeriesServiceStatisticsPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTimeSeriesServiceStatistics +type GetTimeSeriesServiceStatisticsPaginator struct { + options GetTimeSeriesServiceStatisticsPaginatorOptions + client GetTimeSeriesServiceStatisticsAPIClient + params *GetTimeSeriesServiceStatisticsInput + nextToken *string + firstPage bool +} + +// NewGetTimeSeriesServiceStatisticsPaginator returns a new +// GetTimeSeriesServiceStatisticsPaginator +func NewGetTimeSeriesServiceStatisticsPaginator(client GetTimeSeriesServiceStatisticsAPIClient, params *GetTimeSeriesServiceStatisticsInput, optFns ...func(*GetTimeSeriesServiceStatisticsPaginatorOptions)) *GetTimeSeriesServiceStatisticsPaginator { + options := GetTimeSeriesServiceStatisticsPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTimeSeriesServiceStatisticsInput{} + } + + return &GetTimeSeriesServiceStatisticsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTimeSeriesServiceStatisticsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTimeSeriesServiceStatistics page. +func (p *GetTimeSeriesServiceStatisticsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTimeSeriesServiceStatisticsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTimeSeriesServiceStatistics(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTimeSeriesServiceStatistics(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTraceGraph.go b/service/xray/api_op_GetTraceGraph.go index 46bc9c4462b..45c0506bdc1 100644 --- a/service/xray/api_op_GetTraceGraph.go +++ b/service/xray/api_op_GetTraceGraph.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -110,6 +111,79 @@ func addOperationGetTraceGraphMiddlewares(stack *middleware.Stack, options Optio return nil } +// GetTraceGraphAPIClient is a client that implements the GetTraceGraph operation. +type GetTraceGraphAPIClient interface { + GetTraceGraph(context.Context, *GetTraceGraphInput, ...func(*Options)) (*GetTraceGraphOutput, error) +} + +var _ GetTraceGraphAPIClient = (*Client)(nil) + +// GetTraceGraphPaginatorOptions is the paginator options for GetTraceGraph +type GetTraceGraphPaginatorOptions struct { + // 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 +} + +// GetTraceGraphPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTraceGraph +type GetTraceGraphPaginator struct { + options GetTraceGraphPaginatorOptions + client GetTraceGraphAPIClient + params *GetTraceGraphInput + nextToken *string + firstPage bool +} + +// NewGetTraceGraphPaginator returns a new GetTraceGraphPaginator +func NewGetTraceGraphPaginator(client GetTraceGraphAPIClient, params *GetTraceGraphInput, optFns ...func(*GetTraceGraphPaginatorOptions)) *GetTraceGraphPaginator { + options := GetTraceGraphPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTraceGraphInput{} + } + + return &GetTraceGraphPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTraceGraphPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTraceGraph page. +func (p *GetTraceGraphPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTraceGraphOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTraceGraph(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTraceGraph(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/api_op_GetTraceSummaries.go b/service/xray/api_op_GetTraceSummaries.go index 95ac97fbfd5..89181db0f65 100644 --- a/service/xray/api_op_GetTraceSummaries.go +++ b/service/xray/api_op_GetTraceSummaries.go @@ -4,6 +4,7 @@ package xray 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/xray/types" @@ -152,6 +153,80 @@ func addOperationGetTraceSummariesMiddlewares(stack *middleware.Stack, options O return nil } +// GetTraceSummariesAPIClient is a client that implements the GetTraceSummaries +// operation. +type GetTraceSummariesAPIClient interface { + GetTraceSummaries(context.Context, *GetTraceSummariesInput, ...func(*Options)) (*GetTraceSummariesOutput, error) +} + +var _ GetTraceSummariesAPIClient = (*Client)(nil) + +// GetTraceSummariesPaginatorOptions is the paginator options for GetTraceSummaries +type GetTraceSummariesPaginatorOptions struct { + // 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 +} + +// GetTraceSummariesPaginator is a paginator for +// github.com/aws/aws-sdk-go-v2/service/xray.GetTraceSummaries +type GetTraceSummariesPaginator struct { + options GetTraceSummariesPaginatorOptions + client GetTraceSummariesAPIClient + params *GetTraceSummariesInput + nextToken *string + firstPage bool +} + +// NewGetTraceSummariesPaginator returns a new GetTraceSummariesPaginator +func NewGetTraceSummariesPaginator(client GetTraceSummariesAPIClient, params *GetTraceSummariesInput, optFns ...func(*GetTraceSummariesPaginatorOptions)) *GetTraceSummariesPaginator { + options := GetTraceSummariesPaginatorOptions{} + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &GetTraceSummariesInput{} + } + + return &GetTraceSummariesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetTraceSummariesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next GetTraceSummaries page. +func (p *GetTraceSummariesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetTraceSummariesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + result, err := p.client.GetTraceSummaries(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = nil + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opGetTraceSummaries(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/xray/endpoints.go b/service/xray/endpoints.go index a20d821db98..cc121526f24 100644 --- a/service/xray/endpoints.go +++ b/service/xray/endpoints.go @@ -84,10 +84,9 @@ func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.Ser } ctx = awsmiddleware.SetSigningName(ctx, signingName) } - - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) return next.HandleSerialize(ctx, in) } func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error {