repo_name
stringlengths 1
52
| repo_creator
stringclasses 6
values | programming_language
stringclasses 4
values | code
stringlengths 0
9.68M
| num_lines
int64 1
234k
|
---|---|---|---|---|
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver SecurityHub endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securityhub.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securityhub-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "af-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-4",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-south-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "fips-us-east-1",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-east-2",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-east-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-east-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-1",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-west-2",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-west-2.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-west-2",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "me-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-east-2.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-west-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-west-2.amazonaws.com",
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securityhub.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securityhub-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securityhub.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securityhub-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securityhub.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "fips-us-gov-east-1",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "fips-us-gov-west-1",
}: endpoints.Endpoint{
Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-gov-east-1.amazonaws.com",
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securityhub-fips.us-gov-west-1.amazonaws.com",
},
},
},
}
| 486 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AdminStatus string
// Enum values for AdminStatus
const (
AdminStatusEnabled AdminStatus = "ENABLED"
AdminStatusDisableInProgress AdminStatus = "DISABLE_IN_PROGRESS"
)
// Values returns all known values for AdminStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (AdminStatus) Values() []AdminStatus {
return []AdminStatus{
"ENABLED",
"DISABLE_IN_PROGRESS",
}
}
type AssociationStatus string
// Enum values for AssociationStatus
const (
AssociationStatusEnabled AssociationStatus = "ENABLED"
AssociationStatusDisabled AssociationStatus = "DISABLED"
)
// Values returns all known values for AssociationStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AssociationStatus) Values() []AssociationStatus {
return []AssociationStatus{
"ENABLED",
"DISABLED",
}
}
type AutoEnableStandards string
// Enum values for AutoEnableStandards
const (
AutoEnableStandardsNone AutoEnableStandards = "NONE"
AutoEnableStandardsDefault AutoEnableStandards = "DEFAULT"
)
// Values returns all known values for AutoEnableStandards. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AutoEnableStandards) Values() []AutoEnableStandards {
return []AutoEnableStandards{
"NONE",
"DEFAULT",
}
}
type AutomationRulesActionType string
// Enum values for AutomationRulesActionType
const (
AutomationRulesActionTypeFindingFieldsUpdate AutomationRulesActionType = "FINDING_FIELDS_UPDATE"
)
// Values returns all known values for AutomationRulesActionType. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (AutomationRulesActionType) Values() []AutomationRulesActionType {
return []AutomationRulesActionType{
"FINDING_FIELDS_UPDATE",
}
}
type AwsIamAccessKeyStatus string
// Enum values for AwsIamAccessKeyStatus
const (
AwsIamAccessKeyStatusActive AwsIamAccessKeyStatus = "Active"
AwsIamAccessKeyStatusInactive AwsIamAccessKeyStatus = "Inactive"
)
// Values returns all known values for AwsIamAccessKeyStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AwsIamAccessKeyStatus) Values() []AwsIamAccessKeyStatus {
return []AwsIamAccessKeyStatus{
"Active",
"Inactive",
}
}
type AwsS3BucketNotificationConfigurationS3KeyFilterRuleName string
// Enum values for AwsS3BucketNotificationConfigurationS3KeyFilterRuleName
const (
AwsS3BucketNotificationConfigurationS3KeyFilterRuleNamePrefix AwsS3BucketNotificationConfigurationS3KeyFilterRuleName = "Prefix"
AwsS3BucketNotificationConfigurationS3KeyFilterRuleNameSuffix AwsS3BucketNotificationConfigurationS3KeyFilterRuleName = "Suffix"
)
// Values returns all known values for
// AwsS3BucketNotificationConfigurationS3KeyFilterRuleName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AwsS3BucketNotificationConfigurationS3KeyFilterRuleName) Values() []AwsS3BucketNotificationConfigurationS3KeyFilterRuleName {
return []AwsS3BucketNotificationConfigurationS3KeyFilterRuleName{
"Prefix",
"Suffix",
}
}
type ComplianceStatus string
// Enum values for ComplianceStatus
const (
ComplianceStatusPassed ComplianceStatus = "PASSED"
ComplianceStatusWarning ComplianceStatus = "WARNING"
ComplianceStatusFailed ComplianceStatus = "FAILED"
ComplianceStatusNotAvailable ComplianceStatus = "NOT_AVAILABLE"
)
// Values returns all known values for ComplianceStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ComplianceStatus) Values() []ComplianceStatus {
return []ComplianceStatus{
"PASSED",
"WARNING",
"FAILED",
"NOT_AVAILABLE",
}
}
type ControlFindingGenerator string
// Enum values for ControlFindingGenerator
const (
ControlFindingGeneratorStandardControl ControlFindingGenerator = "STANDARD_CONTROL"
ControlFindingGeneratorSecurityControl ControlFindingGenerator = "SECURITY_CONTROL"
)
// Values returns all known values for ControlFindingGenerator. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ControlFindingGenerator) Values() []ControlFindingGenerator {
return []ControlFindingGenerator{
"STANDARD_CONTROL",
"SECURITY_CONTROL",
}
}
type ControlStatus string
// Enum values for ControlStatus
const (
ControlStatusEnabled ControlStatus = "ENABLED"
ControlStatusDisabled ControlStatus = "DISABLED"
)
// Values returns all known values for ControlStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (ControlStatus) Values() []ControlStatus {
return []ControlStatus{
"ENABLED",
"DISABLED",
}
}
type DateRangeUnit string
// Enum values for DateRangeUnit
const (
DateRangeUnitDays DateRangeUnit = "DAYS"
)
// Values returns all known values for DateRangeUnit. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DateRangeUnit) Values() []DateRangeUnit {
return []DateRangeUnit{
"DAYS",
}
}
type FindingHistoryUpdateSourceType string
// Enum values for FindingHistoryUpdateSourceType
const (
FindingHistoryUpdateSourceTypeBatchUpdateFindings FindingHistoryUpdateSourceType = "BATCH_UPDATE_FINDINGS"
FindingHistoryUpdateSourceTypeBatchImportFindings FindingHistoryUpdateSourceType = "BATCH_IMPORT_FINDINGS"
)
// Values returns all known values for FindingHistoryUpdateSourceType. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (FindingHistoryUpdateSourceType) Values() []FindingHistoryUpdateSourceType {
return []FindingHistoryUpdateSourceType{
"BATCH_UPDATE_FINDINGS",
"BATCH_IMPORT_FINDINGS",
}
}
type IntegrationType string
// Enum values for IntegrationType
const (
IntegrationTypeSendFindingsToSecurityHub IntegrationType = "SEND_FINDINGS_TO_SECURITY_HUB"
IntegrationTypeReceiveFindingsFromSecurityHub IntegrationType = "RECEIVE_FINDINGS_FROM_SECURITY_HUB"
IntegrationTypeUpdateFindingsInSecurityHub IntegrationType = "UPDATE_FINDINGS_IN_SECURITY_HUB"
)
// Values returns all known values for IntegrationType. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (IntegrationType) Values() []IntegrationType {
return []IntegrationType{
"SEND_FINDINGS_TO_SECURITY_HUB",
"RECEIVE_FINDINGS_FROM_SECURITY_HUB",
"UPDATE_FINDINGS_IN_SECURITY_HUB",
}
}
type MalwareState string
// Enum values for MalwareState
const (
MalwareStateObserved MalwareState = "OBSERVED"
MalwareStateRemovalFailed MalwareState = "REMOVAL_FAILED"
MalwareStateRemoved MalwareState = "REMOVED"
)
// Values returns all known values for MalwareState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MalwareState) Values() []MalwareState {
return []MalwareState{
"OBSERVED",
"REMOVAL_FAILED",
"REMOVED",
}
}
type MalwareType string
// Enum values for MalwareType
const (
MalwareTypeAdware MalwareType = "ADWARE"
MalwareTypeBlendedThreat MalwareType = "BLENDED_THREAT"
MalwareTypeBotnetAgent MalwareType = "BOTNET_AGENT"
MalwareTypeCoinMiner MalwareType = "COIN_MINER"
MalwareTypeExploitKit MalwareType = "EXPLOIT_KIT"
MalwareTypeKeylogger MalwareType = "KEYLOGGER"
MalwareTypeMacro MalwareType = "MACRO"
MalwareTypePotentiallyUnwanted MalwareType = "POTENTIALLY_UNWANTED"
MalwareTypeSpyware MalwareType = "SPYWARE"
MalwareTypeRansomware MalwareType = "RANSOMWARE"
MalwareTypeRemoteAccess MalwareType = "REMOTE_ACCESS"
MalwareTypeRootkit MalwareType = "ROOTKIT"
MalwareTypeTrojan MalwareType = "TROJAN"
MalwareTypeVirus MalwareType = "VIRUS"
MalwareTypeWorm MalwareType = "WORM"
)
// Values returns all known values for MalwareType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (MalwareType) Values() []MalwareType {
return []MalwareType{
"ADWARE",
"BLENDED_THREAT",
"BOTNET_AGENT",
"COIN_MINER",
"EXPLOIT_KIT",
"KEYLOGGER",
"MACRO",
"POTENTIALLY_UNWANTED",
"SPYWARE",
"RANSOMWARE",
"REMOTE_ACCESS",
"ROOTKIT",
"TROJAN",
"VIRUS",
"WORM",
}
}
type MapFilterComparison string
// Enum values for MapFilterComparison
const (
MapFilterComparisonEquals MapFilterComparison = "EQUALS"
MapFilterComparisonNotEquals MapFilterComparison = "NOT_EQUALS"
)
// Values returns all known values for MapFilterComparison. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (MapFilterComparison) Values() []MapFilterComparison {
return []MapFilterComparison{
"EQUALS",
"NOT_EQUALS",
}
}
type NetworkDirection string
// Enum values for NetworkDirection
const (
NetworkDirectionIn NetworkDirection = "IN"
NetworkDirectionOut NetworkDirection = "OUT"
)
// Values returns all known values for NetworkDirection. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (NetworkDirection) Values() []NetworkDirection {
return []NetworkDirection{
"IN",
"OUT",
}
}
type Partition string
// Enum values for Partition
const (
PartitionAws Partition = "aws"
PartitionAwsCn Partition = "aws-cn"
PartitionAwsUsGov Partition = "aws-us-gov"
)
// Values returns all known values for Partition. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (Partition) Values() []Partition {
return []Partition{
"aws",
"aws-cn",
"aws-us-gov",
}
}
type RecordState string
// Enum values for RecordState
const (
RecordStateActive RecordState = "ACTIVE"
RecordStateArchived RecordState = "ARCHIVED"
)
// Values returns all known values for RecordState. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (RecordState) Values() []RecordState {
return []RecordState{
"ACTIVE",
"ARCHIVED",
}
}
type RegionAvailabilityStatus string
// Enum values for RegionAvailabilityStatus
const (
RegionAvailabilityStatusAvailable RegionAvailabilityStatus = "AVAILABLE"
RegionAvailabilityStatusUnavailable RegionAvailabilityStatus = "UNAVAILABLE"
)
// Values returns all known values for RegionAvailabilityStatus. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (RegionAvailabilityStatus) Values() []RegionAvailabilityStatus {
return []RegionAvailabilityStatus{
"AVAILABLE",
"UNAVAILABLE",
}
}
type RuleStatus string
// Enum values for RuleStatus
const (
RuleStatusEnabled RuleStatus = "ENABLED"
RuleStatusDisabled RuleStatus = "DISABLED"
)
// Values returns all known values for RuleStatus. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (RuleStatus) Values() []RuleStatus {
return []RuleStatus{
"ENABLED",
"DISABLED",
}
}
type SeverityLabel string
// Enum values for SeverityLabel
const (
SeverityLabelInformational SeverityLabel = "INFORMATIONAL"
SeverityLabelLow SeverityLabel = "LOW"
SeverityLabelMedium SeverityLabel = "MEDIUM"
SeverityLabelHigh SeverityLabel = "HIGH"
SeverityLabelCritical SeverityLabel = "CRITICAL"
)
// Values returns all known values for SeverityLabel. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SeverityLabel) Values() []SeverityLabel {
return []SeverityLabel{
"INFORMATIONAL",
"LOW",
"MEDIUM",
"HIGH",
"CRITICAL",
}
}
type SeverityRating string
// Enum values for SeverityRating
const (
SeverityRatingLow SeverityRating = "LOW"
SeverityRatingMedium SeverityRating = "MEDIUM"
SeverityRatingHigh SeverityRating = "HIGH"
SeverityRatingCritical SeverityRating = "CRITICAL"
)
// Values returns all known values for SeverityRating. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SeverityRating) Values() []SeverityRating {
return []SeverityRating{
"LOW",
"MEDIUM",
"HIGH",
"CRITICAL",
}
}
type SortOrder string
// Enum values for SortOrder
const (
SortOrderAscending SortOrder = "asc"
SortOrderDescending SortOrder = "desc"
)
// Values returns all known values for SortOrder. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (SortOrder) Values() []SortOrder {
return []SortOrder{
"asc",
"desc",
}
}
type StandardsStatus string
// Enum values for StandardsStatus
const (
StandardsStatusPending StandardsStatus = "PENDING"
StandardsStatusReady StandardsStatus = "READY"
StandardsStatusFailed StandardsStatus = "FAILED"
StandardsStatusDeleting StandardsStatus = "DELETING"
StandardsStatusIncomplete StandardsStatus = "INCOMPLETE"
)
// Values returns all known values for StandardsStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (StandardsStatus) Values() []StandardsStatus {
return []StandardsStatus{
"PENDING",
"READY",
"FAILED",
"DELETING",
"INCOMPLETE",
}
}
type StatusReasonCode string
// Enum values for StatusReasonCode
const (
StatusReasonCodeNoAvailableConfigurationRecorder StatusReasonCode = "NO_AVAILABLE_CONFIGURATION_RECORDER"
StatusReasonCodeInternalError StatusReasonCode = "INTERNAL_ERROR"
)
// Values returns all known values for StatusReasonCode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (StatusReasonCode) Values() []StatusReasonCode {
return []StatusReasonCode{
"NO_AVAILABLE_CONFIGURATION_RECORDER",
"INTERNAL_ERROR",
}
}
type StringFilterComparison string
// Enum values for StringFilterComparison
const (
StringFilterComparisonEquals StringFilterComparison = "EQUALS"
StringFilterComparisonPrefix StringFilterComparison = "PREFIX"
StringFilterComparisonNotEquals StringFilterComparison = "NOT_EQUALS"
StringFilterComparisonPrefixNotEquals StringFilterComparison = "PREFIX_NOT_EQUALS"
)
// Values returns all known values for StringFilterComparison. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (StringFilterComparison) Values() []StringFilterComparison {
return []StringFilterComparison{
"EQUALS",
"PREFIX",
"NOT_EQUALS",
"PREFIX_NOT_EQUALS",
}
}
type ThreatIntelIndicatorCategory string
// Enum values for ThreatIntelIndicatorCategory
const (
ThreatIntelIndicatorCategoryBackdoor ThreatIntelIndicatorCategory = "BACKDOOR"
ThreatIntelIndicatorCategoryCardStealer ThreatIntelIndicatorCategory = "CARD_STEALER"
ThreatIntelIndicatorCategoryCommandAndControl ThreatIntelIndicatorCategory = "COMMAND_AND_CONTROL"
ThreatIntelIndicatorCategoryDropSite ThreatIntelIndicatorCategory = "DROP_SITE"
ThreatIntelIndicatorCategoryExploitSite ThreatIntelIndicatorCategory = "EXPLOIT_SITE"
ThreatIntelIndicatorCategoryKeylogger ThreatIntelIndicatorCategory = "KEYLOGGER"
)
// Values returns all known values for ThreatIntelIndicatorCategory. Note that
// this can be expanded in the future, and so it is only as up to date as the
// client. The ordering of this slice is not guaranteed to be stable across
// updates.
func (ThreatIntelIndicatorCategory) Values() []ThreatIntelIndicatorCategory {
return []ThreatIntelIndicatorCategory{
"BACKDOOR",
"CARD_STEALER",
"COMMAND_AND_CONTROL",
"DROP_SITE",
"EXPLOIT_SITE",
"KEYLOGGER",
}
}
type ThreatIntelIndicatorType string
// Enum values for ThreatIntelIndicatorType
const (
ThreatIntelIndicatorTypeDomain ThreatIntelIndicatorType = "DOMAIN"
ThreatIntelIndicatorTypeEmailAddress ThreatIntelIndicatorType = "EMAIL_ADDRESS"
ThreatIntelIndicatorTypeHashMd5 ThreatIntelIndicatorType = "HASH_MD5"
ThreatIntelIndicatorTypeHashSha1 ThreatIntelIndicatorType = "HASH_SHA1"
ThreatIntelIndicatorTypeHashSha256 ThreatIntelIndicatorType = "HASH_SHA256"
ThreatIntelIndicatorTypeHashSha512 ThreatIntelIndicatorType = "HASH_SHA512"
ThreatIntelIndicatorTypeIpv4Address ThreatIntelIndicatorType = "IPV4_ADDRESS"
ThreatIntelIndicatorTypeIpv6Address ThreatIntelIndicatorType = "IPV6_ADDRESS"
ThreatIntelIndicatorTypeMutex ThreatIntelIndicatorType = "MUTEX"
ThreatIntelIndicatorTypeProcess ThreatIntelIndicatorType = "PROCESS"
ThreatIntelIndicatorTypeUrl ThreatIntelIndicatorType = "URL"
)
// Values returns all known values for ThreatIntelIndicatorType. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (ThreatIntelIndicatorType) Values() []ThreatIntelIndicatorType {
return []ThreatIntelIndicatorType{
"DOMAIN",
"EMAIL_ADDRESS",
"HASH_MD5",
"HASH_SHA1",
"HASH_SHA256",
"HASH_SHA512",
"IPV4_ADDRESS",
"IPV6_ADDRESS",
"MUTEX",
"PROCESS",
"URL",
}
}
type UnprocessedErrorCode string
// Enum values for UnprocessedErrorCode
const (
UnprocessedErrorCodeInvalidInput UnprocessedErrorCode = "INVALID_INPUT"
UnprocessedErrorCodeAccessDenied UnprocessedErrorCode = "ACCESS_DENIED"
UnprocessedErrorCodeNotFound UnprocessedErrorCode = "NOT_FOUND"
UnprocessedErrorCodeLimitExceeded UnprocessedErrorCode = "LIMIT_EXCEEDED"
)
// Values returns all known values for UnprocessedErrorCode. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (UnprocessedErrorCode) Values() []UnprocessedErrorCode {
return []UnprocessedErrorCode{
"INVALID_INPUT",
"ACCESS_DENIED",
"NOT_FOUND",
"LIMIT_EXCEEDED",
}
}
type VerificationState string
// Enum values for VerificationState
const (
VerificationStateUnknown VerificationState = "UNKNOWN"
VerificationStateTruePositive VerificationState = "TRUE_POSITIVE"
VerificationStateFalsePositive VerificationState = "FALSE_POSITIVE"
VerificationStateBenignPositive VerificationState = "BENIGN_POSITIVE"
)
// Values returns all known values for VerificationState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (VerificationState) Values() []VerificationState {
return []VerificationState{
"UNKNOWN",
"TRUE_POSITIVE",
"FALSE_POSITIVE",
"BENIGN_POSITIVE",
}
}
type VulnerabilityFixAvailable string
// Enum values for VulnerabilityFixAvailable
const (
VulnerabilityFixAvailableYes VulnerabilityFixAvailable = "YES"
VulnerabilityFixAvailableNo VulnerabilityFixAvailable = "NO"
VulnerabilityFixAvailablePartial VulnerabilityFixAvailable = "PARTIAL"
)
// Values returns all known values for VulnerabilityFixAvailable. Note that this
// can be expanded in the future, and so it is only as up to date as the client.
// The ordering of this slice is not guaranteed to be stable across updates.
func (VulnerabilityFixAvailable) Values() []VulnerabilityFixAvailable {
return []VulnerabilityFixAvailable{
"YES",
"NO",
"PARTIAL",
}
}
type WorkflowState string
// Enum values for WorkflowState
const (
WorkflowStateNew WorkflowState = "NEW"
WorkflowStateAssigned WorkflowState = "ASSIGNED"
WorkflowStateInProgress WorkflowState = "IN_PROGRESS"
WorkflowStateDeferred WorkflowState = "DEFERRED"
WorkflowStateResolved WorkflowState = "RESOLVED"
)
// Values returns all known values for WorkflowState. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (WorkflowState) Values() []WorkflowState {
return []WorkflowState{
"NEW",
"ASSIGNED",
"IN_PROGRESS",
"DEFERRED",
"RESOLVED",
}
}
type WorkflowStatus string
// Enum values for WorkflowStatus
const (
WorkflowStatusNew WorkflowStatus = "NEW"
WorkflowStatusNotified WorkflowStatus = "NOTIFIED"
WorkflowStatusResolved WorkflowStatus = "RESOLVED"
WorkflowStatusSuppressed WorkflowStatus = "SUPPRESSED"
)
// Values returns all known values for WorkflowStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (WorkflowStatus) Values() []WorkflowStatus {
return []WorkflowStatus{
"NEW",
"NOTIFIED",
"RESOLVED",
"SUPPRESSED",
}
}
| 699 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You don't have permission to perform the action specified in the request.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Internal server error.
type InternalException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *InternalException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalException"
}
return *e.ErrorCodeOverride
}
func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The account doesn't have permission to perform this action.
type InvalidAccessException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *InvalidAccessException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidAccessException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidAccessException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidAccessException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidAccessException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because you supplied an invalid or out-of-range value
// for an input parameter.
type InvalidInputException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *InvalidInputException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InvalidInputException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InvalidInputException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InvalidInputException"
}
return *e.ErrorCodeOverride
}
func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because it attempted to create resources beyond the
// current Amazon Web Services account or throttling limits. The error code
// describes the limit exceeded.
type LimitExceededException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *LimitExceededException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *LimitExceededException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *LimitExceededException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "LimitExceededException"
}
return *e.ErrorCodeOverride
}
func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource specified in the request conflicts with an existing resource.
type ResourceConflictException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *ResourceConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request was rejected because we can't find the specified resource.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
Code *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 208 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "SecurityLake"
const ServiceAPIVersion = "2018-05-10"
// Client provides the API client to make operations call for Amazon Security Lake.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "securitylake", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 434 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a natively supported Amazon Web Service as an Amazon Security Lake source.
// Enables source types for member accounts in required Amazon Web Services
// Regions, based on the parameters you specify. You can choose any source type in
// any Region for either accounts that are part of a trusted organization or
// standalone accounts. Once you add an Amazon Web Service as a source, Security
// Lake starts collecting logs and events from it, You can use this API only to
// enable natively supported Amazon Web Services as a source. Use
// CreateCustomLogSource to enable data collection from a custom source.
func (c *Client) CreateAwsLogSource(ctx context.Context, params *CreateAwsLogSourceInput, optFns ...func(*Options)) (*CreateAwsLogSourceOutput, error) {
if params == nil {
params = &CreateAwsLogSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateAwsLogSource", params, optFns, c.addOperationCreateAwsLogSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateAwsLogSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateAwsLogSourceInput struct {
// Specify the natively-supported Amazon Web Services service to add as a source
// in Security Lake.
//
// This member is required.
Sources []types.AwsLogSourceConfiguration
noSmithyDocumentSerde
}
type CreateAwsLogSourceOutput struct {
// Lists all accounts in which enabling a natively supported Amazon Web Service as
// a Security Lake source failed. The failure occurred as these accounts are not
// part of an organization.
Failed []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateAwsLogSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateAwsLogSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateAwsLogSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateAwsLogSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAwsLogSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateAwsLogSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateAwsLogSource",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Adds a third-party custom source in Amazon Security Lake, from the Amazon Web
// Services Region where you want to create a custom source. Security Lake can
// collect logs and events from third-party custom sources. After creating the
// appropriate IAM role to invoke Glue crawler, use this API to add a custom source
// name in Security Lake. This operation creates a partition in the Amazon S3
// bucket for Security Lake as the target location for log files from the custom
// source. In addition, this operation also creates an associated Glue table and an
// Glue crawler.
func (c *Client) CreateCustomLogSource(ctx context.Context, params *CreateCustomLogSourceInput, optFns ...func(*Options)) (*CreateCustomLogSourceOutput, error) {
if params == nil {
params = &CreateCustomLogSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCustomLogSource", params, optFns, c.addOperationCreateCustomLogSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCustomLogSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCustomLogSourceInput struct {
// Specify the name for a third-party custom source. This must be a Regionally
// unique value.
//
// This member is required.
SourceName *string
// The configuration for the third-party custom source.
Configuration *types.CustomLogSourceConfiguration
// The Open Cybersecurity Schema Framework (OCSF) event classes which describes
// the type of data that the custom source will send to Security Lake. The
// supported event classes are:
// - ACCESS_ACTIVITY
// - FILE_ACTIVITY
// - KERNEL_ACTIVITY
// - KERNEL_EXTENSION
// - MEMORY_ACTIVITY
// - MODULE_ACTIVITY
// - PROCESS_ACTIVITY
// - REGISTRY_KEY_ACTIVITY
// - REGISTRY_VALUE_ACTIVITY
// - RESOURCE_ACTIVITY
// - SCHEDULED_JOB_ACTIVITY
// - SECURITY_FINDING
// - ACCOUNT_CHANGE
// - AUTHENTICATION
// - AUTHORIZATION
// - ENTITY_MANAGEMENT_AUDIT
// - DHCP_ACTIVITY
// - NETWORK_ACTIVITY
// - DNS_ACTIVITY
// - FTP_ACTIVITY
// - HTTP_ACTIVITY
// - RDP_ACTIVITY
// - SMB_ACTIVITY
// - SSH_ACTIVITY
// - CONFIG_STATE
// - INVENTORY_INFO
// - EMAIL_ACTIVITY
// - API_ACTIVITY
// - CLOUD_API
EventClasses []string
// Specify the source version for the third-party custom source, to limit log
// collection to a specific version of custom data source.
SourceVersion *string
noSmithyDocumentSerde
}
type CreateCustomLogSourceOutput struct {
// The created third-party custom source.
Source *types.CustomLogSourceResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCustomLogSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCustomLogSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCustomLogSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateCustomLogSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCustomLogSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateCustomLogSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateCustomLogSource",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Initializes an Amazon Security Lake instance with the provided (or default)
// configuration. You can enable Security Lake in Amazon Web Services Regions with
// customized settings before enabling log collection in Regions. By default, the
// CreateDataLake Security Lake in all Regions. To specify particular Regions,
// configure these Regions using the configurations parameter. If you have already
// enabled Security Lake in a Region when you call this command, the command will
// update the Region if you provide new configuration parameters. If you have not
// already enabled Security Lake in the Region when you call this API, it will set
// up the data lake in the Region with the specified configurations. When you
// enable Security Lake, it starts ingesting security data after the
// CreateAwsLogSource call. This includes ingesting security data from sources,
// storing data, and making data accessible to subscribers. Security Lake also
// enables all the existing settings and resources that it stores or maintains for
// your Amazon Web Services account in the current Region, including security log
// and event data. For more information, see the Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/what-is-security-lake.html)
// .
func (c *Client) CreateDataLake(ctx context.Context, params *CreateDataLakeInput, optFns ...func(*Options)) (*CreateDataLakeOutput, error) {
if params == nil {
params = &CreateDataLakeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDataLake", params, optFns, c.addOperationCreateDataLakeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDataLakeOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDataLakeInput struct {
// Specify the Region or Regions that will contribute data to the rollup region.
//
// This member is required.
Configurations []types.DataLakeConfiguration
// The Amazon Resource Name (ARN) used to create and update the Glue table. This
// table contains partitions generated by the ingestion and normalization of Amazon
// Web Services log sources and custom sources.
//
// This member is required.
MetaStoreManagerRoleArn *string
noSmithyDocumentSerde
}
type CreateDataLakeOutput struct {
// The created Security Lake configuration object.
DataLakes []types.DataLakeResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDataLakeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDataLake{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDataLake{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateDataLakeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataLake(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateDataLake(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateDataLake",
}
}
| 147 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates the specified notification subscription in Amazon Security Lake for the
// organization you specify.
func (c *Client) CreateDataLakeExceptionSubscription(ctx context.Context, params *CreateDataLakeExceptionSubscriptionInput, optFns ...func(*Options)) (*CreateDataLakeExceptionSubscriptionOutput, error) {
if params == nil {
params = &CreateDataLakeExceptionSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDataLakeExceptionSubscription", params, optFns, c.addOperationCreateDataLakeExceptionSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDataLakeExceptionSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDataLakeExceptionSubscriptionInput struct {
// The Amazon Web Services account where you want to receive exception
// notifications.
//
// This member is required.
NotificationEndpoint *string
// The subscription protocol to which exception notifications are posted.
//
// This member is required.
SubscriptionProtocol *string
// The expiration period and time-to-live (TTL).
ExceptionTimeToLive *int64
noSmithyDocumentSerde
}
type CreateDataLakeExceptionSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDataLakeExceptionSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateDataLakeExceptionSubscriptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataLakeExceptionSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateDataLakeExceptionSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateDataLakeExceptionSubscription",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Automatically enables Amazon Security Lake for new member accounts in your
// organization. Security Lake is not automatically enabled for any existing member
// accounts in your organization.
func (c *Client) CreateDataLakeOrganizationConfiguration(ctx context.Context, params *CreateDataLakeOrganizationConfigurationInput, optFns ...func(*Options)) (*CreateDataLakeOrganizationConfigurationOutput, error) {
if params == nil {
params = &CreateDataLakeOrganizationConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateDataLakeOrganizationConfiguration", params, optFns, c.addOperationCreateDataLakeOrganizationConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateDataLakeOrganizationConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateDataLakeOrganizationConfigurationInput struct {
// Enable Security Lake with the specified configuration settings, to begin
// collecting security data for new accounts in your organization.
//
// This member is required.
AutoEnableNewAccount []types.DataLakeAutoEnableNewAccountConfiguration
noSmithyDocumentSerde
}
type CreateDataLakeOrganizationConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateDataLakeOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateDataLakeOrganizationConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDataLakeOrganizationConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateDataLakeOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateDataLakeOrganizationConfiguration",
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a subscription permission for accounts that are already enabled in
// Amazon Security Lake. You can create a subscriber with access to data in the
// current Amazon Web Services Region.
func (c *Client) CreateSubscriber(ctx context.Context, params *CreateSubscriberInput, optFns ...func(*Options)) (*CreateSubscriberOutput, error) {
if params == nil {
params = &CreateSubscriberInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSubscriber", params, optFns, c.addOperationCreateSubscriberMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSubscriberOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSubscriberInput struct {
// The supported Amazon Web Services from which logs and events are collected.
// Security Lake supports log and event collection for natively supported Amazon
// Web Services.
//
// This member is required.
Sources []types.LogSourceResource
// The AWS identity used to access your data.
//
// This member is required.
SubscriberIdentity *types.AwsIdentity
// The name of your Security Lake subscriber account.
//
// This member is required.
SubscriberName *string
// The Amazon S3 or Lake Formation access type.
AccessTypes []types.AccessType
// The description for your subscriber account in Security Lake.
SubscriberDescription *string
noSmithyDocumentSerde
}
type CreateSubscriberOutput struct {
// Retrieve information about the subscriber created using the CreateSubscriber
// API.
Subscriber *types.SubscriberResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSubscriberMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSubscriber{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSubscriber{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSubscriberValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSubscriber(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSubscriber(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateSubscriber",
}
}
| 146 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Notifies the subscriber when new data is written to the data lake for the
// sources that the subscriber consumes in Security Lake. You can create only one
// subscriber notification per subscriber.
func (c *Client) CreateSubscriberNotification(ctx context.Context, params *CreateSubscriberNotificationInput, optFns ...func(*Options)) (*CreateSubscriberNotificationOutput, error) {
if params == nil {
params = &CreateSubscriberNotificationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateSubscriberNotification", params, optFns, c.addOperationCreateSubscriberNotificationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateSubscriberNotificationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateSubscriberNotificationInput struct {
// Specify the configuration using which you want to create the subscriber
// notification.
//
// This member is required.
Configuration types.NotificationConfiguration
// The subscriber ID for the notification subscription.
//
// This member is required.
SubscriberId *string
noSmithyDocumentSerde
}
type CreateSubscriberNotificationOutput struct {
// The subscriber endpoint to which exception messages are posted.
SubscriberEndpoint *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateSubscriberNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateSubscriberNotificationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSubscriberNotification(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateSubscriberNotification(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "CreateSubscriberNotification",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a natively supported Amazon Web Service as an Amazon Security Lake
// source. You can remove a source for one or more Regions. When you remove the
// source, Security Lake stops collecting data from that source in the specified
// Regions and accounts, and subscribers can no longer consume new data from the
// source. However, subscribers can still consume data that Security Lake collected
// from the source before removal. You can choose any source type in any Amazon Web
// Services Region for either accounts that are part of a trusted organization or
// standalone accounts.
func (c *Client) DeleteAwsLogSource(ctx context.Context, params *DeleteAwsLogSourceInput, optFns ...func(*Options)) (*DeleteAwsLogSourceOutput, error) {
if params == nil {
params = &DeleteAwsLogSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteAwsLogSource", params, optFns, c.addOperationDeleteAwsLogSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteAwsLogSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteAwsLogSourceInput struct {
// Specify the natively-supported Amazon Web Services service to remove as a
// source in Security Lake.
//
// This member is required.
Sources []types.AwsLogSourceConfiguration
noSmithyDocumentSerde
}
type DeleteAwsLogSourceOutput struct {
// Deletion of the Amazon Web Services sources failed as the account is not a part
// of the organization.
Failed []string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteAwsLogSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAwsLogSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAwsLogSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteAwsLogSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAwsLogSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteAwsLogSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteAwsLogSource",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes a custom log source from Amazon Security Lake, to stop sending data
// from the custom source to Security Lake.
func (c *Client) DeleteCustomLogSource(ctx context.Context, params *DeleteCustomLogSourceInput, optFns ...func(*Options)) (*DeleteCustomLogSourceOutput, error) {
if params == nil {
params = &DeleteCustomLogSourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteCustomLogSource", params, optFns, c.addOperationDeleteCustomLogSourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteCustomLogSourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteCustomLogSourceInput struct {
// The source name of custom log source that you want to delete.
//
// This member is required.
SourceName *string
// The source version for the third-party custom source. You can limit the custom
// source removal to the specified source version.
SourceVersion *string
noSmithyDocumentSerde
}
type DeleteCustomLogSourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteCustomLogSourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCustomLogSource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCustomLogSource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteCustomLogSourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCustomLogSource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteCustomLogSource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteCustomLogSource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// When you disable Amazon Security Lake from your account, Security Lake is
// disabled in all Amazon Web Services Regions and it stops collecting data from
// your sources. Also, this API automatically takes steps to remove the account
// from Security Lake. However, Security Lake retains all of your existing settings
// and the resources that it created in your Amazon Web Services account in the
// current Amazon Web Services Region. The DeleteDataLake operation does not
// delete the data that is stored in your Amazon S3 bucket, which is owned by your
// Amazon Web Services account. For more information, see the Amazon Security Lake
// User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/disable-security-lake.html)
// .
func (c *Client) DeleteDataLake(ctx context.Context, params *DeleteDataLakeInput, optFns ...func(*Options)) (*DeleteDataLakeOutput, error) {
if params == nil {
params = &DeleteDataLakeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteDataLake", params, optFns, c.addOperationDeleteDataLakeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteDataLakeOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteDataLakeInput struct {
// The list of Regions where Security Lake is enabled.
//
// This member is required.
Regions []string
noSmithyDocumentSerde
}
type DeleteDataLakeOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteDataLakeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDataLake{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDataLake{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteDataLakeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataLake(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteDataLake(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteDataLake",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified notification subscription in Amazon Security Lake for the
// organization you specify.
func (c *Client) DeleteDataLakeExceptionSubscription(ctx context.Context, params *DeleteDataLakeExceptionSubscriptionInput, optFns ...func(*Options)) (*DeleteDataLakeExceptionSubscriptionOutput, error) {
if params == nil {
params = &DeleteDataLakeExceptionSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteDataLakeExceptionSubscription", params, optFns, c.addOperationDeleteDataLakeExceptionSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteDataLakeExceptionSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteDataLakeExceptionSubscriptionInput struct {
noSmithyDocumentSerde
}
type DeleteDataLakeExceptionSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteDataLakeExceptionSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataLakeExceptionSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteDataLakeExceptionSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteDataLakeExceptionSubscription",
}
}
| 112 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Removes automatic the enablement of configuration settings for new member
// accounts (but retains the settings for the delegated administrator) from Amazon
// Security Lake. You must run this API using the credentials of the delegated
// administrator. When you run this API, new member accounts that are added after
// the organization enables Security Lake won't contribute to the data lake.
func (c *Client) DeleteDataLakeOrganizationConfiguration(ctx context.Context, params *DeleteDataLakeOrganizationConfigurationInput, optFns ...func(*Options)) (*DeleteDataLakeOrganizationConfigurationOutput, error) {
if params == nil {
params = &DeleteDataLakeOrganizationConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteDataLakeOrganizationConfiguration", params, optFns, c.addOperationDeleteDataLakeOrganizationConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteDataLakeOrganizationConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteDataLakeOrganizationConfigurationInput struct {
// Removes the automatic enablement of configuration settings for new member
// accounts in Security Lake.
//
// This member is required.
AutoEnableNewAccount []types.DataLakeAutoEnableNewAccountConfiguration
noSmithyDocumentSerde
}
type DeleteDataLakeOrganizationConfigurationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteDataLakeOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteDataLakeOrganizationConfigurationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDataLakeOrganizationConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteDataLakeOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteDataLakeOrganizationConfiguration",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the subscription permission and all notification settings for accounts
// that are already enabled in Amazon Security Lake. When you run DeleteSubscriber
// , the subscriber will no longer consume data from Security Lake and the
// subscriber is removed. This operation deletes the subscriber and removes access
// to data in the current Amazon Web Services Region.
func (c *Client) DeleteSubscriber(ctx context.Context, params *DeleteSubscriberInput, optFns ...func(*Options)) (*DeleteSubscriberOutput, error) {
if params == nil {
params = &DeleteSubscriberInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSubscriber", params, optFns, c.addOperationDeleteSubscriberMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSubscriberOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSubscriberInput struct {
// A value created by Security Lake that uniquely identifies your DeleteSubscriber
// API request.
//
// This member is required.
SubscriberId *string
noSmithyDocumentSerde
}
type DeleteSubscriberOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSubscriberMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSubscriber{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSubscriber{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSubscriberValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSubscriber(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSubscriber(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteSubscriber",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified notification subscription in Amazon Security Lake for the
// organization you specify.
func (c *Client) DeleteSubscriberNotification(ctx context.Context, params *DeleteSubscriberNotificationInput, optFns ...func(*Options)) (*DeleteSubscriberNotificationOutput, error) {
if params == nil {
params = &DeleteSubscriberNotificationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteSubscriberNotification", params, optFns, c.addOperationDeleteSubscriberNotificationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteSubscriberNotificationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteSubscriberNotificationInput struct {
// The ID of the Security Lake subscriber account.
//
// This member is required.
SubscriberId *string
noSmithyDocumentSerde
}
type DeleteSubscriberNotificationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteSubscriberNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteSubscriberNotificationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSubscriberNotification(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteSubscriberNotification(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeleteSubscriberNotification",
}
}
| 121 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the Amazon Security Lake delegated administrator account for the
// organization. This API can only be called by the organization management
// account. The organization management account cannot be the delegated
// administrator account.
func (c *Client) DeregisterDataLakeDelegatedAdministrator(ctx context.Context, params *DeregisterDataLakeDelegatedAdministratorInput, optFns ...func(*Options)) (*DeregisterDataLakeDelegatedAdministratorOutput, error) {
if params == nil {
params = &DeregisterDataLakeDelegatedAdministratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeregisterDataLakeDelegatedAdministrator", params, optFns, c.addOperationDeregisterDataLakeDelegatedAdministratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeregisterDataLakeDelegatedAdministratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeregisterDataLakeDelegatedAdministratorInput struct {
noSmithyDocumentSerde
}
type DeregisterDataLakeDelegatedAdministratorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeregisterDataLakeDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterDataLakeDelegatedAdministrator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterDataLakeDelegatedAdministrator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterDataLakeDelegatedAdministrator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeregisterDataLakeDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "DeregisterDataLakeDelegatedAdministrator",
}
}
| 114 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the details of exception notifications for the account in Amazon
// Security Lake.
func (c *Client) GetDataLakeExceptionSubscription(ctx context.Context, params *GetDataLakeExceptionSubscriptionInput, optFns ...func(*Options)) (*GetDataLakeExceptionSubscriptionOutput, error) {
if params == nil {
params = &GetDataLakeExceptionSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDataLakeExceptionSubscription", params, optFns, c.addOperationGetDataLakeExceptionSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDataLakeExceptionSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDataLakeExceptionSubscriptionInput struct {
noSmithyDocumentSerde
}
type GetDataLakeExceptionSubscriptionOutput struct {
// The expiration period and time-to-live (TTL).
ExceptionTimeToLive *int64
// The Amazon Web Services account where you receive exception notifications.
NotificationEndpoint *string
// The subscription protocol to which exception notifications are posted.
SubscriptionProtocol *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDataLakeExceptionSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataLakeExceptionSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetDataLakeExceptionSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "GetDataLakeExceptionSubscription",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the configuration that will be automatically set up for accounts
// added to the organization after the organization has onboarded to Amazon
// Security Lake. This API does not take input parameters.
func (c *Client) GetDataLakeOrganizationConfiguration(ctx context.Context, params *GetDataLakeOrganizationConfigurationInput, optFns ...func(*Options)) (*GetDataLakeOrganizationConfigurationOutput, error) {
if params == nil {
params = &GetDataLakeOrganizationConfigurationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDataLakeOrganizationConfiguration", params, optFns, c.addOperationGetDataLakeOrganizationConfigurationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDataLakeOrganizationConfigurationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDataLakeOrganizationConfigurationInput struct {
noSmithyDocumentSerde
}
type GetDataLakeOrganizationConfigurationOutput struct {
// The configuration for new accounts.
AutoEnableNewAccount []types.DataLakeAutoEnableNewAccountConfiguration
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDataLakeOrganizationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataLakeOrganizationConfiguration{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataLakeOrganizationConfiguration(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetDataLakeOrganizationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "GetDataLakeOrganizationConfiguration",
}
}
| 118 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves a snapshot of the current Region, including whether Amazon Security
// Lake is enabled for those accounts and which sources Security Lake is collecting
// data from.
func (c *Client) GetDataLakeSources(ctx context.Context, params *GetDataLakeSourcesInput, optFns ...func(*Options)) (*GetDataLakeSourcesOutput, error) {
if params == nil {
params = &GetDataLakeSourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetDataLakeSources", params, optFns, c.addOperationGetDataLakeSourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetDataLakeSourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetDataLakeSourcesInput struct {
// The Amazon Web Services account ID for which a static snapshot of the current
// Amazon Web Services Region, including enabled accounts and log sources, is
// retrieved.
Accounts []string
// The maximum limit of accounts for which the static snapshot of the current
// Region, including enabled accounts and log sources, is retrieved.
MaxResults *int32
// Lists if there are more results available. The value of nextToken is a unique
// pagination token for each page. Repeat the call using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error.
NextToken *string
noSmithyDocumentSerde
}
type GetDataLakeSourcesOutput struct {
// The Amazon Resource Name (ARN) created by you to provide to the subscriber. For
// more information about ARNs and how to use them in policies, see the Amazon
// Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)
// .
DataLakeArn *string
// The list of enabled accounts and enabled sources.
DataLakeSources []types.DataLakeSource
// Lists if there are more results available. The value of nextToken is a unique
// pagination token for each page. Repeat the call using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetDataLakeSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDataLakeSources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDataLakeSources{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDataLakeSources(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// GetDataLakeSourcesAPIClient is a client that implements the GetDataLakeSources
// operation.
type GetDataLakeSourcesAPIClient interface {
GetDataLakeSources(context.Context, *GetDataLakeSourcesInput, ...func(*Options)) (*GetDataLakeSourcesOutput, error)
}
var _ GetDataLakeSourcesAPIClient = (*Client)(nil)
// GetDataLakeSourcesPaginatorOptions is the paginator options for
// GetDataLakeSources
type GetDataLakeSourcesPaginatorOptions struct {
// The maximum limit of accounts for which the static snapshot of the current
// Region, including enabled accounts and log sources, is 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
}
// GetDataLakeSourcesPaginator is a paginator for GetDataLakeSources
type GetDataLakeSourcesPaginator struct {
options GetDataLakeSourcesPaginatorOptions
client GetDataLakeSourcesAPIClient
params *GetDataLakeSourcesInput
nextToken *string
firstPage bool
}
// NewGetDataLakeSourcesPaginator returns a new GetDataLakeSourcesPaginator
func NewGetDataLakeSourcesPaginator(client GetDataLakeSourcesAPIClient, params *GetDataLakeSourcesInput, optFns ...func(*GetDataLakeSourcesPaginatorOptions)) *GetDataLakeSourcesPaginator {
if params == nil {
params = &GetDataLakeSourcesInput{}
}
options := GetDataLakeSourcesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &GetDataLakeSourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *GetDataLakeSourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next GetDataLakeSources page.
func (p *GetDataLakeSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetDataLakeSourcesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.GetDataLakeSources(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opGetDataLakeSources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "GetDataLakeSources",
}
}
| 241 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the subscription information for the specified subscription ID. You
// can get information about a specific subscriber.
func (c *Client) GetSubscriber(ctx context.Context, params *GetSubscriberInput, optFns ...func(*Options)) (*GetSubscriberOutput, error) {
if params == nil {
params = &GetSubscriberInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetSubscriber", params, optFns, c.addOperationGetSubscriberMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetSubscriberOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetSubscriberInput struct {
// A value created by Amazon Security Lake that uniquely identifies your
// GetSubscriber API request.
//
// This member is required.
SubscriberId *string
noSmithyDocumentSerde
}
type GetSubscriberOutput struct {
// The subscriber information for the specified subscriber ID.
Subscriber *types.SubscriberResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetSubscriberMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSubscriber{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSubscriber{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetSubscriberValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSubscriber(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetSubscriber(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "GetSubscriber",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists the Amazon Security Lake exceptions that you can use to find the source
// of problems and fix them.
func (c *Client) ListDataLakeExceptions(ctx context.Context, params *ListDataLakeExceptionsInput, optFns ...func(*Options)) (*ListDataLakeExceptionsOutput, error) {
if params == nil {
params = &ListDataLakeExceptionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDataLakeExceptions", params, optFns, c.addOperationListDataLakeExceptionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDataLakeExceptionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDataLakeExceptionsInput struct {
// List the maximum number of failures in Security Lake.
MaxResults *int32
// List if there are more results available. The value of nextToken is a unique
// pagination token for each page. Repeat the call using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error.
NextToken *string
// List the Amazon Web Services Regions from which exceptions are retrieved.
Regions []string
noSmithyDocumentSerde
}
type ListDataLakeExceptionsOutput struct {
// Lists the failures that cannot be retried in the current Region.
Exceptions []types.DataLakeException
// List if there are more results available. The value of nextToken is a unique
// pagination token for each page. Repeat the call using the returned token to
// retrieve the next page. Keep all other arguments unchanged. Each pagination
// token expires after 24 hours. Using an expired pagination token will return an
// HTTP 400 InvalidToken error.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDataLakeExceptionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataLakeExceptions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataLakeExceptions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataLakeExceptions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListDataLakeExceptionsAPIClient is a client that implements the
// ListDataLakeExceptions operation.
type ListDataLakeExceptionsAPIClient interface {
ListDataLakeExceptions(context.Context, *ListDataLakeExceptionsInput, ...func(*Options)) (*ListDataLakeExceptionsOutput, error)
}
var _ ListDataLakeExceptionsAPIClient = (*Client)(nil)
// ListDataLakeExceptionsPaginatorOptions is the paginator options for
// ListDataLakeExceptions
type ListDataLakeExceptionsPaginatorOptions struct {
// List the maximum number of failures in Security Lake.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListDataLakeExceptionsPaginator is a paginator for ListDataLakeExceptions
type ListDataLakeExceptionsPaginator struct {
options ListDataLakeExceptionsPaginatorOptions
client ListDataLakeExceptionsAPIClient
params *ListDataLakeExceptionsInput
nextToken *string
firstPage bool
}
// NewListDataLakeExceptionsPaginator returns a new ListDataLakeExceptionsPaginator
func NewListDataLakeExceptionsPaginator(client ListDataLakeExceptionsAPIClient, params *ListDataLakeExceptionsInput, optFns ...func(*ListDataLakeExceptionsPaginatorOptions)) *ListDataLakeExceptionsPaginator {
if params == nil {
params = &ListDataLakeExceptionsInput{}
}
options := ListDataLakeExceptionsPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListDataLakeExceptionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListDataLakeExceptionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListDataLakeExceptions page.
func (p *ListDataLakeExceptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDataLakeExceptionsOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListDataLakeExceptions(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListDataLakeExceptions(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "ListDataLakeExceptions",
}
}
| 230 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the Amazon Security Lake configuration object for the specified
// Amazon Web Services account ID. You can use the ListDataLakes API to know
// whether Security Lake is enabled for any region.
func (c *Client) ListDataLakes(ctx context.Context, params *ListDataLakesInput, optFns ...func(*Options)) (*ListDataLakesOutput, error) {
if params == nil {
params = &ListDataLakesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListDataLakes", params, optFns, c.addOperationListDataLakesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListDataLakesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListDataLakesInput struct {
// The list of regions where Security Lake is enabled.
Regions []string
noSmithyDocumentSerde
}
type ListDataLakesOutput struct {
// Retrieves the Security Lake configuration object.
DataLakes []types.DataLakeResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListDataLakesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListDataLakes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDataLakes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDataLakes(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opListDataLakes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "ListDataLakes",
}
}
| 122 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the log sources in the current Amazon Web Services Region.
func (c *Client) ListLogSources(ctx context.Context, params *ListLogSourcesInput, optFns ...func(*Options)) (*ListLogSourcesOutput, error) {
if params == nil {
params = &ListLogSourcesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListLogSources", params, optFns, c.addOperationListLogSourcesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListLogSourcesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListLogSourcesInput struct {
// The list of Amazon Web Services accounts for which log sources are displayed.
Accounts []string
// The maximum number of accounts for which the log sources are displayed.
MaxResults *int32
// If nextToken is returned, there are more results available. You can repeat the
// call using the returned token to retrieve the next page.
NextToken *string
// The list of regions for which log sources are displayed.
Regions []string
// The list of sources for which log sources are displayed.
Sources []types.LogSourceResource
noSmithyDocumentSerde
}
type ListLogSourcesOutput struct {
// If nextToken is returned, there are more results available. You can repeat the
// call using the returned token to retrieve the next page.
NextToken *string
// The list of log sources in your organization that send data to the data lake.
Sources []types.LogSource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListLogSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListLogSources{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLogSources{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLogSources(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListLogSourcesAPIClient is a client that implements the ListLogSources
// operation.
type ListLogSourcesAPIClient interface {
ListLogSources(context.Context, *ListLogSourcesInput, ...func(*Options)) (*ListLogSourcesOutput, error)
}
var _ ListLogSourcesAPIClient = (*Client)(nil)
// ListLogSourcesPaginatorOptions is the paginator options for ListLogSources
type ListLogSourcesPaginatorOptions struct {
// The maximum number of accounts for which the log sources are displayed.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListLogSourcesPaginator is a paginator for ListLogSources
type ListLogSourcesPaginator struct {
options ListLogSourcesPaginatorOptions
client ListLogSourcesAPIClient
params *ListLogSourcesInput
nextToken *string
firstPage bool
}
// NewListLogSourcesPaginator returns a new ListLogSourcesPaginator
func NewListLogSourcesPaginator(client ListLogSourcesAPIClient, params *ListLogSourcesInput, optFns ...func(*ListLogSourcesPaginatorOptions)) *ListLogSourcesPaginator {
if params == nil {
params = &ListLogSourcesInput{}
}
options := ListLogSourcesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListLogSourcesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListLogSourcesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListLogSources page.
func (p *ListLogSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogSourcesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListLogSources(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListLogSources(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "ListLogSources",
}
}
| 228 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// List all subscribers for the specific Amazon Security Lake account ID. You can
// retrieve a list of subscriptions associated with a specific organization or
// Amazon Web Services account.
func (c *Client) ListSubscribers(ctx context.Context, params *ListSubscribersInput, optFns ...func(*Options)) (*ListSubscribersOutput, error) {
if params == nil {
params = &ListSubscribersInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListSubscribers", params, optFns, c.addOperationListSubscribersMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListSubscribersOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListSubscribersInput struct {
// The maximum number of accounts for which the configuration is displayed.
MaxResults *int32
// If nextToken is returned, there are more results available. You can repeat the
// call using the returned token to retrieve the next page.
NextToken *string
noSmithyDocumentSerde
}
type ListSubscribersOutput struct {
// If nextToken is returned, there are more results available. You can repeat the
// call using the returned token to retrieve the next page.
NextToken *string
// The subscribers available for the specified Security Lake account ID.
Subscribers []types.SubscriberResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListSubscribersMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListSubscribers{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSubscribers{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSubscribers(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
// ListSubscribersAPIClient is a client that implements the ListSubscribers
// operation.
type ListSubscribersAPIClient interface {
ListSubscribers(context.Context, *ListSubscribersInput, ...func(*Options)) (*ListSubscribersOutput, error)
}
var _ ListSubscribersAPIClient = (*Client)(nil)
// ListSubscribersPaginatorOptions is the paginator options for ListSubscribers
type ListSubscribersPaginatorOptions struct {
// The maximum number of accounts for which the configuration is displayed.
Limit int32
// Set to true if pagination should stop if the service returns a pagination token
// that matches the most recent token provided to the service.
StopOnDuplicateToken bool
}
// ListSubscribersPaginator is a paginator for ListSubscribers
type ListSubscribersPaginator struct {
options ListSubscribersPaginatorOptions
client ListSubscribersAPIClient
params *ListSubscribersInput
nextToken *string
firstPage bool
}
// NewListSubscribersPaginator returns a new ListSubscribersPaginator
func NewListSubscribersPaginator(client ListSubscribersAPIClient, params *ListSubscribersInput, optFns ...func(*ListSubscribersPaginatorOptions)) *ListSubscribersPaginator {
if params == nil {
params = &ListSubscribersInput{}
}
options := ListSubscribersPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListSubscribersPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListSubscribersPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListSubscribers page.
func (p *ListSubscribersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSubscribersOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListSubscribers(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
func newServiceMetadataMiddleware_opListSubscribers(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "ListSubscribers",
}
}
| 221 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Designates the Amazon Security Lake delegated administrator account for the
// organization. This API can only be called by the organization management
// account. The organization management account cannot be the delegated
// administrator account.
func (c *Client) RegisterDataLakeDelegatedAdministrator(ctx context.Context, params *RegisterDataLakeDelegatedAdministratorInput, optFns ...func(*Options)) (*RegisterDataLakeDelegatedAdministratorOutput, error) {
if params == nil {
params = &RegisterDataLakeDelegatedAdministratorInput{}
}
result, metadata, err := c.invokeOperation(ctx, "RegisterDataLakeDelegatedAdministrator", params, optFns, c.addOperationRegisterDataLakeDelegatedAdministratorMiddlewares)
if err != nil {
return nil, err
}
out := result.(*RegisterDataLakeDelegatedAdministratorOutput)
out.ResultMetadata = metadata
return out, nil
}
type RegisterDataLakeDelegatedAdministratorInput struct {
// The Amazon Web Services account ID of the Security Lake delegated administrator.
//
// This member is required.
AccountId *string
noSmithyDocumentSerde
}
type RegisterDataLakeDelegatedAdministratorOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationRegisterDataLakeDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterDataLakeDelegatedAdministrator{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterDataLakeDelegatedAdministrator{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpRegisterDataLakeDelegatedAdministratorValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDataLakeDelegatedAdministrator(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opRegisterDataLakeDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "RegisterDataLakeDelegatedAdministrator",
}
}
| 123 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Specifies where to store your security data and for how long. You can add a
// rollup Region to consolidate data from multiple Amazon Web Services Regions.
func (c *Client) UpdateDataLake(ctx context.Context, params *UpdateDataLakeInput, optFns ...func(*Options)) (*UpdateDataLakeOutput, error) {
if params == nil {
params = &UpdateDataLakeInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDataLake", params, optFns, c.addOperationUpdateDataLakeMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDataLakeOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDataLakeInput struct {
// Specify the Region or Regions that will contribute data to the rollup region.
//
// This member is required.
Configurations []types.DataLakeConfiguration
noSmithyDocumentSerde
}
type UpdateDataLakeOutput struct {
// The created Security Lake configuration object.
DataLakes []types.DataLakeResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDataLakeMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDataLake{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDataLake{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateDataLakeValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataLake(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateDataLake(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "UpdateDataLake",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified notification subscription in Amazon Security Lake for the
// organization you specify.
func (c *Client) UpdateDataLakeExceptionSubscription(ctx context.Context, params *UpdateDataLakeExceptionSubscriptionInput, optFns ...func(*Options)) (*UpdateDataLakeExceptionSubscriptionOutput, error) {
if params == nil {
params = &UpdateDataLakeExceptionSubscriptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateDataLakeExceptionSubscription", params, optFns, c.addOperationUpdateDataLakeExceptionSubscriptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateDataLakeExceptionSubscriptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateDataLakeExceptionSubscriptionInput struct {
// The account that is subscribed to receive exception notifications.
//
// This member is required.
NotificationEndpoint *string
// The subscription protocol to which exception messages are posted.
//
// This member is required.
SubscriptionProtocol *string
// The time-to-live (TTL) for the exception message to remain.
ExceptionTimeToLive *int64
noSmithyDocumentSerde
}
type UpdateDataLakeExceptionSubscriptionOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateDataLakeExceptionSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDataLakeExceptionSubscription{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateDataLakeExceptionSubscriptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDataLakeExceptionSubscription(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateDataLakeExceptionSubscription(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "UpdateDataLakeExceptionSubscription",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing subscription for the given Amazon Security Lake account ID.
// You can update a subscriber by changing the sources that the subscriber consumes
// data from.
func (c *Client) UpdateSubscriber(ctx context.Context, params *UpdateSubscriberInput, optFns ...func(*Options)) (*UpdateSubscriberOutput, error) {
if params == nil {
params = &UpdateSubscriberInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSubscriber", params, optFns, c.addOperationUpdateSubscriberMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSubscriberOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSubscriberInput struct {
// A value created by Security Lake that uniquely identifies your subscription.
//
// This member is required.
SubscriberId *string
// The supported Amazon Web Services from which logs and events are collected. For
// the list of supported Amazon Web Services, see the Amazon Security Lake User
// Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html)
// .
Sources []types.LogSourceResource
// The description of the Security Lake account subscriber.
SubscriberDescription *string
// The AWS identity used to access your data.
SubscriberIdentity *types.AwsIdentity
// The name of the Security Lake account subscriber.
SubscriberName *string
noSmithyDocumentSerde
}
type UpdateSubscriberOutput struct {
// The updated subscriber information.
Subscriber *types.SubscriberResource
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSubscriberMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSubscriber{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSubscriber{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSubscriberValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSubscriber(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSubscriber(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "UpdateSubscriber",
}
}
| 142 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates an existing notification method for the subscription (SQS or HTTPs
// endpoint) or switches the notification subscription endpoint for a subscriber.
func (c *Client) UpdateSubscriberNotification(ctx context.Context, params *UpdateSubscriberNotificationInput, optFns ...func(*Options)) (*UpdateSubscriberNotificationOutput, error) {
if params == nil {
params = &UpdateSubscriberNotificationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateSubscriberNotification", params, optFns, c.addOperationUpdateSubscriberNotificationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateSubscriberNotificationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateSubscriberNotificationInput struct {
// The configuration for subscriber notification.
//
// This member is required.
Configuration types.NotificationConfiguration
// The subscription ID for which the subscription notification is specified.
//
// This member is required.
SubscriberId *string
noSmithyDocumentSerde
}
type UpdateSubscriberNotificationOutput struct {
// The subscriber endpoint to which exception messages are posted.
SubscriberEndpoint *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateSubscriberNotificationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSubscriberNotification{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateSubscriberNotificationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSubscriberNotification(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateSubscriberNotification(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "securitylake",
OperationName: "UpdateSubscriberNotification",
}
}
| 131 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithytime "github.com/aws/smithy-go/time"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"strconv"
"strings"
)
type awsRestjson1_deserializeOpCreateAwsLogSource struct {
}
func (*awsRestjson1_deserializeOpCreateAwsLogSource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateAwsLogSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateAwsLogSource(response, &metadata)
}
output := &CreateAwsLogSourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateAwsLogSourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateAwsLogSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateAwsLogSourceOutput(v **CreateAwsLogSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateAwsLogSourceOutput
if *v == nil {
sv = &CreateAwsLogSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failed":
if err := awsRestjson1_deserializeDocumentAccountList(&sv.Failed, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateCustomLogSource struct {
}
func (*awsRestjson1_deserializeOpCreateCustomLogSource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateCustomLogSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateCustomLogSource(response, &metadata)
}
output := &CreateCustomLogSourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateCustomLogSourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateCustomLogSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateCustomLogSourceOutput(v **CreateCustomLogSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateCustomLogSourceOutput
if *v == nil {
sv = &CreateCustomLogSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "source":
if err := awsRestjson1_deserializeDocumentCustomLogSourceResource(&sv.Source, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateDataLake struct {
}
func (*awsRestjson1_deserializeOpCreateDataLake) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDataLake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateDataLake(response, &metadata)
}
output := &CreateDataLakeOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateDataLakeOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDataLake(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateDataLakeOutput(v **CreateDataLakeOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateDataLakeOutput
if *v == nil {
sv = &CreateDataLakeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dataLakes":
if err := awsRestjson1_deserializeDocumentDataLakeResourceList(&sv.DataLakes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_deserializeOpCreateDataLakeExceptionSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDataLakeExceptionSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateDataLakeExceptionSubscription(response, &metadata)
}
output := &CreateDataLakeExceptionSubscriptionOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDataLakeExceptionSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_deserializeOpCreateDataLakeOrganizationConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateDataLakeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateDataLakeOrganizationConfiguration(response, &metadata)
}
output := &CreateDataLakeOrganizationConfigurationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateDataLakeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpCreateSubscriber struct {
}
func (*awsRestjson1_deserializeOpCreateSubscriber) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateSubscriber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateSubscriber(response, &metadata)
}
output := &CreateSubscriberOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateSubscriberOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateSubscriber(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateSubscriberOutput(v **CreateSubscriberOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSubscriberOutput
if *v == nil {
sv = &CreateSubscriberOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "subscriber":
if err := awsRestjson1_deserializeDocumentSubscriberResource(&sv.Subscriber, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateSubscriberNotification struct {
}
func (*awsRestjson1_deserializeOpCreateSubscriberNotification) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateSubscriberNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateSubscriberNotification(response, &metadata)
}
output := &CreateSubscriberNotificationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateSubscriberNotificationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateSubscriberNotification(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateSubscriberNotificationOutput(v **CreateSubscriberNotificationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateSubscriberNotificationOutput
if *v == nil {
sv = &CreateSubscriberNotificationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "subscriberEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.SubscriberEndpoint = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteAwsLogSource struct {
}
func (*awsRestjson1_deserializeOpDeleteAwsLogSource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteAwsLogSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteAwsLogSource(response, &metadata)
}
output := &DeleteAwsLogSourceOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentDeleteAwsLogSourceOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteAwsLogSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentDeleteAwsLogSourceOutput(v **DeleteAwsLogSourceOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *DeleteAwsLogSourceOutput
if *v == nil {
sv = &DeleteAwsLogSourceOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "failed":
if err := awsRestjson1_deserializeDocumentAccountList(&sv.Failed, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteCustomLogSource struct {
}
func (*awsRestjson1_deserializeOpDeleteCustomLogSource) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteCustomLogSource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteCustomLogSource(response, &metadata)
}
output := &DeleteCustomLogSourceOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteCustomLogSource(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteDataLake struct {
}
func (*awsRestjson1_deserializeOpDeleteDataLake) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDataLake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataLake(response, &metadata)
}
output := &DeleteDataLakeOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteDataLake(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_deserializeOpDeleteDataLakeExceptionSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDataLakeExceptionSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataLakeExceptionSubscription(response, &metadata)
}
output := &DeleteDataLakeExceptionSubscriptionOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteDataLakeExceptionSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_deserializeOpDeleteDataLakeOrganizationConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteDataLakeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteDataLakeOrganizationConfiguration(response, &metadata)
}
output := &DeleteDataLakeOrganizationConfigurationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteDataLakeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSubscriber struct {
}
func (*awsRestjson1_deserializeOpDeleteSubscriber) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSubscriber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteSubscriber(response, &metadata)
}
output := &DeleteSubscriberOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSubscriber(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeleteSubscriberNotification struct {
}
func (*awsRestjson1_deserializeOpDeleteSubscriberNotification) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteSubscriberNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteSubscriberNotification(response, &metadata)
}
output := &DeleteSubscriberNotificationOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteSubscriberNotification(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpDeregisterDataLakeDelegatedAdministrator struct {
}
func (*awsRestjson1_deserializeOpDeregisterDataLakeDelegatedAdministrator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeregisterDataLakeDelegatedAdministrator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeregisterDataLakeDelegatedAdministrator(response, &metadata)
}
output := &DeregisterDataLakeDelegatedAdministratorOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeregisterDataLakeDelegatedAdministrator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpGetDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_deserializeOpGetDataLakeExceptionSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDataLakeExceptionSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetDataLakeExceptionSubscription(response, &metadata)
}
output := &GetDataLakeExceptionSubscriptionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetDataLakeExceptionSubscriptionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetDataLakeExceptionSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDataLakeExceptionSubscriptionOutput(v **GetDataLakeExceptionSubscriptionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDataLakeExceptionSubscriptionOutput
if *v == nil {
sv = &GetDataLakeExceptionSubscriptionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exceptionTimeToLive":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Long to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.ExceptionTimeToLive = ptr.Int64(i64)
}
case "notificationEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.NotificationEndpoint = ptr.String(jtv)
}
case "subscriptionProtocol":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubscriptionProtocol to be of type string, got %T instead", value)
}
sv.SubscriptionProtocol = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_deserializeOpGetDataLakeOrganizationConfiguration) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDataLakeOrganizationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetDataLakeOrganizationConfiguration(response, &metadata)
}
output := &GetDataLakeOrganizationConfigurationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetDataLakeOrganizationConfigurationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetDataLakeOrganizationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDataLakeOrganizationConfigurationOutput(v **GetDataLakeOrganizationConfigurationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDataLakeOrganizationConfigurationOutput
if *v == nil {
sv = &GetDataLakeOrganizationConfigurationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "autoEnableNewAccount":
if err := awsRestjson1_deserializeDocumentDataLakeAutoEnableNewAccountConfigurationList(&sv.AutoEnableNewAccount, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetDataLakeSources struct {
}
func (*awsRestjson1_deserializeOpGetDataLakeSources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetDataLakeSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetDataLakeSources(response, &metadata)
}
output := &GetDataLakeSourcesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetDataLakeSourcesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetDataLakeSources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetDataLakeSourcesOutput(v **GetDataLakeSourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetDataLakeSourcesOutput
if *v == nil {
sv = &GetDataLakeSourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dataLakeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.DataLakeArn = ptr.String(jtv)
}
case "dataLakeSources":
if err := awsRestjson1_deserializeDocumentDataLakeSourceList(&sv.DataLakeSources, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetSubscriber struct {
}
func (*awsRestjson1_deserializeOpGetSubscriber) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetSubscriber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetSubscriber(response, &metadata)
}
output := &GetSubscriberOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetSubscriberOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetSubscriber(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetSubscriberOutput(v **GetSubscriberOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetSubscriberOutput
if *v == nil {
sv = &GetSubscriberOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "subscriber":
if err := awsRestjson1_deserializeDocumentSubscriberResource(&sv.Subscriber, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDataLakeExceptions struct {
}
func (*awsRestjson1_deserializeOpListDataLakeExceptions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDataLakeExceptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListDataLakeExceptions(response, &metadata)
}
output := &ListDataLakeExceptionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListDataLakeExceptionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListDataLakeExceptions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDataLakeExceptionsOutput(v **ListDataLakeExceptionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDataLakeExceptionsOutput
if *v == nil {
sv = &ListDataLakeExceptionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exceptions":
if err := awsRestjson1_deserializeDocumentDataLakeExceptionList(&sv.Exceptions, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListDataLakes struct {
}
func (*awsRestjson1_deserializeOpListDataLakes) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListDataLakes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListDataLakes(response, &metadata)
}
output := &ListDataLakesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListDataLakesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListDataLakes(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListDataLakesOutput(v **ListDataLakesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListDataLakesOutput
if *v == nil {
sv = &ListDataLakesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dataLakes":
if err := awsRestjson1_deserializeDocumentDataLakeResourceList(&sv.DataLakes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListLogSources struct {
}
func (*awsRestjson1_deserializeOpListLogSources) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListLogSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListLogSources(response, &metadata)
}
output := &ListLogSourcesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListLogSourcesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListLogSources(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListLogSourcesOutput(v **ListLogSourcesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListLogSourcesOutput
if *v == nil {
sv = &ListLogSourcesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "sources":
if err := awsRestjson1_deserializeDocumentLogSourceList(&sv.Sources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListSubscribers struct {
}
func (*awsRestjson1_deserializeOpListSubscribers) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListSubscribers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListSubscribers(response, &metadata)
}
output := &ListSubscribersOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListSubscribersOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListSubscribers(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListSubscribersOutput(v **ListSubscribersOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListSubscribersOutput
if *v == nil {
sv = &ListSubscribersOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected NextToken to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "subscribers":
if err := awsRestjson1_deserializeDocumentSubscriberResourceList(&sv.Subscribers, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpRegisterDataLakeDelegatedAdministrator struct {
}
func (*awsRestjson1_deserializeOpRegisterDataLakeDelegatedAdministrator) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpRegisterDataLakeDelegatedAdministrator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorRegisterDataLakeDelegatedAdministrator(response, &metadata)
}
output := &RegisterDataLakeDelegatedAdministratorOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorRegisterDataLakeDelegatedAdministrator(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateDataLake struct {
}
func (*awsRestjson1_deserializeOpUpdateDataLake) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateDataLake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataLake(response, &metadata)
}
output := &UpdateDataLakeOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateDataLakeOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateDataLake(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateDataLakeOutput(v **UpdateDataLakeOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateDataLakeOutput
if *v == nil {
sv = &UpdateDataLakeOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dataLakes":
if err := awsRestjson1_deserializeDocumentDataLakeResourceList(&sv.DataLakes, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_deserializeOpUpdateDataLakeExceptionSubscription) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateDataLakeExceptionSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateDataLakeExceptionSubscription(response, &metadata)
}
output := &UpdateDataLakeExceptionSubscriptionOutput{}
out.Result = output
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateDataLakeExceptionSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateSubscriber struct {
}
func (*awsRestjson1_deserializeOpUpdateSubscriber) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateSubscriber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateSubscriber(response, &metadata)
}
output := &UpdateSubscriberOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateSubscriberOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateSubscriber(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateSubscriberOutput(v **UpdateSubscriberOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSubscriberOutput
if *v == nil {
sv = &UpdateSubscriberOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "subscriber":
if err := awsRestjson1_deserializeDocumentSubscriberResource(&sv.Subscriber, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUpdateSubscriberNotification struct {
}
func (*awsRestjson1_deserializeOpUpdateSubscriberNotification) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateSubscriberNotification) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateSubscriberNotification(response, &metadata)
}
output := &UpdateSubscriberNotificationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateSubscriberNotificationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateSubscriberNotification(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("AccessDeniedException", errorCode):
return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody)
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("InternalServerException", errorCode):
return awsRestjson1_deserializeErrorInternalServerException(response, errorBody)
case strings.EqualFold("ResourceNotFoundException", errorCode):
return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody)
case strings.EqualFold("ThrottlingException", errorCode):
return awsRestjson1_deserializeErrorThrottlingException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateSubscriberNotificationOutput(v **UpdateSubscriberNotificationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateSubscriberNotificationOutput
if *v == nil {
sv = &UpdateSubscriberNotificationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "subscriberEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.SubscriberEndpoint = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error {
if v == nil {
return fmt.Errorf("unsupported deserialization for nil %T", v)
}
if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 {
headerValues[0] = strings.TrimSpace(headerValues[0])
vv, err := strconv.ParseInt(headerValues[0], 0, 32)
if err != nil {
return err
}
v.RetryAfterSeconds = ptr.Int32(int32(vv))
}
return nil
}
func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.AccessDeniedException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadRequestException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ResourceNotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ThrottlingException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)}
}
return output
}
func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AccessDeniedException
if *v == nil {
sv = &types.AccessDeniedException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAccessTypeList(v *[]types.AccessType, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.AccessType
if *v == nil {
cv = []types.AccessType{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AccessType
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AccessType to be of type string, got %T instead", value)
}
col = types.AccessType(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAccountList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentAwsIdentity(v **types.AwsIdentity, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AwsIdentity
if *v == nil {
sv = &types.AwsIdentity{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "externalId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ExternalId to be of type string, got %T instead", value)
}
sv.ExternalId = ptr.String(jtv)
}
case "principal":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsPrincipal to be of type string, got %T instead", value)
}
sv.Principal = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAwsLogSourceResource(v **types.AwsLogSourceResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.AwsLogSourceResource
if *v == nil {
sv = &types.AwsLogSourceResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "sourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsLogSourceName to be of type string, got %T instead", value)
}
sv.SourceName = types.AwsLogSourceName(jtv)
}
case "sourceVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsLogSourceVersion to be of type string, got %T instead", value)
}
sv.SourceVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentAwsLogSourceResourceList(v *[]types.AwsLogSourceResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.AwsLogSourceResource
if *v == nil {
cv = []types.AwsLogSourceResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.AwsLogSourceResource
destAddr := &col
if err := awsRestjson1_deserializeDocumentAwsLogSourceResource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BadRequestException
if *v == nil {
sv = &types.BadRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCustomLogSourceAttributes(v **types.CustomLogSourceAttributes, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomLogSourceAttributes
if *v == nil {
sv = &types.CustomLogSourceAttributes{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "crawlerArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.CrawlerArn = ptr.String(jtv)
}
case "databaseArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.DatabaseArn = ptr.String(jtv)
}
case "tableArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.TableArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCustomLogSourceProvider(v **types.CustomLogSourceProvider, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomLogSourceProvider
if *v == nil {
sv = &types.CustomLogSourceProvider{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "location":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3URI to be of type string, got %T instead", value)
}
sv.Location = ptr.String(jtv)
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentCustomLogSourceResource(v **types.CustomLogSourceResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.CustomLogSourceResource
if *v == nil {
sv = &types.CustomLogSourceResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "attributes":
if err := awsRestjson1_deserializeDocumentCustomLogSourceAttributes(&sv.Attributes, value); err != nil {
return err
}
case "provider":
if err := awsRestjson1_deserializeDocumentCustomLogSourceProvider(&sv.Provider, value); err != nil {
return err
}
case "sourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomLogSourceName to be of type string, got %T instead", value)
}
sv.SourceName = ptr.String(jtv)
}
case "sourceVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected CustomLogSourceVersion to be of type string, got %T instead", value)
}
sv.SourceVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeAutoEnableNewAccountConfiguration(v **types.DataLakeAutoEnableNewAccountConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeAutoEnableNewAccountConfiguration
if *v == nil {
sv = &types.DataLakeAutoEnableNewAccountConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "sources":
if err := awsRestjson1_deserializeDocumentAwsLogSourceResourceList(&sv.Sources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeAutoEnableNewAccountConfigurationList(v *[]types.DataLakeAutoEnableNewAccountConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeAutoEnableNewAccountConfiguration
if *v == nil {
cv = []types.DataLakeAutoEnableNewAccountConfiguration{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeAutoEnableNewAccountConfiguration
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeAutoEnableNewAccountConfiguration(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeEncryptionConfiguration(v **types.DataLakeEncryptionConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeEncryptionConfiguration
if *v == nil {
sv = &types.DataLakeEncryptionConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "kmsKeyId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.KmsKeyId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeException(v **types.DataLakeException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeException
if *v == nil {
sv = &types.DataLakeException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exception":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.Exception = ptr.String(jtv)
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "remediation":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.Remediation = ptr.String(jtv)
}
case "timestamp":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.Timestamp = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeExceptionList(v *[]types.DataLakeException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeException
if *v == nil {
cv = []types.DataLakeException{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeException
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeException(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeLifecycleConfiguration(v **types.DataLakeLifecycleConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeLifecycleConfiguration
if *v == nil {
sv = &types.DataLakeLifecycleConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "expiration":
if err := awsRestjson1_deserializeDocumentDataLakeLifecycleExpiration(&sv.Expiration, value); err != nil {
return err
}
case "transitions":
if err := awsRestjson1_deserializeDocumentDataLakeLifecycleTransitionList(&sv.Transitions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeLifecycleExpiration(v **types.DataLakeLifecycleExpiration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeLifecycleExpiration
if *v == nil {
sv = &types.DataLakeLifecycleExpiration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "days":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Days = ptr.Int32(int32(i64))
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeLifecycleTransition(v **types.DataLakeLifecycleTransition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeLifecycleTransition
if *v == nil {
sv = &types.DataLakeLifecycleTransition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "days":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.Days = ptr.Int32(int32(i64))
}
case "storageClass":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataLakeStorageClass to be of type string, got %T instead", value)
}
sv.StorageClass = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeLifecycleTransitionList(v *[]types.DataLakeLifecycleTransition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeLifecycleTransition
if *v == nil {
cv = []types.DataLakeLifecycleTransition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeLifecycleTransition
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeLifecycleTransition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeReplicationConfiguration(v **types.DataLakeReplicationConfiguration, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeReplicationConfiguration
if *v == nil {
sv = &types.DataLakeReplicationConfiguration{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "regions":
if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil {
return err
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeResource(v **types.DataLakeResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeResource
if *v == nil {
sv = &types.DataLakeResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "createStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataLakeStatus to be of type string, got %T instead", value)
}
sv.CreateStatus = types.DataLakeStatus(jtv)
}
case "dataLakeArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.DataLakeArn = ptr.String(jtv)
}
case "encryptionConfiguration":
if err := awsRestjson1_deserializeDocumentDataLakeEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil {
return err
}
case "lifecycleConfiguration":
if err := awsRestjson1_deserializeDocumentDataLakeLifecycleConfiguration(&sv.LifecycleConfiguration, value); err != nil {
return err
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "replicationConfiguration":
if err := awsRestjson1_deserializeDocumentDataLakeReplicationConfiguration(&sv.ReplicationConfiguration, value); err != nil {
return err
}
case "s3BucketArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketArn to be of type string, got %T instead", value)
}
sv.S3BucketArn = ptr.String(jtv)
}
case "updateStatus":
if err := awsRestjson1_deserializeDocumentDataLakeUpdateStatus(&sv.UpdateStatus, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeResourceList(v *[]types.DataLakeResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeResource
if *v == nil {
cv = []types.DataLakeResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeResource
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeResource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeSource(v **types.DataLakeSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeSource
if *v == nil {
sv = &types.DataLakeSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "account":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Account = ptr.String(jtv)
}
case "eventClasses":
if err := awsRestjson1_deserializeDocumentOcsfEventClassList(&sv.EventClasses, value); err != nil {
return err
}
case "sourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.SourceName = ptr.String(jtv)
}
case "sourceStatuses":
if err := awsRestjson1_deserializeDocumentDataLakeSourceStatusList(&sv.SourceStatuses, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeSourceList(v *[]types.DataLakeSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeSource
if *v == nil {
cv = []types.DataLakeSource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeSource
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeSource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeSourceStatus(v **types.DataLakeSourceStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeSourceStatus
if *v == nil {
sv = &types.DataLakeSourceStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "resource":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Resource = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SourceCollectionStatus to be of type string, got %T instead", value)
}
sv.Status = types.SourceCollectionStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeSourceStatusList(v *[]types.DataLakeSourceStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.DataLakeSourceStatus
if *v == nil {
cv = []types.DataLakeSourceStatus{}
} else {
cv = *v
}
for _, value := range shape {
var col types.DataLakeSourceStatus
destAddr := &col
if err := awsRestjson1_deserializeDocumentDataLakeSourceStatus(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeUpdateException(v **types.DataLakeUpdateException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeUpdateException
if *v == nil {
sv = &types.DataLakeUpdateException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "code":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Code = ptr.String(jtv)
}
case "reason":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Reason = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentDataLakeUpdateStatus(v **types.DataLakeUpdateStatus, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.DataLakeUpdateStatus
if *v == nil {
sv = &types.DataLakeUpdateStatus{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "exception":
if err := awsRestjson1_deserializeDocumentDataLakeUpdateException(&sv.Exception, value); err != nil {
return err
}
case "requestId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.RequestId = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected DataLakeStatus to be of type string, got %T instead", value)
}
sv.Status = types.DataLakeStatus(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerException
if *v == nil {
sv = &types.InternalServerException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLogSource(v **types.LogSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.LogSource
if *v == nil {
sv = &types.LogSource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "account":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value)
}
sv.Account = ptr.String(jtv)
}
case "region":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
sv.Region = ptr.String(jtv)
}
case "sources":
if err := awsRestjson1_deserializeDocumentLogSourceResourceList(&sv.Sources, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentLogSourceList(v *[]types.LogSource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LogSource
if *v == nil {
cv = []types.LogSource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LogSource
destAddr := &col
if err := awsRestjson1_deserializeDocumentLogSource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentLogSourceResource(v *types.LogSourceResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var uv types.LogSourceResource
loop:
for key, value := range shape {
if value == nil {
continue
}
switch key {
case "awsLogSource":
var mv types.AwsLogSourceResource
destAddr := &mv
if err := awsRestjson1_deserializeDocumentAwsLogSourceResource(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.LogSourceResourceMemberAwsLogSource{Value: mv}
break loop
case "customLogSource":
var mv types.CustomLogSourceResource
destAddr := &mv
if err := awsRestjson1_deserializeDocumentCustomLogSourceResource(&destAddr, value); err != nil {
return err
}
mv = *destAddr
uv = &types.LogSourceResourceMemberCustomLogSource{Value: mv}
break loop
default:
uv = &types.UnknownUnionMember{Tag: key}
break loop
}
}
*v = uv
return nil
}
func awsRestjson1_deserializeDocumentLogSourceResourceList(v *[]types.LogSourceResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.LogSourceResource
if *v == nil {
cv = []types.LogSourceResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.LogSourceResource
if err := awsRestjson1_deserializeDocumentLogSourceResource(&col, value); err != nil {
return err
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentOcsfEventClassList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected OcsfEventClass to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentRegionList(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Region to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ResourceNotFoundException
if *v == nil {
sv = &types.ResourceNotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "resourceName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceName = ptr.String(jtv)
}
case "resourceType":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ResourceType = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSubscriberResource(v **types.SubscriberResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.SubscriberResource
if *v == nil {
sv = &types.SubscriberResource{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "accessTypes":
if err := awsRestjson1_deserializeDocumentAccessTypeList(&sv.AccessTypes, value); err != nil {
return err
}
case "createdAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.CreatedAt = ptr.Time(t)
}
case "resourceShareArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceShareArn to be of type string, got %T instead", value)
}
sv.ResourceShareArn = ptr.String(jtv)
}
case "resourceShareName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected ResourceShareName to be of type string, got %T instead", value)
}
sv.ResourceShareName = ptr.String(jtv)
}
case "roleArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value)
}
sv.RoleArn = ptr.String(jtv)
}
case "s3BucketArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected S3BucketArn to be of type string, got %T instead", value)
}
sv.S3BucketArn = ptr.String(jtv)
}
case "sources":
if err := awsRestjson1_deserializeDocumentLogSourceResourceList(&sv.Sources, value); err != nil {
return err
}
case "subscriberArn":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value)
}
sv.SubscriberArn = ptr.String(jtv)
}
case "subscriberDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.SubscriberDescription = ptr.String(jtv)
}
case "subscriberEndpoint":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.SubscriberEndpoint = ptr.String(jtv)
}
case "subscriberId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected UUID to be of type string, got %T instead", value)
}
sv.SubscriberId = ptr.String(jtv)
}
case "subscriberIdentity":
if err := awsRestjson1_deserializeDocumentAwsIdentity(&sv.SubscriberIdentity, value); err != nil {
return err
}
case "subscriberName":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SafeString to be of type string, got %T instead", value)
}
sv.SubscriberName = ptr.String(jtv)
}
case "subscriberStatus":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected SubscriberStatus to be of type string, got %T instead", value)
}
sv.SubscriberStatus = types.SubscriberStatus(jtv)
}
case "updatedAt":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value)
}
t, err := smithytime.ParseDateTime(jtv)
if err != nil {
return err
}
sv.UpdatedAt = ptr.Time(t)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentSubscriberResourceList(v *[]types.SubscriberResource, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.SubscriberResource
if *v == nil {
cv = []types.SubscriberResource{}
} else {
cv = *v
}
for _, value := range shape {
var col types.SubscriberResource
destAddr := &col
if err := awsRestjson1_deserializeDocumentSubscriberResource(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ThrottlingException
if *v == nil {
sv = &types.ThrottlingException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
case "quotaCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.QuotaCode = ptr.String(jtv)
}
case "retryAfterSeconds":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected Integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.RetryAfterSeconds = ptr.Int32(int32(i64))
}
case "serviceCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected String to be of type string, got %T instead", value)
}
sv.ServiceCode = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 6,134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package securitylake provides the API client, operations, and parameter types
// for Amazon Security Lake.
//
// Amazon Security Lake is a fully managed security data lake service. You can use
// Security Lake to automatically centralize security data from cloud, on-premises,
// and custom sources into a data lake that's stored in your Amazon Web Services
// account. Amazon Web Services Organizations is an account management service that
// lets you consolidate multiple Amazon Web Services accounts into an organization
// that you create and centrally manage. With Organizations, you can create member
// accounts and invite existing accounts to join your organization. Security Lake
// helps you analyze security data for a more complete understanding of your
// security posture across the entire organization. It can also help you improve
// the protection of your workloads, applications, and data. The data lake is
// backed by Amazon Simple Storage Service (Amazon S3) buckets, and you retain
// ownership over your data. Amazon Security Lake integrates with CloudTrail, a
// service that provides a record of actions taken by a user, role, or an Amazon
// Web Services service. In Security Lake, CloudTrail captures API calls for
// Security Lake as events. The calls captured include calls from the Security Lake
// console and code calls to the Security Lake API operations. If you create a
// trail, you can enable continuous delivery of CloudTrail events to an Amazon S3
// bucket, including events for Security Lake. If you don't configure a trail, you
// can still view the most recent events in the CloudTrail console in Event
// history. Using the information collected by CloudTrail you can determine the
// request that was made to Security Lake, the IP address from which the request
// was made, who made the request, when it was made, and additional details. To
// learn more about Security Lake information in CloudTrail, see the Amazon
// Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/securitylake-cloudtrail.html)
// . Security Lake automates the collection of security-related log and event data
// from integrated Amazon Web Services and third-party services. It also helps you
// manage the lifecycle of data with customizable retention and replication
// settings. Security Lake converts ingested data into Apache Parquet format and a
// standard open-source schema called the Open Cybersecurity Schema Framework
// (OCSF). Other Amazon Web Services and third-party services can subscribe to the
// data that's stored in Security Lake for incident response and security data
// analytics.
package securitylake
| 39 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/securitylake/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "securitylake"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
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 {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package securitylake
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.4.3"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateAwsLogSource struct {
}
func (*awsRestjson1_serializeOpCreateAwsLogSource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateAwsLogSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateAwsLogSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/logsources/aws")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateAwsLogSourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateAwsLogSourceInput(v *CreateAwsLogSourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateAwsLogSourceInput(v *CreateAwsLogSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentAwsLogSourceConfigurationList(v.Sources, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateCustomLogSource struct {
}
func (*awsRestjson1_serializeOpCreateCustomLogSource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateCustomLogSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCustomLogSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/logsources/custom")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateCustomLogSourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateCustomLogSourceInput(v *CreateCustomLogSourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateCustomLogSourceInput(v *CreateCustomLogSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configuration != nil {
ok := object.Key("configuration")
if err := awsRestjson1_serializeDocumentCustomLogSourceConfiguration(v.Configuration, ok); err != nil {
return err
}
}
if v.EventClasses != nil {
ok := object.Key("eventClasses")
if err := awsRestjson1_serializeDocumentOcsfEventClassList(v.EventClasses, ok); err != nil {
return err
}
}
if v.SourceName != nil {
ok := object.Key("sourceName")
ok.String(*v.SourceName)
}
if v.SourceVersion != nil {
ok := object.Key("sourceVersion")
ok.String(*v.SourceVersion)
}
return nil
}
type awsRestjson1_serializeOpCreateDataLake struct {
}
func (*awsRestjson1_serializeOpCreateDataLake) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataLake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDataLakeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateDataLakeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateDataLakeInput(v *CreateDataLakeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDataLakeInput(v *CreateDataLakeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configurations != nil {
ok := object.Key("configurations")
if err := awsRestjson1_serializeDocumentDataLakeConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
if v.MetaStoreManagerRoleArn != nil {
ok := object.Key("metaStoreManagerRoleArn")
ok.String(*v.MetaStoreManagerRoleArn)
}
return nil
}
type awsRestjson1_serializeOpCreateDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_serializeOpCreateDataLakeExceptionSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataLakeExceptionSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDataLakeExceptionSubscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/exceptions/subscription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateDataLakeExceptionSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateDataLakeExceptionSubscriptionInput(v *CreateDataLakeExceptionSubscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDataLakeExceptionSubscriptionInput(v *CreateDataLakeExceptionSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExceptionTimeToLive != nil {
ok := object.Key("exceptionTimeToLive")
ok.Long(*v.ExceptionTimeToLive)
}
if v.NotificationEndpoint != nil {
ok := object.Key("notificationEndpoint")
ok.String(*v.NotificationEndpoint)
}
if v.SubscriptionProtocol != nil {
ok := object.Key("subscriptionProtocol")
ok.String(*v.SubscriptionProtocol)
}
return nil
}
type awsRestjson1_serializeOpCreateDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_serializeOpCreateDataLakeOrganizationConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateDataLakeOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateDataLakeOrganizationConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/organization/configuration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateDataLakeOrganizationConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateDataLakeOrganizationConfigurationInput(v *CreateDataLakeOrganizationConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateDataLakeOrganizationConfigurationInput(v *CreateDataLakeOrganizationConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoEnableNewAccount != nil {
ok := object.Key("autoEnableNewAccount")
if err := awsRestjson1_serializeDocumentDataLakeAutoEnableNewAccountConfigurationList(v.AutoEnableNewAccount, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpCreateSubscriber struct {
}
func (*awsRestjson1_serializeOpCreateSubscriber) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSubscriber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSubscriberInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateSubscriberInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateSubscriberInput(v *CreateSubscriberInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSubscriberInput(v *CreateSubscriberInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccessTypes != nil {
ok := object.Key("accessTypes")
if err := awsRestjson1_serializeDocumentAccessTypeList(v.AccessTypes, ok); err != nil {
return err
}
}
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentLogSourceResourceList(v.Sources, ok); err != nil {
return err
}
}
if v.SubscriberDescription != nil {
ok := object.Key("subscriberDescription")
ok.String(*v.SubscriberDescription)
}
if v.SubscriberIdentity != nil {
ok := object.Key("subscriberIdentity")
if err := awsRestjson1_serializeDocumentAwsIdentity(v.SubscriberIdentity, ok); err != nil {
return err
}
}
if v.SubscriberName != nil {
ok := object.Key("subscriberName")
ok.String(*v.SubscriberName)
}
return nil
}
type awsRestjson1_serializeOpCreateSubscriberNotification struct {
}
func (*awsRestjson1_serializeOpCreateSubscriberNotification) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateSubscriberNotification) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateSubscriberNotificationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}/notification")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateSubscriberNotificationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateSubscriberNotificationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateSubscriberNotificationInput(v *CreateSubscriberNotificationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateSubscriberNotificationInput(v *CreateSubscriberNotificationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configuration != nil {
ok := object.Key("configuration")
if err := awsRestjson1_serializeDocumentNotificationConfiguration(v.Configuration, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteAwsLogSource struct {
}
func (*awsRestjson1_serializeOpDeleteAwsLogSource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteAwsLogSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteAwsLogSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/logsources/aws/delete")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteAwsLogSourceInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteAwsLogSourceInput(v *DeleteAwsLogSourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteAwsLogSourceInput(v *DeleteAwsLogSourceInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentAwsLogSourceConfigurationList(v.Sources, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteCustomLogSource struct {
}
func (*awsRestjson1_serializeOpDeleteCustomLogSource) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteCustomLogSource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteCustomLogSourceInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/logsources/custom/{sourceName}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteCustomLogSourceInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteCustomLogSourceInput(v *DeleteCustomLogSourceInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SourceName == nil || len(*v.SourceName) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member sourceName must not be empty")}
}
if v.SourceName != nil {
if err := encoder.SetURI("sourceName").String(*v.SourceName); err != nil {
return err
}
}
if v.SourceVersion != nil {
encoder.SetQuery("sourceVersion").String(*v.SourceVersion)
}
return nil
}
type awsRestjson1_serializeOpDeleteDataLake struct {
}
func (*awsRestjson1_serializeOpDeleteDataLake) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDataLake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDataLakeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/delete")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteDataLakeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteDataLakeInput(v *DeleteDataLakeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteDataLakeInput(v *DeleteDataLakeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Regions != nil {
ok := object.Key("regions")
if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_serializeOpDeleteDataLakeExceptionSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDataLakeExceptionSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDataLakeExceptionSubscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/exceptions/subscription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteDataLakeExceptionSubscriptionInput(v *DeleteDataLakeExceptionSubscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpDeleteDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_serializeOpDeleteDataLakeOrganizationConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteDataLakeOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteDataLakeOrganizationConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/organization/configuration/delete")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentDeleteDataLakeOrganizationConfigurationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteDataLakeOrganizationConfigurationInput(v *DeleteDataLakeOrganizationConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentDeleteDataLakeOrganizationConfigurationInput(v *DeleteDataLakeOrganizationConfigurationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AutoEnableNewAccount != nil {
ok := object.Key("autoEnableNewAccount")
if err := awsRestjson1_serializeDocumentDataLakeAutoEnableNewAccountConfigurationList(v.AutoEnableNewAccount, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSubscriber struct {
}
func (*awsRestjson1_serializeOpDeleteSubscriber) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSubscriber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSubscriberInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteSubscriberInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteSubscriberInput(v *DeleteSubscriberInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeleteSubscriberNotification struct {
}
func (*awsRestjson1_serializeOpDeleteSubscriberNotification) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteSubscriberNotification) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteSubscriberNotificationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}/notification")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteSubscriberNotificationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteSubscriberNotificationInput(v *DeleteSubscriberNotificationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpDeregisterDataLakeDelegatedAdministrator struct {
}
func (*awsRestjson1_serializeOpDeregisterDataLakeDelegatedAdministrator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeregisterDataLakeDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeregisterDataLakeDelegatedAdministratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/delegate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeregisterDataLakeDelegatedAdministratorInput(v *DeregisterDataLakeDelegatedAdministratorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_serializeOpGetDataLakeExceptionSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDataLakeExceptionSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDataLakeExceptionSubscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/exceptions/subscription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetDataLakeExceptionSubscriptionInput(v *GetDataLakeExceptionSubscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetDataLakeOrganizationConfiguration struct {
}
func (*awsRestjson1_serializeOpGetDataLakeOrganizationConfiguration) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDataLakeOrganizationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDataLakeOrganizationConfigurationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/organization/configuration")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetDataLakeOrganizationConfigurationInput(v *GetDataLakeOrganizationConfigurationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
type awsRestjson1_serializeOpGetDataLakeSources struct {
}
func (*awsRestjson1_serializeOpGetDataLakeSources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetDataLakeSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetDataLakeSourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/sources")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentGetDataLakeSourcesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetDataLakeSourcesInput(v *GetDataLakeSourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentGetDataLakeSourcesInput(v *GetDataLakeSourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Accounts != nil {
ok := object.Key("accounts")
if err := awsRestjson1_serializeDocumentAccountList(v.Accounts, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpGetSubscriber struct {
}
func (*awsRestjson1_serializeOpGetSubscriber) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetSubscriber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetSubscriberInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetSubscriberInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetSubscriberInput(v *GetSubscriberInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListDataLakeExceptions struct {
}
func (*awsRestjson1_serializeOpListDataLakeExceptions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDataLakeExceptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDataLakeExceptionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/exceptions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListDataLakeExceptionsInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListDataLakeExceptionsInput(v *ListDataLakeExceptionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListDataLakeExceptionsInput(v *ListDataLakeExceptionsInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.Regions != nil {
ok := object.Key("regions")
if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListDataLakes struct {
}
func (*awsRestjson1_serializeOpListDataLakes) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListDataLakes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListDataLakesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalakes")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListDataLakesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListDataLakesInput(v *ListDataLakesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.Regions != nil {
for i := range v.Regions {
encoder.AddQuery("regions").String(v.Regions[i])
}
}
return nil
}
type awsRestjson1_serializeOpListLogSources struct {
}
func (*awsRestjson1_serializeOpListLogSources) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListLogSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListLogSourcesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/logsources/list")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentListLogSourcesInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListLogSourcesInput(v *ListLogSourcesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentListLogSourcesInput(v *ListLogSourcesInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Accounts != nil {
ok := object.Key("accounts")
if err := awsRestjson1_serializeDocumentAccountList(v.Accounts, ok); err != nil {
return err
}
}
if v.MaxResults != nil {
ok := object.Key("maxResults")
ok.Integer(*v.MaxResults)
}
if v.NextToken != nil {
ok := object.Key("nextToken")
ok.String(*v.NextToken)
}
if v.Regions != nil {
ok := object.Key("regions")
if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil {
return err
}
}
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentLogSourceResourceList(v.Sources, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListSubscribers struct {
}
func (*awsRestjson1_serializeOpListSubscribers) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListSubscribers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListSubscribersInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListSubscribersInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListSubscribersInput(v *ListSubscribersInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxResults != nil {
encoder.SetQuery("maxResults").Integer(*v.MaxResults)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpRegisterDataLakeDelegatedAdministrator struct {
}
func (*awsRestjson1_serializeOpRegisterDataLakeDelegatedAdministrator) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpRegisterDataLakeDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*RegisterDataLakeDelegatedAdministratorInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/delegate")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentRegisterDataLakeDelegatedAdministratorInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsRegisterDataLakeDelegatedAdministratorInput(v *RegisterDataLakeDelegatedAdministratorInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentRegisterDataLakeDelegatedAdministratorInput(v *RegisterDataLakeDelegatedAdministratorInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AccountId != nil {
ok := object.Key("accountId")
ok.String(*v.AccountId)
}
return nil
}
type awsRestjson1_serializeOpUpdateDataLake struct {
}
func (*awsRestjson1_serializeOpUpdateDataLake) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDataLake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDataLakeInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDataLakeInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateDataLakeInput(v *UpdateDataLakeInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDataLakeInput(v *UpdateDataLakeInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configurations != nil {
ok := object.Key("configurations")
if err := awsRestjson1_serializeDocumentDataLakeConfigurationList(v.Configurations, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUpdateDataLakeExceptionSubscription struct {
}
func (*awsRestjson1_serializeOpUpdateDataLakeExceptionSubscription) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateDataLakeExceptionSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateDataLakeExceptionSubscriptionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/datalake/exceptions/subscription")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateDataLakeExceptionSubscriptionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateDataLakeExceptionSubscriptionInput(v *UpdateDataLakeExceptionSubscriptionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateDataLakeExceptionSubscriptionInput(v *UpdateDataLakeExceptionSubscriptionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExceptionTimeToLive != nil {
ok := object.Key("exceptionTimeToLive")
ok.Long(*v.ExceptionTimeToLive)
}
if v.NotificationEndpoint != nil {
ok := object.Key("notificationEndpoint")
ok.String(*v.NotificationEndpoint)
}
if v.SubscriptionProtocol != nil {
ok := object.Key("subscriptionProtocol")
ok.String(*v.SubscriptionProtocol)
}
return nil
}
type awsRestjson1_serializeOpUpdateSubscriber struct {
}
func (*awsRestjson1_serializeOpUpdateSubscriber) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateSubscriber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSubscriberInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateSubscriberInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateSubscriberInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateSubscriberInput(v *UpdateSubscriberInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateSubscriberInput(v *UpdateSubscriberInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentLogSourceResourceList(v.Sources, ok); err != nil {
return err
}
}
if v.SubscriberDescription != nil {
ok := object.Key("subscriberDescription")
ok.String(*v.SubscriberDescription)
}
if v.SubscriberIdentity != nil {
ok := object.Key("subscriberIdentity")
if err := awsRestjson1_serializeDocumentAwsIdentity(v.SubscriberIdentity, ok); err != nil {
return err
}
}
if v.SubscriberName != nil {
ok := object.Key("subscriberName")
ok.String(*v.SubscriberName)
}
return nil
}
type awsRestjson1_serializeOpUpdateSubscriberNotification struct {
}
func (*awsRestjson1_serializeOpUpdateSubscriberNotification) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateSubscriberNotification) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateSubscriberNotificationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/v1/subscribers/{subscriberId}/notification")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateSubscriberNotificationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateSubscriberNotificationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateSubscriberNotificationInput(v *UpdateSubscriberNotificationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.SubscriberId == nil || len(*v.SubscriberId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member subscriberId must not be empty")}
}
if v.SubscriberId != nil {
if err := encoder.SetURI("subscriberId").String(*v.SubscriberId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateSubscriberNotificationInput(v *UpdateSubscriberNotificationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Configuration != nil {
ok := object.Key("configuration")
if err := awsRestjson1_serializeDocumentNotificationConfiguration(v.Configuration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAccessTypeList(v []types.AccessType, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(string(v[i]))
}
return nil
}
func awsRestjson1_serializeDocumentAccountList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentAwsIdentity(v *types.AwsIdentity, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.ExternalId != nil {
ok := object.Key("externalId")
ok.String(*v.ExternalId)
}
if v.Principal != nil {
ok := object.Key("principal")
ok.String(*v.Principal)
}
return nil
}
func awsRestjson1_serializeDocumentAwsLogSourceConfiguration(v *types.AwsLogSourceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Accounts != nil {
ok := object.Key("accounts")
if err := awsRestjson1_serializeDocumentAccountList(v.Accounts, ok); err != nil {
return err
}
}
if v.Regions != nil {
ok := object.Key("regions")
if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil {
return err
}
}
if len(v.SourceName) > 0 {
ok := object.Key("sourceName")
ok.String(string(v.SourceName))
}
if v.SourceVersion != nil {
ok := object.Key("sourceVersion")
ok.String(*v.SourceVersion)
}
return nil
}
func awsRestjson1_serializeDocumentAwsLogSourceConfigurationList(v []types.AwsLogSourceConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAwsLogSourceConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentAwsLogSourceResource(v *types.AwsLogSourceResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if len(v.SourceName) > 0 {
ok := object.Key("sourceName")
ok.String(string(v.SourceName))
}
if v.SourceVersion != nil {
ok := object.Key("sourceVersion")
ok.String(*v.SourceVersion)
}
return nil
}
func awsRestjson1_serializeDocumentAwsLogSourceResourceList(v []types.AwsLogSourceResource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentAwsLogSourceResource(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCustomLogSourceAttributes(v *types.CustomLogSourceAttributes, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CrawlerArn != nil {
ok := object.Key("crawlerArn")
ok.String(*v.CrawlerArn)
}
if v.DatabaseArn != nil {
ok := object.Key("databaseArn")
ok.String(*v.DatabaseArn)
}
if v.TableArn != nil {
ok := object.Key("tableArn")
ok.String(*v.TableArn)
}
return nil
}
func awsRestjson1_serializeDocumentCustomLogSourceConfiguration(v *types.CustomLogSourceConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.CrawlerConfiguration != nil {
ok := object.Key("crawlerConfiguration")
if err := awsRestjson1_serializeDocumentCustomLogSourceCrawlerConfiguration(v.CrawlerConfiguration, ok); err != nil {
return err
}
}
if v.ProviderIdentity != nil {
ok := object.Key("providerIdentity")
if err := awsRestjson1_serializeDocumentAwsIdentity(v.ProviderIdentity, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentCustomLogSourceCrawlerConfiguration(v *types.CustomLogSourceCrawlerConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentCustomLogSourceProvider(v *types.CustomLogSourceProvider, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Location != nil {
ok := object.Key("location")
ok.String(*v.Location)
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentCustomLogSourceResource(v *types.CustomLogSourceResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Attributes != nil {
ok := object.Key("attributes")
if err := awsRestjson1_serializeDocumentCustomLogSourceAttributes(v.Attributes, ok); err != nil {
return err
}
}
if v.Provider != nil {
ok := object.Key("provider")
if err := awsRestjson1_serializeDocumentCustomLogSourceProvider(v.Provider, ok); err != nil {
return err
}
}
if v.SourceName != nil {
ok := object.Key("sourceName")
ok.String(*v.SourceName)
}
if v.SourceVersion != nil {
ok := object.Key("sourceVersion")
ok.String(*v.SourceVersion)
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeAutoEnableNewAccountConfiguration(v *types.DataLakeAutoEnableNewAccountConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Region != nil {
ok := object.Key("region")
ok.String(*v.Region)
}
if v.Sources != nil {
ok := object.Key("sources")
if err := awsRestjson1_serializeDocumentAwsLogSourceResourceList(v.Sources, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeAutoEnableNewAccountConfigurationList(v []types.DataLakeAutoEnableNewAccountConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDataLakeAutoEnableNewAccountConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeConfiguration(v *types.DataLakeConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.EncryptionConfiguration != nil {
ok := object.Key("encryptionConfiguration")
if err := awsRestjson1_serializeDocumentDataLakeEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil {
return err
}
}
if v.LifecycleConfiguration != nil {
ok := object.Key("lifecycleConfiguration")
if err := awsRestjson1_serializeDocumentDataLakeLifecycleConfiguration(v.LifecycleConfiguration, ok); err != nil {
return err
}
}
if v.Region != nil {
ok := object.Key("region")
ok.String(*v.Region)
}
if v.ReplicationConfiguration != nil {
ok := object.Key("replicationConfiguration")
if err := awsRestjson1_serializeDocumentDataLakeReplicationConfiguration(v.ReplicationConfiguration, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeConfigurationList(v []types.DataLakeConfiguration, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDataLakeConfiguration(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeEncryptionConfiguration(v *types.DataLakeEncryptionConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.KmsKeyId != nil {
ok := object.Key("kmsKeyId")
ok.String(*v.KmsKeyId)
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeLifecycleConfiguration(v *types.DataLakeLifecycleConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Expiration != nil {
ok := object.Key("expiration")
if err := awsRestjson1_serializeDocumentDataLakeLifecycleExpiration(v.Expiration, ok); err != nil {
return err
}
}
if v.Transitions != nil {
ok := object.Key("transitions")
if err := awsRestjson1_serializeDocumentDataLakeLifecycleTransitionList(v.Transitions, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeLifecycleExpiration(v *types.DataLakeLifecycleExpiration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Days != nil {
ok := object.Key("days")
ok.Integer(*v.Days)
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeLifecycleTransition(v *types.DataLakeLifecycleTransition, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Days != nil {
ok := object.Key("days")
ok.Integer(*v.Days)
}
if v.StorageClass != nil {
ok := object.Key("storageClass")
ok.String(*v.StorageClass)
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeLifecycleTransitionList(v []types.DataLakeLifecycleTransition, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentDataLakeLifecycleTransition(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentDataLakeReplicationConfiguration(v *types.DataLakeReplicationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Regions != nil {
ok := object.Key("regions")
if err := awsRestjson1_serializeDocumentRegionList(v.Regions, ok); err != nil {
return err
}
}
if v.RoleArn != nil {
ok := object.Key("roleArn")
ok.String(*v.RoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentHttpsNotificationConfiguration(v *types.HttpsNotificationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.AuthorizationApiKeyName != nil {
ok := object.Key("authorizationApiKeyName")
ok.String(*v.AuthorizationApiKeyName)
}
if v.AuthorizationApiKeyValue != nil {
ok := object.Key("authorizationApiKeyValue")
ok.String(*v.AuthorizationApiKeyValue)
}
if v.Endpoint != nil {
ok := object.Key("endpoint")
ok.String(*v.Endpoint)
}
if len(v.HttpMethod) > 0 {
ok := object.Key("httpMethod")
ok.String(string(v.HttpMethod))
}
if v.TargetRoleArn != nil {
ok := object.Key("targetRoleArn")
ok.String(*v.TargetRoleArn)
}
return nil
}
func awsRestjson1_serializeDocumentLogSourceResource(v types.LogSourceResource, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.LogSourceResourceMemberAwsLogSource:
av := object.Key("awsLogSource")
if err := awsRestjson1_serializeDocumentAwsLogSourceResource(&uv.Value, av); err != nil {
return err
}
case *types.LogSourceResourceMemberCustomLogSource:
av := object.Key("customLogSource")
if err := awsRestjson1_serializeDocumentCustomLogSourceResource(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentLogSourceResourceList(v []types.LogSourceResource, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if vv := v[i]; vv == nil {
continue
}
if err := awsRestjson1_serializeDocumentLogSourceResource(v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentNotificationConfiguration(v types.NotificationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
switch uv := v.(type) {
case *types.NotificationConfigurationMemberHttpsNotificationConfiguration:
av := object.Key("httpsNotificationConfiguration")
if err := awsRestjson1_serializeDocumentHttpsNotificationConfiguration(&uv.Value, av); err != nil {
return err
}
case *types.NotificationConfigurationMemberSqsNotificationConfiguration:
av := object.Key("sqsNotificationConfiguration")
if err := awsRestjson1_serializeDocumentSqsNotificationConfiguration(&uv.Value, av); err != nil {
return err
}
default:
return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v)
}
return nil
}
func awsRestjson1_serializeDocumentOcsfEventClassList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentRegionList(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocumentSqsNotificationConfiguration(v *types.SqsNotificationConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
return nil
}
| 2,477 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package securitylake
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateAwsLogSource struct {
}
func (*validateOpCreateAwsLogSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateAwsLogSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateAwsLogSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateAwsLogSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCustomLogSource struct {
}
func (*validateOpCreateCustomLogSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCustomLogSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCustomLogSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCustomLogSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataLakeExceptionSubscription struct {
}
func (*validateOpCreateDataLakeExceptionSubscription) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataLakeExceptionSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDataLakeExceptionSubscriptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDataLakeExceptionSubscriptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataLake struct {
}
func (*validateOpCreateDataLake) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataLake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDataLakeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDataLakeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateDataLakeOrganizationConfiguration struct {
}
func (*validateOpCreateDataLakeOrganizationConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateDataLakeOrganizationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateDataLakeOrganizationConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateDataLakeOrganizationConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSubscriber struct {
}
func (*validateOpCreateSubscriber) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSubscriber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSubscriberInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSubscriberInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateSubscriberNotification struct {
}
func (*validateOpCreateSubscriberNotification) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateSubscriberNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateSubscriberNotificationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateSubscriberNotificationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteAwsLogSource struct {
}
func (*validateOpDeleteAwsLogSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteAwsLogSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteAwsLogSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteAwsLogSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteCustomLogSource struct {
}
func (*validateOpDeleteCustomLogSource) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteCustomLogSource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteCustomLogSourceInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteCustomLogSourceInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDataLake struct {
}
func (*validateOpDeleteDataLake) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDataLake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDataLakeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDataLakeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteDataLakeOrganizationConfiguration struct {
}
func (*validateOpDeleteDataLakeOrganizationConfiguration) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteDataLakeOrganizationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteDataLakeOrganizationConfigurationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteDataLakeOrganizationConfigurationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSubscriber struct {
}
func (*validateOpDeleteSubscriber) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSubscriber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSubscriberInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSubscriberInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteSubscriberNotification struct {
}
func (*validateOpDeleteSubscriberNotification) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteSubscriberNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteSubscriberNotificationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteSubscriberNotificationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetSubscriber struct {
}
func (*validateOpGetSubscriber) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetSubscriber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetSubscriberInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetSubscriberInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpRegisterDataLakeDelegatedAdministrator struct {
}
func (*validateOpRegisterDataLakeDelegatedAdministrator) ID() string {
return "OperationInputValidation"
}
func (m *validateOpRegisterDataLakeDelegatedAdministrator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*RegisterDataLakeDelegatedAdministratorInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpRegisterDataLakeDelegatedAdministratorInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDataLakeExceptionSubscription struct {
}
func (*validateOpUpdateDataLakeExceptionSubscription) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDataLakeExceptionSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDataLakeExceptionSubscriptionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDataLakeExceptionSubscriptionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateDataLake struct {
}
func (*validateOpUpdateDataLake) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateDataLake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateDataLakeInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateDataLakeInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSubscriber struct {
}
func (*validateOpUpdateSubscriber) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSubscriber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSubscriberInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSubscriberInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateSubscriberNotification struct {
}
func (*validateOpUpdateSubscriberNotification) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateSubscriberNotification) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateSubscriberNotificationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateSubscriberNotificationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateAwsLogSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateAwsLogSource{}, middleware.After)
}
func addOpCreateCustomLogSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCustomLogSource{}, middleware.After)
}
func addOpCreateDataLakeExceptionSubscriptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataLakeExceptionSubscription{}, middleware.After)
}
func addOpCreateDataLakeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataLake{}, middleware.After)
}
func addOpCreateDataLakeOrganizationConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateDataLakeOrganizationConfiguration{}, middleware.After)
}
func addOpCreateSubscriberValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSubscriber{}, middleware.After)
}
func addOpCreateSubscriberNotificationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateSubscriberNotification{}, middleware.After)
}
func addOpDeleteAwsLogSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteAwsLogSource{}, middleware.After)
}
func addOpDeleteCustomLogSourceValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteCustomLogSource{}, middleware.After)
}
func addOpDeleteDataLakeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDataLake{}, middleware.After)
}
func addOpDeleteDataLakeOrganizationConfigurationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteDataLakeOrganizationConfiguration{}, middleware.After)
}
func addOpDeleteSubscriberValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSubscriber{}, middleware.After)
}
func addOpDeleteSubscriberNotificationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteSubscriberNotification{}, middleware.After)
}
func addOpGetSubscriberValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetSubscriber{}, middleware.After)
}
func addOpRegisterDataLakeDelegatedAdministratorValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpRegisterDataLakeDelegatedAdministrator{}, middleware.After)
}
func addOpUpdateDataLakeExceptionSubscriptionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDataLakeExceptionSubscription{}, middleware.After)
}
func addOpUpdateDataLakeValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateDataLake{}, middleware.After)
}
func addOpUpdateSubscriberValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSubscriber{}, middleware.After)
}
func addOpUpdateSubscriberNotificationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateSubscriberNotification{}, middleware.After)
}
func validateAwsIdentity(v *types.AwsIdentity) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AwsIdentity"}
if v.Principal == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principal"))
}
if v.ExternalId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ExternalId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAwsLogSourceConfiguration(v *types.AwsLogSourceConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AwsLogSourceConfiguration"}
if v.Regions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Regions"))
}
if len(v.SourceName) == 0 {
invalidParams.Add(smithy.NewErrParamRequired("SourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateAwsLogSourceConfigurationList(v []types.AwsLogSourceConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "AwsLogSourceConfigurationList"}
for i := range v {
if err := validateAwsLogSourceConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomLogSourceConfiguration(v *types.CustomLogSourceConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomLogSourceConfiguration"}
if v.CrawlerConfiguration == nil {
invalidParams.Add(smithy.NewErrParamRequired("CrawlerConfiguration"))
} else if v.CrawlerConfiguration != nil {
if err := validateCustomLogSourceCrawlerConfiguration(v.CrawlerConfiguration); err != nil {
invalidParams.AddNested("CrawlerConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.ProviderIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("ProviderIdentity"))
} else if v.ProviderIdentity != nil {
if err := validateAwsIdentity(v.ProviderIdentity); err != nil {
invalidParams.AddNested("ProviderIdentity", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateCustomLogSourceCrawlerConfiguration(v *types.CustomLogSourceCrawlerConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CustomLogSourceCrawlerConfiguration"}
if v.RoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("RoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDataLakeAutoEnableNewAccountConfiguration(v *types.DataLakeAutoEnableNewAccountConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataLakeAutoEnableNewAccountConfiguration"}
if v.Region == nil {
invalidParams.Add(smithy.NewErrParamRequired("Region"))
}
if v.Sources == nil {
invalidParams.Add(smithy.NewErrParamRequired("Sources"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDataLakeAutoEnableNewAccountConfigurationList(v []types.DataLakeAutoEnableNewAccountConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataLakeAutoEnableNewAccountConfigurationList"}
for i := range v {
if err := validateDataLakeAutoEnableNewAccountConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDataLakeConfiguration(v *types.DataLakeConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataLakeConfiguration"}
if v.Region == nil {
invalidParams.Add(smithy.NewErrParamRequired("Region"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateDataLakeConfigurationList(v []types.DataLakeConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DataLakeConfigurationList"}
for i := range v {
if err := validateDataLakeConfiguration(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateHttpsNotificationConfiguration(v *types.HttpsNotificationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "HttpsNotificationConfiguration"}
if v.Endpoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("Endpoint"))
}
if v.TargetRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("TargetRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateNotificationConfiguration(v types.NotificationConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "NotificationConfiguration"}
switch uv := v.(type) {
case *types.NotificationConfigurationMemberHttpsNotificationConfiguration:
if err := validateHttpsNotificationConfiguration(&uv.Value); err != nil {
invalidParams.AddNested("[httpsNotificationConfiguration]", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateAwsLogSourceInput(v *CreateAwsLogSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateAwsLogSourceInput"}
if v.Sources == nil {
invalidParams.Add(smithy.NewErrParamRequired("Sources"))
} else if v.Sources != nil {
if err := validateAwsLogSourceConfigurationList(v.Sources); err != nil {
invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCustomLogSourceInput(v *CreateCustomLogSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCustomLogSourceInput"}
if v.SourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceName"))
}
if v.Configuration != nil {
if err := validateCustomLogSourceConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDataLakeExceptionSubscriptionInput(v *CreateDataLakeExceptionSubscriptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDataLakeExceptionSubscriptionInput"}
if v.SubscriptionProtocol == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriptionProtocol"))
}
if v.NotificationEndpoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("NotificationEndpoint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDataLakeInput(v *CreateDataLakeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDataLakeInput"}
if v.Configurations == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configurations"))
} else if v.Configurations != nil {
if err := validateDataLakeConfigurationList(v.Configurations); err != nil {
invalidParams.AddNested("Configurations", err.(smithy.InvalidParamsError))
}
}
if v.MetaStoreManagerRoleArn == nil {
invalidParams.Add(smithy.NewErrParamRequired("MetaStoreManagerRoleArn"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateDataLakeOrganizationConfigurationInput(v *CreateDataLakeOrganizationConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateDataLakeOrganizationConfigurationInput"}
if v.AutoEnableNewAccount == nil {
invalidParams.Add(smithy.NewErrParamRequired("AutoEnableNewAccount"))
} else if v.AutoEnableNewAccount != nil {
if err := validateDataLakeAutoEnableNewAccountConfigurationList(v.AutoEnableNewAccount); err != nil {
invalidParams.AddNested("AutoEnableNewAccount", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSubscriberInput(v *CreateSubscriberInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSubscriberInput"}
if v.SubscriberIdentity == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberIdentity"))
} else if v.SubscriberIdentity != nil {
if err := validateAwsIdentity(v.SubscriberIdentity); err != nil {
invalidParams.AddNested("SubscriberIdentity", err.(smithy.InvalidParamsError))
}
}
if v.SubscriberName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberName"))
}
if v.Sources == nil {
invalidParams.Add(smithy.NewErrParamRequired("Sources"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateSubscriberNotificationInput(v *CreateSubscriberNotificationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateSubscriberNotificationInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if v.Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configuration"))
} else if v.Configuration != nil {
if err := validateNotificationConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteAwsLogSourceInput(v *DeleteAwsLogSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteAwsLogSourceInput"}
if v.Sources == nil {
invalidParams.Add(smithy.NewErrParamRequired("Sources"))
} else if v.Sources != nil {
if err := validateAwsLogSourceConfigurationList(v.Sources); err != nil {
invalidParams.AddNested("Sources", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteCustomLogSourceInput(v *DeleteCustomLogSourceInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteCustomLogSourceInput"}
if v.SourceName == nil {
invalidParams.Add(smithy.NewErrParamRequired("SourceName"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDataLakeInput(v *DeleteDataLakeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDataLakeInput"}
if v.Regions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Regions"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteDataLakeOrganizationConfigurationInput(v *DeleteDataLakeOrganizationConfigurationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteDataLakeOrganizationConfigurationInput"}
if v.AutoEnableNewAccount == nil {
invalidParams.Add(smithy.NewErrParamRequired("AutoEnableNewAccount"))
} else if v.AutoEnableNewAccount != nil {
if err := validateDataLakeAutoEnableNewAccountConfigurationList(v.AutoEnableNewAccount); err != nil {
invalidParams.AddNested("AutoEnableNewAccount", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSubscriberInput(v *DeleteSubscriberInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSubscriberInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteSubscriberNotificationInput(v *DeleteSubscriberNotificationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteSubscriberNotificationInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetSubscriberInput(v *GetSubscriberInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetSubscriberInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpRegisterDataLakeDelegatedAdministratorInput(v *RegisterDataLakeDelegatedAdministratorInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RegisterDataLakeDelegatedAdministratorInput"}
if v.AccountId == nil {
invalidParams.Add(smithy.NewErrParamRequired("AccountId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDataLakeExceptionSubscriptionInput(v *UpdateDataLakeExceptionSubscriptionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDataLakeExceptionSubscriptionInput"}
if v.SubscriptionProtocol == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriptionProtocol"))
}
if v.NotificationEndpoint == nil {
invalidParams.Add(smithy.NewErrParamRequired("NotificationEndpoint"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateDataLakeInput(v *UpdateDataLakeInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateDataLakeInput"}
if v.Configurations == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configurations"))
} else if v.Configurations != nil {
if err := validateDataLakeConfigurationList(v.Configurations); err != nil {
invalidParams.AddNested("Configurations", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSubscriberInput(v *UpdateSubscriberInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSubscriberInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if v.SubscriberIdentity != nil {
if err := validateAwsIdentity(v.SubscriberIdentity); err != nil {
invalidParams.AddNested("SubscriberIdentity", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateSubscriberNotificationInput(v *UpdateSubscriberNotificationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateSubscriberNotificationInput"}
if v.SubscriberId == nil {
invalidParams.Add(smithy.NewErrParamRequired("SubscriberId"))
}
if v.Configuration == nil {
invalidParams.Add(smithy.NewErrParamRequired("Configuration"))
} else if v.Configuration != nil {
if err := validateNotificationConfiguration(v.Configuration); err != nil {
invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 1,018 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver SecurityLake endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securitylake.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securitylake-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securitylake.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securitylake-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "securitylake.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "securitylake-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "securitylake-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "securitylake.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
},
}
| 338 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type AccessType string
// Enum values for AccessType
const (
AccessTypeLakeformation AccessType = "LAKEFORMATION"
AccessTypeS3 AccessType = "S3"
)
// Values returns all known values for AccessType. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (AccessType) Values() []AccessType {
return []AccessType{
"LAKEFORMATION",
"S3",
}
}
type AwsLogSourceName string
// Enum values for AwsLogSourceName
const (
AwsLogSourceNameRoute53 AwsLogSourceName = "ROUTE53"
AwsLogSourceNameVpcFlow AwsLogSourceName = "VPC_FLOW"
AwsLogSourceNameShFindings AwsLogSourceName = "SH_FINDINGS"
AwsLogSourceNameCloudTrailMgmt AwsLogSourceName = "CLOUD_TRAIL_MGMT"
AwsLogSourceNameLambdaExecution AwsLogSourceName = "LAMBDA_EXECUTION"
AwsLogSourceNameS3Data AwsLogSourceName = "S3_DATA"
)
// Values returns all known values for AwsLogSourceName. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (AwsLogSourceName) Values() []AwsLogSourceName {
return []AwsLogSourceName{
"ROUTE53",
"VPC_FLOW",
"SH_FINDINGS",
"CLOUD_TRAIL_MGMT",
"LAMBDA_EXECUTION",
"S3_DATA",
}
}
type DataLakeStatus string
// Enum values for DataLakeStatus
const (
DataLakeStatusInitialized DataLakeStatus = "INITIALIZED"
DataLakeStatusPending DataLakeStatus = "PENDING"
DataLakeStatusCompleted DataLakeStatus = "COMPLETED"
DataLakeStatusFailed DataLakeStatus = "FAILED"
)
// Values returns all known values for DataLakeStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (DataLakeStatus) Values() []DataLakeStatus {
return []DataLakeStatus{
"INITIALIZED",
"PENDING",
"COMPLETED",
"FAILED",
}
}
type HttpMethod string
// Enum values for HttpMethod
const (
HttpMethodPost HttpMethod = "POST"
HttpMethodPut HttpMethod = "PUT"
)
// Values returns all known values for HttpMethod. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (HttpMethod) Values() []HttpMethod {
return []HttpMethod{
"POST",
"PUT",
}
}
type SourceCollectionStatus string
// Enum values for SourceCollectionStatus
const (
SourceCollectionStatusCollecting SourceCollectionStatus = "COLLECTING"
SourceCollectionStatusMisconfigured SourceCollectionStatus = "MISCONFIGURED"
SourceCollectionStatusNotCollecting SourceCollectionStatus = "NOT_COLLECTING"
)
// Values returns all known values for SourceCollectionStatus. Note that this can
// be expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SourceCollectionStatus) Values() []SourceCollectionStatus {
return []SourceCollectionStatus{
"COLLECTING",
"MISCONFIGURED",
"NOT_COLLECTING",
}
}
type SubscriberStatus string
// Enum values for SubscriberStatus
const (
SubscriberStatusActive SubscriberStatus = "ACTIVE"
SubscriberStatusDeactivated SubscriberStatus = "DEACTIVATED"
SubscriberStatusPending SubscriberStatus = "PENDING"
SubscriberStatusReady SubscriberStatus = "READY"
)
// Values returns all known values for SubscriberStatus. Note that this can be
// expanded in the future, and so it is only as up to date as the client. The
// ordering of this slice is not guaranteed to be stable across updates.
func (SubscriberStatus) Values() []SubscriberStatus {
return []SubscriberStatus{
"ACTIVE",
"DEACTIVATED",
"PENDING",
"READY",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// You do not have sufficient access to perform this action. Access denied errors
// appear when Amazon Security Lake explicitly or implicitly denies an
// authorization request. An explicit denial occurs when a policy contains a Deny
// statement for the specific Amazon Web Services action. An implicit denial occurs
// when there is no applicable Deny statement and also no applicable Allow
// statement.
type AccessDeniedException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *AccessDeniedException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *AccessDeniedException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *AccessDeniedException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "AccessDeniedException"
}
return *e.ErrorCodeOverride
}
func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The request is malformed or contains an error such as an invalid parameter
// value or a missing required parameter.
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Occurs when a conflict with a previous successful write is detected. This
// generally occurs when the previous write did not have time to propagate to the
// host serving the current request. A retry (with appropriate backoff logic) is
// the recommended response to this exception.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
ResourceName *string
ResourceType *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// Internal service exceptions are sometimes caused by transient issues. Before
// you start troubleshooting, perform the operation again.
type InternalServerException struct {
Message *string
ErrorCodeOverride *string
noSmithyDocumentSerde
}
func (e *InternalServerException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The resource could not be found.
type ResourceNotFoundException struct {
Message *string
ErrorCodeOverride *string
ResourceName *string
ResourceType *string
noSmithyDocumentSerde
}
func (e *ResourceNotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ResourceNotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ResourceNotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ResourceNotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The limit on the number of requests per second was exceeded.
type ThrottlingException struct {
Message *string
ErrorCodeOverride *string
ServiceCode *string
QuotaCode *string
RetryAfterSeconds *int32
noSmithyDocumentSerde
}
func (e *ThrottlingException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ThrottlingException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ThrottlingException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ThrottlingException"
}
return *e.ErrorCodeOverride
}
func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 187 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
"time"
)
// The AWS identity.
type AwsIdentity struct {
// The external ID used to estalish trust relationship with the AWS identity.
//
// This member is required.
ExternalId *string
// The AWS identity principal.
//
// This member is required.
Principal *string
noSmithyDocumentSerde
}
// The Security Lake logs source configuration file describes the information
// needed to generate Security Lake logs.
type AwsLogSourceConfiguration struct {
// Specify the Regions where you want to enable Security Lake.
//
// This member is required.
Regions []string
// The name for a Amazon Web Services source. This must be a Regionally unique
// value.
//
// This member is required.
SourceName AwsLogSourceName
// Specify the Amazon Web Services account information where you want to enable
// Security Lake.
Accounts []string
// The version for a Amazon Web Services source. This must be a Regionally unique
// value.
SourceVersion *string
noSmithyDocumentSerde
}
// Amazon Security Lake can collect logs and events from natively-supported Amazon
// Web Services services.
type AwsLogSourceResource struct {
// The name for a Amazon Web Services source. This must be a Regionally unique
// value.
SourceName AwsLogSourceName
// The version for a Amazon Web Services source. This must be a Regionally unique
// value.
SourceVersion *string
noSmithyDocumentSerde
}
// The attributes of a third-party custom source.
type CustomLogSourceAttributes struct {
// The ARN of the Glue crawler.
CrawlerArn *string
// The ARN of the Glue database where results are written, such as:
// arn:aws:daylight:us-east-1::database/sometable/* .
DatabaseArn *string
// The ARN of the Glue table.
TableArn *string
noSmithyDocumentSerde
}
// The configuration for the third-party custom source.
type CustomLogSourceConfiguration struct {
// The configuration for the Glue Crawler for the third-party custom source.
//
// This member is required.
CrawlerConfiguration *CustomLogSourceCrawlerConfiguration
// The identity of the log provider for the third-party custom source.
//
// This member is required.
ProviderIdentity *AwsIdentity
noSmithyDocumentSerde
}
// The configuration for the Glue Crawler for the third-party custom source.
type CustomLogSourceCrawlerConfiguration struct {
// The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) role
// to be used by the Glue crawler. The recommended IAM policies are:
// - The managed policy AWSGlueServiceRole
// - A custom policy granting access to your Amazon S3 Data Lake
//
// This member is required.
RoleArn *string
noSmithyDocumentSerde
}
// The details of the log provider for a third-party custom source.
type CustomLogSourceProvider struct {
// The location of the partition in the Amazon S3 bucket for Security Lake.
Location *string
// The ARN of the IAM role to be used by the entity putting logs into your custom
// source partition. Security Lake will apply the correct access policies to this
// role, but you must first manually create the trust policy for this role. The IAM
// role name must start with the text 'Security Lake'. The IAM role must trust the
// logProviderAccountId to assume the role.
RoleArn *string
noSmithyDocumentSerde
}
// Amazon Security Lake can collect logs and events from third-party custom
// sources.
type CustomLogSourceResource struct {
// The attributes of a third-party custom source.
Attributes *CustomLogSourceAttributes
// The details of the log provider for a third-party custom source.
Provider *CustomLogSourceProvider
// The name for a third-party custom source. This must be a Regionally unique
// value.
SourceName *string
// The version for a third-party custom source. This must be a Regionally unique
// value.
SourceVersion *string
noSmithyDocumentSerde
}
// Automatically enable new organization accounts as member accounts from an
// Amazon Security Lake administrator account.
type DataLakeAutoEnableNewAccountConfiguration struct {
// The Amazon Web Services Regions where Security Lake is automatically enabled.
//
// This member is required.
Region *string
// The Amazon Web Services sources that are automatically enabled in Security Lake.
//
// This member is required.
Sources []AwsLogSourceResource
noSmithyDocumentSerde
}
// Provides details of Amazon Security Lake object.
type DataLakeConfiguration struct {
// The Amazon Web Services Regions where Security Lake is automatically enabled.
//
// This member is required.
Region *string
// Provides encryption details of Amazon Security Lake object.
EncryptionConfiguration *DataLakeEncryptionConfiguration
// Provides lifecycle details of Amazon Security Lake object.
LifecycleConfiguration *DataLakeLifecycleConfiguration
// Provides replication details of Amazon Security Lake object.
ReplicationConfiguration *DataLakeReplicationConfiguration
noSmithyDocumentSerde
}
// Provides encryption details of Amazon Security Lake object.
type DataLakeEncryptionConfiguration struct {
// The id of KMS encryption key used by Amazon Security Lake to encrypt the
// Security Lake object.
KmsKeyId *string
noSmithyDocumentSerde
}
// The details for a Security Lake exception
type DataLakeException struct {
// The underlying exception of a Security Lake exception.
Exception *string
// The Amazon Web Services Regions where the exception occurred.
Region *string
// List of all remediation steps for a Security Lake exception.
Remediation *string
// This error can occur if you configure the wrong timestamp format, or if the
// subset of entries used for validation had errors or missing values.
Timestamp *time.Time
noSmithyDocumentSerde
}
// Provides lifecycle details of Amazon Security Lake object.
type DataLakeLifecycleConfiguration struct {
// Provides data expiration details of Amazon Security Lake object.
Expiration *DataLakeLifecycleExpiration
// Provides data storage transition details of Amazon Security Lake object.
Transitions []DataLakeLifecycleTransition
noSmithyDocumentSerde
}
// Provide expiration lifecycle details of Amazon Security Lake object.
type DataLakeLifecycleExpiration struct {
// Number of days before data expires in the Amazon Security Lake object.
Days *int32
noSmithyDocumentSerde
}
// Provide transition lifecycle details of Amazon Security Lake object.
type DataLakeLifecycleTransition struct {
// Number of days before data transitions to a different S3 Storage Class in the
// Amazon Security Lake object.
Days *int32
// The range of storage classes that you can choose from based on the data access,
// resiliency, and cost requirements of your workloads.
StorageClass *string
noSmithyDocumentSerde
}
// Provides replication details of Amazon Security Lake object.
type DataLakeReplicationConfiguration struct {
// Replication enables automatic, asynchronous copying of objects across Amazon S3
// buckets. Amazon S3 buckets that are configured for object replication can be
// owned by the same Amazon Web Services account or by different accounts. You can
// replicate objects to a single destination bucket or to multiple destination
// buckets. The destination buckets can be in different Amazon Web Services Regions
// or within the same Region as the source bucket. Set up one or more rollup
// Regions by providing the Region or Regions that should contribute to the central
// rollup Region.
Regions []string
// Replication settings for the Amazon S3 buckets. This parameter uses the
// Identity and Access Management (IAM) role you created that is managed by
// Security Lake, to ensure the replication setting is correct.
RoleArn *string
noSmithyDocumentSerde
}
// Provides details of Amazon Security Lake object.
type DataLakeResource struct {
// The Amazon Resource Name (ARN) created by you to provide to the subscriber. For
// more information about ARNs and how to use them in policies, see the Amazon
// Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/subscriber-management.html)
// .
//
// This member is required.
DataLakeArn *string
// The Amazon Web Services Regions where Security Lake is enabled.
//
// This member is required.
Region *string
// Retrieves the status of the configuration operation for an account in Amazon
// Security Lake.
CreateStatus DataLakeStatus
// Provides encryption details of Amazon Security Lake object.
EncryptionConfiguration *DataLakeEncryptionConfiguration
// Provides lifecycle details of Amazon Security Lake object.
LifecycleConfiguration *DataLakeLifecycleConfiguration
// Provides replication details of Amazon Security Lake object.
ReplicationConfiguration *DataLakeReplicationConfiguration
// The ARN for the Amazon Security Lake Amazon S3 bucket.
S3BucketArn *string
// The status of the last UpdateDataLake or DeleteDataLake API request.
UpdateStatus *DataLakeUpdateStatus
noSmithyDocumentSerde
}
// Amazon Security Lake collects logs and events from supported Amazon Web
// Services and custom sources. For the list of supported Amazon Web Services, see
// the Amazon Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html)
// .
type DataLakeSource struct {
// The ID of the Security Lake account for which logs are collected.
Account *string
// The Open Cybersecurity Schema Framework (OCSF) event classes which describes
// the type of data that the custom source will send to Security Lake. The
// supported event classes are:
// - ACCESS_ACTIVITY
// - FILE_ACTIVITY
// - KERNEL_ACTIVITY
// - KERNEL_EXTENSION
// - MEMORY_ACTIVITY
// - MODULE_ACTIVITY
// - PROCESS_ACTIVITY
// - REGISTRY_KEY_ACTIVITY
// - REGISTRY_VALUE_ACTIVITY
// - RESOURCE_ACTIVITY
// - SCHEDULED_JOB_ACTIVITY
// - SECURITY_FINDING
// - ACCOUNT_CHANGE
// - AUTHENTICATION
// - AUTHORIZATION
// - ENTITY_MANAGEMENT_AUDIT
// - DHCP_ACTIVITY
// - NETWORK_ACTIVITY
// - DNS_ACTIVITY
// - FTP_ACTIVITY
// - HTTP_ACTIVITY
// - RDP_ACTIVITY
// - SMB_ACTIVITY
// - SSH_ACTIVITY
// - CONFIG_STATE
// - INVENTORY_INFO
// - EMAIL_ACTIVITY
// - API_ACTIVITY
// - CLOUD_API
EventClasses []string
// The supported Amazon Web Services from which logs and events are collected.
// Amazon Security Lake supports log and event collection for natively supported
// Amazon Web Services.
SourceName *string
// The log status for the Security Lake account.
SourceStatuses []DataLakeSourceStatus
noSmithyDocumentSerde
}
// Retrieves the Logs status for the Amazon Security Lake account.
type DataLakeSourceStatus struct {
// Defines path the stored logs are available which has information on your
// systems, applications, and services.
Resource *string
// The health status of services, including error codes and patterns.
Status SourceCollectionStatus
noSmithyDocumentSerde
}
// The details of the last UpdateDataLake or DeleteDataLake API request which
// failed.
type DataLakeUpdateException struct {
// The reason code for the exception of the last UpdateDataLake or DeleteDataLake
// API request.
Code *string
// The reason for the exception of the last UpdateDataLake or DeleteDataLake API
// request.
Reason *string
noSmithyDocumentSerde
}
// The status of the last UpdateDataLake or DeleteDataLake API request. This is
// set to Completed after the configuration is updated, or removed if deletion of
// the data lake is successful.
type DataLakeUpdateStatus struct {
// The details of the last UpdateDataLake or DeleteDataLake API request which
// failed.
Exception *DataLakeUpdateException
// The unique ID for the last UpdateDataLake or DeleteDataLake API request.
RequestId *string
// The status of the last UpdateDataLake or DeleteDataLake API request that was
// requested.
Status DataLakeStatus
noSmithyDocumentSerde
}
// The configurations for HTTPS subscriber notification.
type HttpsNotificationConfiguration struct {
// The subscription endpoint in Security Lake. If you prefer notification with an
// HTTPs endpoint, populate this field.
//
// This member is required.
Endpoint *string
// The Amazon Resource Name (ARN) of the EventBridge API destinations IAM role
// that you created. For more information about ARNs and how to use them in
// policies, see Managing data access (https://docs.aws.amazon.com//security-lake/latest/userguide/subscriber-data-access.html)
// and Amazon Web Services Managed Policies (https://docs.aws.amazon.com/security-lake/latest/userguide/security-iam-awsmanpol.html)
// in the Amazon Security Lake User Guide.
//
// This member is required.
TargetRoleArn *string
// The key name for the notification subscription.
AuthorizationApiKeyName *string
// The key value for the notification subscription.
AuthorizationApiKeyValue *string
// The HTTPS method used for the notification subscription.
HttpMethod HttpMethod
noSmithyDocumentSerde
}
// Amazon Security Lake can collect logs and events from natively-supported Amazon
// Web Services services and custom sources.
type LogSource struct {
// Specify the account from which you want to collect logs.
Account *string
// Specify the Regions from which you want to collect logs.
Region *string
// Specify the sources from which you want to collect logs.
Sources []LogSourceResource
noSmithyDocumentSerde
}
// The supported source types from which logs and events are collected in Amazon
// Security Lake. For the list of supported Amazon Web Services, see the Amazon
// Security Lake User Guide (https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html)
// .
//
// The following types satisfy this interface:
//
// LogSourceResourceMemberAwsLogSource
// LogSourceResourceMemberCustomLogSource
type LogSourceResource interface {
isLogSourceResource()
}
// Amazon Security Lake supports log and event collection for natively supported
// Amazon Web Services.
type LogSourceResourceMemberAwsLogSource struct {
Value AwsLogSourceResource
noSmithyDocumentSerde
}
func (*LogSourceResourceMemberAwsLogSource) isLogSourceResource() {}
// Amazon Security Lake supports custom source types. For a detailed list, see the
// Amazon Security Lake User Guide.
type LogSourceResourceMemberCustomLogSource struct {
Value CustomLogSourceResource
noSmithyDocumentSerde
}
func (*LogSourceResourceMemberCustomLogSource) isLogSourceResource() {}
// Specify the configurations you want to use for subscriber notification to
// notify the subscriber when new data is written to the data lake for sources that
// the subscriber consumes in Security Lake.
//
// The following types satisfy this interface:
//
// NotificationConfigurationMemberHttpsNotificationConfiguration
// NotificationConfigurationMemberSqsNotificationConfiguration
type NotificationConfiguration interface {
isNotificationConfiguration()
}
// The configurations for HTTPS subscriber notification.
type NotificationConfigurationMemberHttpsNotificationConfiguration struct {
Value HttpsNotificationConfiguration
noSmithyDocumentSerde
}
func (*NotificationConfigurationMemberHttpsNotificationConfiguration) isNotificationConfiguration() {}
// The configurations for SQS subscriber notification.
type NotificationConfigurationMemberSqsNotificationConfiguration struct {
Value SqsNotificationConfiguration
noSmithyDocumentSerde
}
func (*NotificationConfigurationMemberSqsNotificationConfiguration) isNotificationConfiguration() {}
// The configurations for SQS subscriber notification.
type SqsNotificationConfiguration struct {
noSmithyDocumentSerde
}
// Provides details about the Amazon Security Lake account subscription.
// Subscribers are notified of new objects for a source as the data is written to
// your Amazon S3 bucket for Security Lake.
type SubscriberResource struct {
// Amazon Security Lake supports log and event collection for natively supported
// Amazon Web Services. For more information, see the Amazon Security Lake User
// Guide.
//
// This member is required.
Sources []LogSourceResource
// The subscriber ARN of the Amazon Security Lake subscriber account.
//
// This member is required.
SubscriberArn *string
// The subscriber ID of the Amazon Security Lake subscriber account.
//
// This member is required.
SubscriberId *string
// The AWS identity used to access your data.
//
// This member is required.
SubscriberIdentity *AwsIdentity
// The name of your Amazon Security Lake subscriber account.
//
// This member is required.
SubscriberName *string
// You can choose to notify subscribers of new objects with an Amazon Simple Queue
// Service (Amazon SQS) queue or through messaging to an HTTPS endpoint provided by
// the subscriber. Subscribers can consume data by directly querying Lake Formation
// tables in your Amazon S3 bucket through services like Amazon Athena. This
// subscription type is defined as LAKEFORMATION .
AccessTypes []AccessType
// The date and time when the subscriber was created.
CreatedAt *time.Time
// The Amazon Resource Name (ARN) which uniquely defines the AWS RAM resource
// share. Before accepting the RAM resource share invitation, you can view details
// related to the RAM resource share. This field is available only for Lake
// Formation subscribers created after March 8, 2023.
ResourceShareArn *string
// The name of the resource share.
ResourceShareName *string
// The Amazon Resource Name (ARN) specifying the role of the subscriber.
RoleArn *string
// The ARN for the Amazon S3 bucket.
S3BucketArn *string
// The subscriber descriptions for a subscriber account. The description for a
// subscriber includes subscriberName , accountID , externalID , and subscriberId .
SubscriberDescription *string
// The subscriber endpoint to which exception messages are posted.
SubscriberEndpoint *string
// The subscriber status of the Amazon Security Lake subscriber account.
SubscriberStatus SubscriberStatus
// The date and time when the subscriber was last updated.
UpdatedAt *time.Time
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
// UnknownUnionMember is returned when a union member is returned over the wire,
// but has an unknown tag.
type UnknownUnionMember struct {
Tag string
Value []byte
noSmithyDocumentSerde
}
func (*UnknownUnionMember) isLogSourceResource() {}
func (*UnknownUnionMember) isNotificationConfiguration() {}
| 611 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types_test
import (
"fmt"
"github.com/aws/aws-sdk-go-v2/service/securitylake/types"
)
func ExampleLogSourceResource_outputUsage() {
var union types.LogSourceResource
// type switches can be used to check the union value
switch v := union.(type) {
case *types.LogSourceResourceMemberAwsLogSource:
_ = v.Value // Value is types.AwsLogSourceResource
case *types.LogSourceResourceMemberCustomLogSource:
_ = v.Value // Value is types.CustomLogSourceResource
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.AwsLogSourceResource
var _ *types.CustomLogSourceResource
func ExampleNotificationConfiguration_outputUsage() {
var union types.NotificationConfiguration
// type switches can be used to check the union value
switch v := union.(type) {
case *types.NotificationConfigurationMemberHttpsNotificationConfiguration:
_ = v.Value // Value is types.HttpsNotificationConfiguration
case *types.NotificationConfigurationMemberSqsNotificationConfiguration:
_ = v.Value // Value is types.SqsNotificationConfiguration
case *types.UnknownUnionMember:
fmt.Println("unknown tag:", v.Tag)
default:
fmt.Println("union is nil or unknown type")
}
}
var _ *types.SqsNotificationConfiguration
var _ *types.HttpsNotificationConfiguration
| 53 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "ServerlessApplicationRepository"
const ServiceAPIVersion = "2017-09-08"
// Client provides the API client to make operations call for
// AWSServerlessApplicationRepository.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "serverlessapplicationrepository", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 435 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an application, optionally including an AWS SAM file to create the
// first application version in the same call.
func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) {
if params == nil {
params = &CreateApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, c.addOperationCreateApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateApplicationInput struct {
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
//
// This member is required.
Author *string
// The description of the application.Minimum length=1. Maximum length=256
//
// This member is required.
Description *string
// The name of the application that you want to publish.Minimum length=1. Maximum
// length=140Pattern: "[a-zA-Z0-9\\-]+";
//
// This member is required.
Name *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A local text file that contains the license of the app that matches the
// spdxLicenseID value of your application. The file has the format
// file://<path>/<filename>.Maximum size 5 MBYou can specify only one of
// licenseBody and licenseUrl; otherwise, an error results.
LicenseBody *string
// A link to the S3 object that contains the license of the app that matches the
// spdxLicenseID value of your application.Maximum size 5 MBYou can specify only
// one of licenseBody and licenseUrl; otherwise, an error results.
LicenseUrl *string
// A local text readme file in Markdown language that contains a more detailed
// description of the application and how it works. The file has the format
// file://<path>/<filename>.Maximum size 5 MBYou can specify only one of readmeBody
// and readmeUrl; otherwise, an error results.
ReadmeBody *string
// A link to the S3 object in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MBYou can specify
// only one of readmeBody and readmeUrl; otherwise, an error results.
ReadmeUrl *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// A link to the S3 object that contains the ZIP archive of the source code for
// this version of your application.Maximum size 50 MB
SourceCodeArchiveUrl *string
// A link to a public repository for the source code of your application, for
// example the URL of a specific GitHub commit.
SourceCodeUrl *string
// A valid identifier from https://spdx.org/licenses/ (https://spdx.org/licenses/) .
SpdxLicenseId *string
// The local raw packaged AWS SAM template file of your application. The file has
// the format file://<path>/<filename>.You can specify only one of templateBody and
// templateUrl; otherwise an error results.
TemplateBody *string
// A link to the S3 object containing the packaged AWS SAM template of your
// application.You can specify only one of templateBody and templateUrl; otherwise
// an error results.
TemplateUrl *string
noSmithyDocumentSerde
}
type CreateApplicationOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
Author *string
// The date and time this resource was created.
CreationTime *string
// The description of the application.Minimum length=1. Maximum length=256
Description *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Whether the author of this application has been verified. This means means that
// AWS has made a good faith review, as a reasonable and prudent service provider,
// of the information provided by the requester and has confirmed that the
// requester's identity is as claimed.
IsVerifiedAuthor bool
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A link to a license file of the app that matches the spdxLicenseID value of
// your application.Maximum size 5 MB
LicenseUrl *string
// The name of the application.Minimum length=1. Maximum length=140Pattern:
// "[a-zA-Z0-9\\-]+";
Name *string
// A link to the readme file in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MB
ReadmeUrl *string
// A valid identifier from https://spdx.org/licenses/.
SpdxLicenseId *string
// The URL to the public profile of a verified author. This URL is submitted by
// the author.
VerifiedAuthorUrl *string
// Version information about the application.
Version *types.Version
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "CreateApplication",
}
}
| 238 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an application version.
func (c *Client) CreateApplicationVersion(ctx context.Context, params *CreateApplicationVersionInput, optFns ...func(*Options)) (*CreateApplicationVersionOutput, error) {
if params == nil {
params = &CreateApplicationVersionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateApplicationVersion", params, optFns, c.addOperationCreateApplicationVersionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateApplicationVersionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateApplicationVersionInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The semantic version of the new version.
//
// This member is required.
SemanticVersion *string
// A link to the S3 object that contains the ZIP archive of the source code for
// this version of your application.Maximum size 50 MB
SourceCodeArchiveUrl *string
// A link to a public repository for the source code of your application, for
// example the URL of a specific GitHub commit.
SourceCodeUrl *string
// The raw packaged AWS SAM template of your application.
TemplateBody *string
// A link to the packaged AWS SAM template of your application.
TemplateUrl *string
noSmithyDocumentSerde
}
type CreateApplicationVersionOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The date and time this resource was created.
CreationTime *string
// An array of parameter types supported by the application.
ParameterDefinitions []types.ParameterDefinition
// A list of values that you must specify before you can deploy certain
// applications. Some applications might include resources that can affect
// permissions in your AWS account, for example, by creating new AWS Identity and
// Access Management (IAM) users. For those applications, you must explicitly
// acknowledge their capabilities by specifying this parameter.The only valid
// values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, and
// CAPABILITY_AUTO_EXPAND.The following resources require you to specify
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM: AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)
// , AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html)
// , AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , and AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)
// . If the application contains IAM resources, you can specify either
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
// resources with custom names, you must specify CAPABILITY_NAMED_IAM.The following
// resources require you to specify CAPABILITY_RESOURCE_POLICY:
// AWS::Lambda::Permission (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html)
// , AWS::IAM:Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , AWS::ApplicationAutoScaling::ScalingPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html)
// , AWS::S3::BucketPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html)
// , AWS::SQS::QueuePolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html)
// , and AWS::SNS::TopicPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html)
// .Applications that contain one or more nested applications require you to
// specify CAPABILITY_AUTO_EXPAND.If your application template contains any of the
// above resources, we recommend that you review all permissions associated with
// the application before deploying. If you don't specify this parameter for an
// application that requires capabilities, the call will fail.
RequiredCapabilities []types.Capability
// Whether all of the AWS resources contained in this application are supported in
// the region in which it is being retrieved.
ResourcesSupported bool
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// A link to the S3 object that contains the ZIP archive of the source code for
// this version of your application.Maximum size 50 MB
SourceCodeArchiveUrl *string
// A link to a public repository for the source code of your application, for
// example the URL of a specific GitHub commit.
SourceCodeUrl *string
// A link to the packaged AWS SAM template of your application.
TemplateUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateApplicationVersionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApplicationVersion{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApplicationVersion{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateApplicationVersionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplicationVersion(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateApplicationVersion(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "CreateApplicationVersion",
}
}
| 196 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an AWS CloudFormation change set for the given application.
func (c *Client) CreateCloudFormationChangeSet(ctx context.Context, params *CreateCloudFormationChangeSetInput, optFns ...func(*Options)) (*CreateCloudFormationChangeSetOutput, error) {
if params == nil {
params = &CreateCloudFormationChangeSetInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCloudFormationChangeSet", params, optFns, c.addOperationCreateCloudFormationChangeSetMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCloudFormationChangeSetOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCloudFormationChangeSetInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
//
// This member is required.
StackName *string
// A list of values that you must specify before you can deploy certain
// applications. Some applications might include resources that can affect
// permissions in your AWS account, for example, by creating new AWS Identity and
// Access Management (IAM) users. For those applications, you must explicitly
// acknowledge their capabilities by specifying this parameter.The only valid
// values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, and
// CAPABILITY_AUTO_EXPAND.The following resources require you to specify
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM: AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)
// , AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html)
// , AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , and AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)
// . If the application contains IAM resources, you can specify either
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
// resources with custom names, you must specify CAPABILITY_NAMED_IAM.The following
// resources require you to specify CAPABILITY_RESOURCE_POLICY:
// AWS::Lambda::Permission (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html)
// , AWS::IAM:Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , AWS::ApplicationAutoScaling::ScalingPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html)
// , AWS::S3::BucketPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html)
// , AWS::SQS::QueuePolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html)
// , and AWS::SNS:TopicPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html)
// .Applications that contain one or more nested applications require you to
// specify CAPABILITY_AUTO_EXPAND.If your application template contains any of the
// above resources, we recommend that you review all permissions associated with
// the application before deploying. If you don't specify this parameter for an
// application that requires capabilities, the call will fail.
Capabilities []string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
ChangeSetName *string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
ClientToken *string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
Description *string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
NotificationArns []string
// A list of parameter values for the parameters of the application.
ParameterOverrides []types.ParameterValue
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
ResourceTypes []string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
RollbackConfiguration *types.RollbackConfiguration
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// This property corresponds to the parameter of the same name for the AWS
// CloudFormation CreateChangeSet (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/CreateChangeSet)
// API.
Tags []types.Tag
// The UUID returned by CreateCloudFormationTemplate.Pattern:
// [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
TemplateId *string
noSmithyDocumentSerde
}
type CreateCloudFormationChangeSetOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The Amazon Resource Name (ARN) of the change set.Length constraints: Minimum
// length of 1.Pattern: ARN:[-a-zA-Z0-9:/]*
ChangeSetId *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// The unique ID of the stack.
StackId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCloudFormationChangeSetMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCloudFormationChangeSet{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCloudFormationChangeSet{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateCloudFormationChangeSetValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCloudFormationChangeSet(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateCloudFormationChangeSet(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "CreateCloudFormationChangeSet",
}
}
| 215 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates an AWS CloudFormation template.
func (c *Client) CreateCloudFormationTemplate(ctx context.Context, params *CreateCloudFormationTemplateInput, optFns ...func(*Options)) (*CreateCloudFormationTemplateOutput, error) {
if params == nil {
params = &CreateCloudFormationTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateCloudFormationTemplate", params, optFns, c.addOperationCreateCloudFormationTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateCloudFormationTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateCloudFormationTemplateInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
noSmithyDocumentSerde
}
type CreateCloudFormationTemplateOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The date and time this resource was created.
CreationTime *string
// The date and time this template expires. Templates expire 1 hour after creation.
ExpirationTime *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// Status of the template creation workflow.Possible values: PREPARING | ACTIVE |
// EXPIRED
Status types.Status
// The UUID returned by CreateCloudFormationTemplate.Pattern:
// [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
TemplateId *string
// A link to the template that can be used to deploy the application using AWS
// CloudFormation.
TemplateUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateCloudFormationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCloudFormationTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCloudFormationTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateCloudFormationTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCloudFormationTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateCloudFormationTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "CreateCloudFormationTemplate",
}
}
| 149 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified application.
func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) {
if params == nil {
params = &DeleteApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, c.addOperationDeleteApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteApplicationInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
noSmithyDocumentSerde
}
type DeleteApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "DeleteApplication",
}
}
| 120 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the specified application.
func (c *Client) GetApplication(ctx context.Context, params *GetApplicationInput, optFns ...func(*Options)) (*GetApplicationOutput, error) {
if params == nil {
params = &GetApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetApplication", params, optFns, c.addOperationGetApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetApplicationInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The semantic version of the application to get.
SemanticVersion *string
noSmithyDocumentSerde
}
type GetApplicationOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
Author *string
// The date and time this resource was created.
CreationTime *string
// The description of the application.Minimum length=1. Maximum length=256
Description *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Whether the author of this application has been verified. This means means that
// AWS has made a good faith review, as a reasonable and prudent service provider,
// of the information provided by the requester and has confirmed that the
// requester's identity is as claimed.
IsVerifiedAuthor bool
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A link to a license file of the app that matches the spdxLicenseID value of
// your application.Maximum size 5 MB
LicenseUrl *string
// The name of the application.Minimum length=1. Maximum length=140Pattern:
// "[a-zA-Z0-9\\-]+";
Name *string
// A link to the readme file in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MB
ReadmeUrl *string
// A valid identifier from https://spdx.org/licenses/.
SpdxLicenseId *string
// The URL to the public profile of a verified author. This URL is submitted by
// the author.
VerifiedAuthorUrl *string
// Version information about the application.
Version *types.Version
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "GetApplication",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the policy for the application.
func (c *Client) GetApplicationPolicy(ctx context.Context, params *GetApplicationPolicyInput, optFns ...func(*Options)) (*GetApplicationPolicyOutput, error) {
if params == nil {
params = &GetApplicationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetApplicationPolicy", params, optFns, c.addOperationGetApplicationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetApplicationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetApplicationPolicyInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
noSmithyDocumentSerde
}
type GetApplicationPolicyOutput struct {
// An array of policy statements applied to the application.
Statements []types.ApplicationPolicyStatement
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetApplicationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetApplicationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetApplicationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetApplicationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApplicationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetApplicationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "GetApplicationPolicy",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets the specified AWS CloudFormation template.
func (c *Client) GetCloudFormationTemplate(ctx context.Context, params *GetCloudFormationTemplateInput, optFns ...func(*Options)) (*GetCloudFormationTemplateOutput, error) {
if params == nil {
params = &GetCloudFormationTemplateInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetCloudFormationTemplate", params, optFns, c.addOperationGetCloudFormationTemplateMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetCloudFormationTemplateOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetCloudFormationTemplateInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The UUID returned by CreateCloudFormationTemplate.Pattern:
// [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
//
// This member is required.
TemplateId *string
noSmithyDocumentSerde
}
type GetCloudFormationTemplateOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The date and time this resource was created.
CreationTime *string
// The date and time this template expires. Templates expire 1 hour after creation.
ExpirationTime *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
SemanticVersion *string
// Status of the template creation workflow.Possible values: PREPARING | ACTIVE |
// EXPIRED
Status types.Status
// The UUID returned by CreateCloudFormationTemplate.Pattern:
// [0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}
TemplateId *string
// A link to the template that can be used to deploy the application using AWS
// CloudFormation.
TemplateUrl *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetCloudFormationTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCloudFormationTemplate{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCloudFormationTemplate{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpGetCloudFormationTemplateValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCloudFormationTemplate(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetCloudFormationTemplate(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "GetCloudFormationTemplate",
}
}
| 152 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Retrieves the list of applications nested in the containing application.
func (c *Client) ListApplicationDependencies(ctx context.Context, params *ListApplicationDependenciesInput, optFns ...func(*Options)) (*ListApplicationDependenciesOutput, error) {
if params == nil {
params = &ListApplicationDependenciesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListApplicationDependencies", params, optFns, c.addOperationListApplicationDependenciesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListApplicationDependenciesOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListApplicationDependenciesInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The total number of items to return.
MaxItems int32
// A token to specify where to start paginating.
NextToken *string
// The semantic version of the application to get.
SemanticVersion *string
noSmithyDocumentSerde
}
type ListApplicationDependenciesOutput struct {
// An array of application summaries nested in the application.
Dependencies []types.ApplicationDependencySummary
// The token to request the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListApplicationDependenciesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplicationDependencies{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplicationDependencies{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListApplicationDependenciesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplicationDependencies(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
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
// 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 {
if params == nil {
params = &ListApplicationDependenciesInput{}
}
options := ListApplicationDependenciesPaginatorOptions{}
if params.MaxItems != 0 {
options.Limit = params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListApplicationDependenciesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListApplicationDependenciesPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// 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
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 = 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,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "ListApplicationDependencies",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists applications owned by the requester.
func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) {
if params == nil {
params = &ListApplicationsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, c.addOperationListApplicationsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListApplicationsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListApplicationsInput struct {
// The total number of items to return.
MaxItems int32
// A token to specify where to start paginating.
NextToken *string
noSmithyDocumentSerde
}
type ListApplicationsOutput struct {
// An array of application summaries.
Applications []types.ApplicationSummary
// The token to request the next page of results.
NextToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplications{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplications{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplications(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
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 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 {
if params == nil {
params = &ListApplicationsInput{}
}
options := ListApplicationsPaginatorOptions{}
if params.MaxItems != 0 {
options.Limit = params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListApplicationsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListApplicationsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// 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
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 = 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,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "ListApplications",
}
}
| 213 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Lists versions for the specified application.
func (c *Client) ListApplicationVersions(ctx context.Context, params *ListApplicationVersionsInput, optFns ...func(*Options)) (*ListApplicationVersionsOutput, error) {
if params == nil {
params = &ListApplicationVersionsInput{}
}
result, metadata, err := c.invokeOperation(ctx, "ListApplicationVersions", params, optFns, c.addOperationListApplicationVersionsMiddlewares)
if err != nil {
return nil, err
}
out := result.(*ListApplicationVersionsOutput)
out.ResultMetadata = metadata
return out, nil
}
type ListApplicationVersionsInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The total number of items to return.
MaxItems int32
// A token to specify where to start paginating.
NextToken *string
noSmithyDocumentSerde
}
type ListApplicationVersionsOutput struct {
// The token to request the next page of results.
NextToken *string
// An array of version summaries for the application.
Versions []types.VersionSummary
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationListApplicationVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplicationVersions{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplicationVersions{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpListApplicationVersionsValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListApplicationVersions(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
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 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 {
if params == nil {
params = &ListApplicationVersionsInput{}
}
options := ListApplicationVersionsPaginatorOptions{}
if params.MaxItems != 0 {
options.Limit = params.MaxItems
}
for _, fn := range optFns {
fn(&options)
}
return &ListApplicationVersionsPaginator{
options: options,
client: client,
params: params,
firstPage: true,
nextToken: params.NextToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListApplicationVersionsPaginator) HasMorePages() bool {
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// 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
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 = 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,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "ListApplicationVersions",
}
}
| 223 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the permission policy for an application. For the list of actions
// supported for this operation, see Application Permissions (https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions)
// .
func (c *Client) PutApplicationPolicy(ctx context.Context, params *PutApplicationPolicyInput, optFns ...func(*Options)) (*PutApplicationPolicyOutput, error) {
if params == nil {
params = &PutApplicationPolicyInput{}
}
result, metadata, err := c.invokeOperation(ctx, "PutApplicationPolicy", params, optFns, c.addOperationPutApplicationPolicyMiddlewares)
if err != nil {
return nil, err
}
out := result.(*PutApplicationPolicyOutput)
out.ResultMetadata = metadata
return out, nil
}
type PutApplicationPolicyInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// An array of policy statements applied to the application.
//
// This member is required.
Statements []types.ApplicationPolicyStatement
noSmithyDocumentSerde
}
type PutApplicationPolicyOutput struct {
// An array of policy statements applied to the application.
Statements []types.ApplicationPolicyStatement
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationPutApplicationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpPutApplicationPolicy{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutApplicationPolicy{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpPutApplicationPolicyValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutApplicationPolicy(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opPutApplicationPolicy(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "PutApplicationPolicy",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Unshares an application from an AWS Organization.This operation can be called
// only from the organization's master account.
func (c *Client) UnshareApplication(ctx context.Context, params *UnshareApplicationInput, optFns ...func(*Options)) (*UnshareApplicationOutput, error) {
if params == nil {
params = &UnshareApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UnshareApplication", params, optFns, c.addOperationUnshareApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UnshareApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UnshareApplicationInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The AWS Organization ID to unshare the application from.
//
// This member is required.
OrganizationId *string
noSmithyDocumentSerde
}
type UnshareApplicationOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUnshareApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUnshareApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUnshareApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUnshareApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUnshareApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUnshareApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "UnshareApplication",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Updates the specified application.
func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) {
if params == nil {
params = &UpdateApplicationInput{}
}
result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, c.addOperationUpdateApplicationMiddlewares)
if err != nil {
return nil, err
}
out := result.(*UpdateApplicationOutput)
out.ResultMetadata = metadata
return out, nil
}
type UpdateApplicationInput struct {
// The Amazon Resource Name (ARN) of the application.
//
// This member is required.
ApplicationId *string
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
Author *string
// The description of the application.Minimum length=1. Maximum length=256
Description *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A text readme file in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MB
ReadmeBody *string
// A link to the readme file in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MB
ReadmeUrl *string
noSmithyDocumentSerde
}
type UpdateApplicationOutput struct {
// The application Amazon Resource Name (ARN).
ApplicationId *string
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
Author *string
// The date and time this resource was created.
CreationTime *string
// The description of the application.Minimum length=1. Maximum length=256
Description *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Whether the author of this application has been verified. This means means that
// AWS has made a good faith review, as a reasonable and prudent service provider,
// of the information provided by the requester and has confirmed that the
// requester's identity is as claimed.
IsVerifiedAuthor bool
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A link to a license file of the app that matches the spdxLicenseID value of
// your application.Maximum size 5 MB
LicenseUrl *string
// The name of the application.Minimum length=1. Maximum length=140Pattern:
// "[a-zA-Z0-9\\-]+";
Name *string
// A link to the readme file in Markdown language that contains a more detailed
// description of the application and how it works.Maximum size 5 MB
ReadmeUrl *string
// A valid identifier from https://spdx.org/licenses/.
SpdxLicenseId *string
// The URL to the public profile of a verified author. This URL is submitted by
// the author.
VerifiedAuthorUrl *string
// Version information about the application.
Version *types.Version
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "serverlessrepo",
OperationName: "UpdateApplication",
}
}
| 194 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws/protocol/restjson"
"github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types"
smithy "github.com/aws/smithy-go"
smithyio "github.com/aws/smithy-go/io"
"github.com/aws/smithy-go/middleware"
"github.com/aws/smithy-go/ptr"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io"
"io/ioutil"
"strings"
)
type awsRestjson1_deserializeOpCreateApplication struct {
}
func (*awsRestjson1_deserializeOpCreateApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateApplication(response, &metadata)
}
output := &CreateApplicationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateApplicationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateApplicationOutput
if *v == nil {
sv = &CreateApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "author":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Author = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "homePageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.HomePageUrl = ptr.String(jtv)
}
case "isVerifiedAuthor":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.IsVerifiedAuthor = jtv
}
case "labels":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil {
return err
}
case "licenseUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.LicenseUrl = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "readmeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ReadmeUrl = ptr.String(jtv)
}
case "spdxLicenseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SpdxLicenseId = ptr.String(jtv)
}
case "verifiedAuthorUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.VerifiedAuthorUrl = ptr.String(jtv)
}
case "version":
if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateApplicationVersion struct {
}
func (*awsRestjson1_deserializeOpCreateApplicationVersion) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateApplicationVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateApplicationVersion(response, &metadata)
}
output := &CreateApplicationVersionOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateApplicationVersionOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateApplicationVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateApplicationVersionOutput(v **CreateApplicationVersionOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateApplicationVersionOutput
if *v == nil {
sv = &CreateApplicationVersionOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "parameterDefinitions":
if err := awsRestjson1_deserializeDocument__listOfParameterDefinition(&sv.ParameterDefinitions, value); err != nil {
return err
}
case "requiredCapabilities":
if err := awsRestjson1_deserializeDocument__listOfCapability(&sv.RequiredCapabilities, value); err != nil {
return err
}
case "resourcesSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.ResourcesSupported = jtv
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "sourceCodeArchiveUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SourceCodeArchiveUrl = ptr.String(jtv)
}
case "sourceCodeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SourceCodeUrl = ptr.String(jtv)
}
case "templateUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateCloudFormationChangeSet struct {
}
func (*awsRestjson1_deserializeOpCreateCloudFormationChangeSet) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateCloudFormationChangeSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateCloudFormationChangeSet(response, &metadata)
}
output := &CreateCloudFormationChangeSetOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateCloudFormationChangeSetOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateCloudFormationChangeSet(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateCloudFormationChangeSetOutput(v **CreateCloudFormationChangeSetOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateCloudFormationChangeSetOutput
if *v == nil {
sv = &CreateCloudFormationChangeSetOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "changeSetId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ChangeSetId = ptr.String(jtv)
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "stackId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.StackId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpCreateCloudFormationTemplate struct {
}
func (*awsRestjson1_deserializeOpCreateCloudFormationTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpCreateCloudFormationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorCreateCloudFormationTemplate(response, &metadata)
}
output := &CreateCloudFormationTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentCreateCloudFormationTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorCreateCloudFormationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentCreateCloudFormationTemplateOutput(v **CreateCloudFormationTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *CreateCloudFormationTemplateOutput
if *v == nil {
sv = &CreateCloudFormationTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "expirationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ExpirationTime = ptr.String(jtv)
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "templateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateId = ptr.String(jtv)
}
case "templateUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpDeleteApplication struct {
}
func (*awsRestjson1_deserializeOpDeleteApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpDeleteApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorDeleteApplication(response, &metadata)
}
output := &DeleteApplicationOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorDeleteApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpGetApplication struct {
}
func (*awsRestjson1_deserializeOpGetApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetApplication(response, &metadata)
}
output := &GetApplicationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetApplicationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetApplicationOutput(v **GetApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetApplicationOutput
if *v == nil {
sv = &GetApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "author":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Author = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "homePageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.HomePageUrl = ptr.String(jtv)
}
case "isVerifiedAuthor":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.IsVerifiedAuthor = jtv
}
case "labels":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil {
return err
}
case "licenseUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.LicenseUrl = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "readmeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ReadmeUrl = ptr.String(jtv)
}
case "spdxLicenseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SpdxLicenseId = ptr.String(jtv)
}
case "verifiedAuthorUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.VerifiedAuthorUrl = ptr.String(jtv)
}
case "version":
if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetApplicationPolicy struct {
}
func (*awsRestjson1_deserializeOpGetApplicationPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetApplicationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetApplicationPolicy(response, &metadata)
}
output := &GetApplicationPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetApplicationPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetApplicationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetApplicationPolicyOutput(v **GetApplicationPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetApplicationPolicyOutput
if *v == nil {
sv = &GetApplicationPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "statements":
if err := awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(&sv.Statements, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpGetCloudFormationTemplate struct {
}
func (*awsRestjson1_deserializeOpGetCloudFormationTemplate) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpGetCloudFormationTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorGetCloudFormationTemplate(response, &metadata)
}
output := &GetCloudFormationTemplateOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentGetCloudFormationTemplateOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorGetCloudFormationTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentGetCloudFormationTemplateOutput(v **GetCloudFormationTemplateOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *GetCloudFormationTemplateOutput
if *v == nil {
sv = &GetCloudFormationTemplateOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "expirationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ExpirationTime = ptr.String(jtv)
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "status":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Status to be of type string, got %T instead", value)
}
sv.Status = types.Status(jtv)
}
case "templateId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateId = ptr.String(jtv)
}
case "templateUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListApplicationDependencies struct {
}
func (*awsRestjson1_deserializeOpListApplicationDependencies) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListApplicationDependencies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListApplicationDependencies(response, &metadata)
}
output := &ListApplicationDependenciesOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListApplicationDependenciesOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListApplicationDependencies(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListApplicationDependenciesOutput(v **ListApplicationDependenciesOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListApplicationDependenciesOutput
if *v == nil {
sv = &ListApplicationDependenciesOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "dependencies":
if err := awsRestjson1_deserializeDocument__listOfApplicationDependencySummary(&sv.Dependencies, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListApplications struct {
}
func (*awsRestjson1_deserializeOpListApplications) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListApplications(response, &metadata)
}
output := &ListApplicationsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListApplicationsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListApplicationsOutput
if *v == nil {
sv = &ListApplicationsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applications":
if err := awsRestjson1_deserializeDocument__listOfApplicationSummary(&sv.Applications, value); err != nil {
return err
}
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpListApplicationVersions struct {
}
func (*awsRestjson1_deserializeOpListApplicationVersions) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpListApplicationVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorListApplicationVersions(response, &metadata)
}
output := &ListApplicationVersionsOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentListApplicationVersionsOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorListApplicationVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentListApplicationVersionsOutput(v **ListApplicationVersionsOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *ListApplicationVersionsOutput
if *v == nil {
sv = &ListApplicationVersionsOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "nextToken":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.NextToken = ptr.String(jtv)
}
case "versions":
if err := awsRestjson1_deserializeDocument__listOfVersionSummary(&sv.Versions, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpPutApplicationPolicy struct {
}
func (*awsRestjson1_deserializeOpPutApplicationPolicy) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpPutApplicationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorPutApplicationPolicy(response, &metadata)
}
output := &PutApplicationPolicyOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentPutApplicationPolicyOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorPutApplicationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentPutApplicationPolicyOutput(v **PutApplicationPolicyOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *PutApplicationPolicyOutput
if *v == nil {
sv = &PutApplicationPolicyOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "statements":
if err := awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(&sv.Statements, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
type awsRestjson1_deserializeOpUnshareApplication struct {
}
func (*awsRestjson1_deserializeOpUnshareApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUnshareApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUnshareApplication(response, &metadata)
}
output := &UnshareApplicationOutput{}
out.Result = output
if _, err = io.Copy(ioutil.Discard, response.Body); err != nil {
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to discard response body, %w", err),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUnshareApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
type awsRestjson1_deserializeOpUpdateApplication struct {
}
func (*awsRestjson1_deserializeOpUpdateApplication) ID() string {
return "OperationDeserializer"
}
func (m *awsRestjson1_deserializeOpUpdateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) (
out middleware.DeserializeOutput, metadata middleware.Metadata, err error,
) {
out, metadata, err = next.HandleDeserialize(ctx, in)
if err != nil {
return out, metadata, err
}
response, ok := out.RawResponse.(*smithyhttp.Response)
if !ok {
return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)}
}
if response.StatusCode < 200 || response.StatusCode >= 300 {
return out, metadata, awsRestjson1_deserializeOpErrorUpdateApplication(response, &metadata)
}
output := &UpdateApplicationOutput{}
out.Result = output
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(response.Body, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return out, metadata, err
}
err = awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
return out, metadata, &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err),
Snapshot: snapshot.Bytes(),
}
}
return out, metadata, err
}
func awsRestjson1_deserializeOpErrorUpdateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error {
var errorBuffer bytes.Buffer
if _, err := io.Copy(&errorBuffer, response.Body); err != nil {
return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)}
}
errorBody := bytes.NewReader(errorBuffer.Bytes())
errorCode := "UnknownError"
errorMessage := errorCode
headerCode := response.Header.Get("X-Amzn-ErrorType")
if len(headerCode) != 0 {
errorCode = restjson.SanitizeErrorCode(headerCode)
}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
jsonCode, message, err := restjson.GetErrorInfo(decoder)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
if len(headerCode) == 0 && len(jsonCode) != 0 {
errorCode = restjson.SanitizeErrorCode(jsonCode)
}
if len(message) != 0 {
errorMessage = message
}
switch {
case strings.EqualFold("BadRequestException", errorCode):
return awsRestjson1_deserializeErrorBadRequestException(response, errorBody)
case strings.EqualFold("ConflictException", errorCode):
return awsRestjson1_deserializeErrorConflictException(response, errorBody)
case strings.EqualFold("ForbiddenException", errorCode):
return awsRestjson1_deserializeErrorForbiddenException(response, errorBody)
case strings.EqualFold("InternalServerErrorException", errorCode):
return awsRestjson1_deserializeErrorInternalServerErrorException(response, errorBody)
case strings.EqualFold("NotFoundException", errorCode):
return awsRestjson1_deserializeErrorNotFoundException(response, errorBody)
case strings.EqualFold("TooManyRequestsException", errorCode):
return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody)
default:
genericError := &smithy.GenericAPIError{
Code: errorCode,
Message: errorMessage,
}
return genericError
}
}
func awsRestjson1_deserializeOpDocumentUpdateApplicationOutput(v **UpdateApplicationOutput, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *UpdateApplicationOutput
if *v == nil {
sv = &UpdateApplicationOutput{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "author":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Author = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "homePageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.HomePageUrl = ptr.String(jtv)
}
case "isVerifiedAuthor":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.IsVerifiedAuthor = jtv
}
case "labels":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil {
return err
}
case "licenseUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.LicenseUrl = ptr.String(jtv)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "readmeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ReadmeUrl = ptr.String(jtv)
}
case "spdxLicenseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SpdxLicenseId = ptr.String(jtv)
}
case "verifiedAuthorUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.VerifiedAuthorUrl = ptr.String(jtv)
}
case "version":
if err := awsRestjson1_deserializeDocumentVersion(&sv.Version, value); err != nil {
return err
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.BadRequestException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ConflictException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentConflictException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.ForbiddenException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorInternalServerErrorException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.InternalServerErrorException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentInternalServerErrorException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.NotFoundException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error {
output := &types.TooManyRequestsException{}
var buff [1024]byte
ringBuffer := smithyio.NewRingBuffer(buff[:])
body := io.TeeReader(errorBody, ringBuffer)
decoder := json.NewDecoder(body)
decoder.UseNumber()
var shape interface{}
if err := decoder.Decode(&shape); err != nil && err != io.EOF {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
err := awsRestjson1_deserializeDocumentTooManyRequestsException(&output, shape)
if err != nil {
var snapshot bytes.Buffer
io.Copy(&snapshot, ringBuffer)
err = &smithy.DeserializationError{
Err: fmt.Errorf("failed to decode response body, %w", err),
Snapshot: snapshot.Bytes(),
}
return err
}
errorBody.Seek(0, io.SeekStart)
return output
}
func awsRestjson1_deserializeDocument__listOf__string(v *[]string, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []string
if *v == nil {
cv = []string{}
} else {
cv = *v
}
for _, value := range shape {
var col string
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
col = jtv
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfApplicationDependencySummary(v *[]types.ApplicationDependencySummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ApplicationDependencySummary
if *v == nil {
cv = []types.ApplicationDependencySummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ApplicationDependencySummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentApplicationDependencySummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfApplicationPolicyStatement(v *[]types.ApplicationPolicyStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ApplicationPolicyStatement
if *v == nil {
cv = []types.ApplicationPolicyStatement{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ApplicationPolicyStatement
destAddr := &col
if err := awsRestjson1_deserializeDocumentApplicationPolicyStatement(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfApplicationSummary(v *[]types.ApplicationSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ApplicationSummary
if *v == nil {
cv = []types.ApplicationSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ApplicationSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfCapability(v *[]types.Capability, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.Capability
if *v == nil {
cv = []types.Capability{}
} else {
cv = *v
}
for _, value := range shape {
var col types.Capability
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected Capability to be of type string, got %T instead", value)
}
col = types.Capability(jtv)
}
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfParameterDefinition(v *[]types.ParameterDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.ParameterDefinition
if *v == nil {
cv = []types.ParameterDefinition{}
} else {
cv = *v
}
for _, value := range shape {
var col types.ParameterDefinition
destAddr := &col
if err := awsRestjson1_deserializeDocumentParameterDefinition(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocument__listOfVersionSummary(v *[]types.VersionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.([]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var cv []types.VersionSummary
if *v == nil {
cv = []types.VersionSummary{}
} else {
cv = *v
}
for _, value := range shape {
var col types.VersionSummary
destAddr := &col
if err := awsRestjson1_deserializeDocumentVersionSummary(&destAddr, value); err != nil {
return err
}
col = *destAddr
cv = append(cv, col)
}
*v = cv
return nil
}
func awsRestjson1_deserializeDocumentApplicationDependencySummary(v **types.ApplicationDependencySummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationDependencySummary
if *v == nil {
sv = &types.ApplicationDependencySummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentApplicationPolicyStatement(v **types.ApplicationPolicyStatement, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationPolicyStatement
if *v == nil {
sv = &types.ApplicationPolicyStatement{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "actions":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Actions, value); err != nil {
return err
}
case "principalOrgIDs":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.PrincipalOrgIDs, value); err != nil {
return err
}
case "principals":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Principals, value); err != nil {
return err
}
case "statementId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.StatementId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ApplicationSummary
if *v == nil {
sv = &types.ApplicationSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "author":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Author = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "homePageUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.HomePageUrl = ptr.String(jtv)
}
case "labels":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.Labels, value); err != nil {
return err
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "spdxLicenseId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SpdxLicenseId = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.BadRequestException
if *v == nil {
sv = &types.BadRequestException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ConflictException
if *v == nil {
sv = &types.ConflictException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ForbiddenException
if *v == nil {
sv = &types.ForbiddenException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentInternalServerErrorException(v **types.InternalServerErrorException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.InternalServerErrorException
if *v == nil {
sv = &types.InternalServerErrorException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.NotFoundException
if *v == nil {
sv = &types.NotFoundException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentParameterDefinition(v **types.ParameterDefinition, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.ParameterDefinition
if *v == nil {
sv = &types.ParameterDefinition{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "allowedPattern":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.AllowedPattern = ptr.String(jtv)
}
case "allowedValues":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.AllowedValues, value); err != nil {
return err
}
case "constraintDescription":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ConstraintDescription = ptr.String(jtv)
}
case "defaultValue":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.DefaultValue = ptr.String(jtv)
}
case "description":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Description = ptr.String(jtv)
}
case "maxLength":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected __integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxLength = int32(i64)
}
case "maxValue":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected __integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MaxValue = int32(i64)
}
case "minLength":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected __integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MinLength = int32(i64)
}
case "minValue":
if value != nil {
jtv, ok := value.(json.Number)
if !ok {
return fmt.Errorf("expected __integer to be json.Number, got %T instead", value)
}
i64, err := jtv.Int64()
if err != nil {
return err
}
sv.MinValue = int32(i64)
}
case "name":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Name = ptr.String(jtv)
}
case "noEcho":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.NoEcho = jtv
}
case "referencedByResources":
if err := awsRestjson1_deserializeDocument__listOf__string(&sv.ReferencedByResources, value); err != nil {
return err
}
case "type":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Type = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.TooManyRequestsException
if *v == nil {
sv = &types.TooManyRequestsException{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "errorCode":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ErrorCode_ = ptr.String(jtv)
}
case "message":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.Message = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVersion(v **types.Version, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.Version
if *v == nil {
sv = &types.Version{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "parameterDefinitions":
if err := awsRestjson1_deserializeDocument__listOfParameterDefinition(&sv.ParameterDefinitions, value); err != nil {
return err
}
case "requiredCapabilities":
if err := awsRestjson1_deserializeDocument__listOfCapability(&sv.RequiredCapabilities, value); err != nil {
return err
}
case "resourcesSupported":
if value != nil {
jtv, ok := value.(bool)
if !ok {
return fmt.Errorf("expected __boolean to be of type *bool, got %T instead", value)
}
sv.ResourcesSupported = jtv
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "sourceCodeArchiveUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SourceCodeArchiveUrl = ptr.String(jtv)
}
case "sourceCodeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SourceCodeUrl = ptr.String(jtv)
}
case "templateUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.TemplateUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
func awsRestjson1_deserializeDocumentVersionSummary(v **types.VersionSummary, value interface{}) error {
if v == nil {
return fmt.Errorf("unexpected nil of type %T", v)
}
if value == nil {
return nil
}
shape, ok := value.(map[string]interface{})
if !ok {
return fmt.Errorf("unexpected JSON type %v", value)
}
var sv *types.VersionSummary
if *v == nil {
sv = &types.VersionSummary{}
} else {
sv = *v
}
for key, value := range shape {
switch key {
case "applicationId":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.ApplicationId = ptr.String(jtv)
}
case "creationTime":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.CreationTime = ptr.String(jtv)
}
case "semanticVersion":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SemanticVersion = ptr.String(jtv)
}
case "sourceCodeUrl":
if value != nil {
jtv, ok := value.(string)
if !ok {
return fmt.Errorf("expected __string to be of type string, got %T instead", value)
}
sv.SourceCodeUrl = ptr.String(jtv)
}
default:
_, _ = key, value
}
}
*v = sv
return nil
}
| 3,967 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
// Package serverlessapplicationrepository provides the API client, operations,
// and parameter types for AWSServerlessApplicationRepository.
//
// The AWS Serverless Application Repository makes it easy for developers and
// enterprises to quickly find and deploy serverless applications in the AWS Cloud.
// For more information about serverless applications, see Serverless Computing and
// Applications on the AWS website.The AWS Serverless Application Repository is
// deeply integrated with the AWS Lambda console, so that developers of all levels
// can get started with serverless computing without needing to learn anything new.
// You can use category keywords to browse for applications such as web and mobile
// backends, data processing applications, or chatbots. You can also search for
// applications by name, publisher, or event source. To use an application, you
// simply choose it, configure any required fields, and deploy it with a few
// clicks. You can also easily publish applications, sharing them publicly with the
// community at large, or privately within your team or across your organization.
// To publish a serverless application (or app), you can use the AWS Management
// Console, AWS Command Line Interface (AWS CLI), or AWS SDKs to upload the code.
// Along with the code, you upload a simple manifest file, also known as the AWS
// Serverless Application Model (AWS SAM) template. For more information about AWS
// SAM, see AWS Serverless Application Model (AWS SAM) on the AWS Labs GitHub
// repository.The AWS Serverless Application Repository Developer Guide contains
// more information about the two developer experiences available:
// - Consuming Applications – Browse for applications and view information about
// them, including source code and readme files. Also install, configure, and
// deploy applications of your choosing. Publishing Applications – Configure and
// upload applications to make them available to other developers, and publish new
// versions of applications.
package serverlessapplicationrepository
| 31 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
internalendpoints "github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/internal/endpoints"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net/url"
"strings"
)
// EndpointResolverOptions is the service endpoint resolver options
type EndpointResolverOptions = internalendpoints.Options
// EndpointResolver interface for resolving service endpoints.
type EndpointResolver interface {
ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error)
}
var _ EndpointResolver = &internalendpoints.Resolver{}
// NewDefaultEndpointResolver constructs a new service endpoint resolver
func NewDefaultEndpointResolver() *internalendpoints.Resolver {
return internalendpoints.New()
}
// EndpointResolverFunc is a helper utility that wraps a function so it satisfies
// the EndpointResolver interface. This is useful when you want to add additional
// endpoint resolving logic, or stub out specific endpoints with custom values.
type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error)
func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
return fn(region, options)
}
func resolveDefaultEndpointConfiguration(o *Options) {
if o.EndpointResolver != nil {
return
}
o.EndpointResolver = NewDefaultEndpointResolver()
}
// EndpointResolverFromURL returns an EndpointResolver configured using the
// provided endpoint url. By default, the resolved endpoint resolver uses the
// client region as signing region, and the endpoint source is set to
// EndpointSourceCustom.You can provide functional options to configure endpoint
// values for the resolved endpoint.
func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver {
e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom}
for _, fn := range optFns {
fn(&e)
}
return EndpointResolverFunc(
func(region string, options EndpointResolverOptions) (aws.Endpoint, error) {
if len(e.SigningRegion) == 0 {
e.SigningRegion = region
}
return e, nil
},
)
}
type ResolveEndpoint struct {
Resolver EndpointResolver
Options EndpointResolverOptions
}
func (*ResolveEndpoint) ID() string {
return "ResolveEndpoint"
}
func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
req, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, fmt.Errorf("unknown transport type %T", in.Request)
}
if m.Resolver == nil {
return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil")
}
eo := m.Options
eo.Logger = middleware.GetLogger(ctx)
var endpoint aws.Endpoint
endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo)
if err != nil {
return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err)
}
req.URL, err = url.Parse(endpoint.URL)
if err != nil {
return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err)
}
if len(awsmiddleware.GetSigningName(ctx)) == 0 {
signingName := endpoint.SigningName
if len(signingName) == 0 {
signingName = "serverlessrepo"
}
ctx = awsmiddleware.SetSigningName(ctx, signingName)
}
ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source)
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 {
return stack.Serialize.Insert(&ResolveEndpoint{
Resolver: o.EndpointResolver,
Options: o.EndpointOptions,
}, "OperationSerializer", middleware.Before)
}
func removeResolveEndpointMiddleware(stack *middleware.Stack) error {
_, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID())
return err
}
type wrappedEndpointResolver struct {
awsResolver aws.EndpointResolverWithOptions
resolver EndpointResolver
}
func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) {
if w.awsResolver == nil {
goto fallback
}
endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options)
if err == nil {
return endpoint, nil
}
if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) {
return endpoint, err
}
fallback:
if w.resolver == nil {
return endpoint, fmt.Errorf("default endpoint resolver provided was nil")
}
return w.resolver.ResolveEndpoint(region, options)
}
type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error)
func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) {
return a(service, region)
}
var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil)
// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver.
// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided
// fallbackResolver for resolution.
//
// fallbackResolver must not be nil
func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver {
var resolver aws.EndpointResolverWithOptions
if awsResolverWithOptions != nil {
resolver = awsResolverWithOptions
} else if awsResolver != nil {
resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint)
}
return &wrappedEndpointResolver{
awsResolver: resolver,
resolver: fallbackResolver,
}
}
func finalizeClientEndpointResolverOptions(options *Options) {
options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage()
if len(options.EndpointOptions.ResolvedRegion) == 0 {
const fipsInfix = "-fips-"
const fipsPrefix = "fips-"
const fipsSuffix = "-fips"
if strings.Contains(options.Region, fipsInfix) ||
strings.Contains(options.Region, fipsPrefix) ||
strings.Contains(options.Region, fipsSuffix) {
options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(
options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "")
options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled
}
}
}
| 201 |
aws-sdk-go-v2 | aws | Go | // Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT.
package serverlessapplicationrepository
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.12.13"
| 7 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
| 4 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/encoding/httpbinding"
smithyjson "github.com/aws/smithy-go/encoding/json"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
type awsRestjson1_serializeOpCreateApplication struct {
}
func (*awsRestjson1_serializeOpCreateApplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Author != nil {
ok := object.Key("author")
ok.String(*v.Author)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.HomePageUrl != nil {
ok := object.Key("homePageUrl")
ok.String(*v.HomePageUrl)
}
if v.Labels != nil {
ok := object.Key("labels")
if err := awsRestjson1_serializeDocument__listOf__string(v.Labels, ok); err != nil {
return err
}
}
if v.LicenseBody != nil {
ok := object.Key("licenseBody")
ok.String(*v.LicenseBody)
}
if v.LicenseUrl != nil {
ok := object.Key("licenseUrl")
ok.String(*v.LicenseUrl)
}
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.ReadmeBody != nil {
ok := object.Key("readmeBody")
ok.String(*v.ReadmeBody)
}
if v.ReadmeUrl != nil {
ok := object.Key("readmeUrl")
ok.String(*v.ReadmeUrl)
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.SourceCodeArchiveUrl != nil {
ok := object.Key("sourceCodeArchiveUrl")
ok.String(*v.SourceCodeArchiveUrl)
}
if v.SourceCodeUrl != nil {
ok := object.Key("sourceCodeUrl")
ok.String(*v.SourceCodeUrl)
}
if v.SpdxLicenseId != nil {
ok := object.Key("spdxLicenseId")
ok.String(*v.SpdxLicenseId)
}
if v.TemplateBody != nil {
ok := object.Key("templateBody")
ok.String(*v.TemplateBody)
}
if v.TemplateUrl != nil {
ok := object.Key("templateUrl")
ok.String(*v.TemplateUrl)
}
return nil
}
type awsRestjson1_serializeOpCreateApplicationVersion struct {
}
func (*awsRestjson1_serializeOpCreateApplicationVersion) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateApplicationVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateApplicationVersionInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/versions/{SemanticVersion}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateApplicationVersionInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateApplicationVersionInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateApplicationVersionInput(v *CreateApplicationVersionInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
if v.SemanticVersion == nil || len(*v.SemanticVersion) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member SemanticVersion must not be empty")}
}
if v.SemanticVersion != nil {
if err := encoder.SetURI("SemanticVersion").String(*v.SemanticVersion); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateApplicationVersionInput(v *CreateApplicationVersionInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SourceCodeArchiveUrl != nil {
ok := object.Key("sourceCodeArchiveUrl")
ok.String(*v.SourceCodeArchiveUrl)
}
if v.SourceCodeUrl != nil {
ok := object.Key("sourceCodeUrl")
ok.String(*v.SourceCodeUrl)
}
if v.TemplateBody != nil {
ok := object.Key("templateBody")
ok.String(*v.TemplateBody)
}
if v.TemplateUrl != nil {
ok := object.Key("templateUrl")
ok.String(*v.TemplateUrl)
}
return nil
}
type awsRestjson1_serializeOpCreateCloudFormationChangeSet struct {
}
func (*awsRestjson1_serializeOpCreateCloudFormationChangeSet) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateCloudFormationChangeSet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCloudFormationChangeSetInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/changesets")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateCloudFormationChangeSetInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateCloudFormationChangeSetInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateCloudFormationChangeSetInput(v *CreateCloudFormationChangeSetInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateCloudFormationChangeSetInput(v *CreateCloudFormationChangeSetInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Capabilities != nil {
ok := object.Key("capabilities")
if err := awsRestjson1_serializeDocument__listOf__string(v.Capabilities, ok); err != nil {
return err
}
}
if v.ChangeSetName != nil {
ok := object.Key("changeSetName")
ok.String(*v.ChangeSetName)
}
if v.ClientToken != nil {
ok := object.Key("clientToken")
ok.String(*v.ClientToken)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.NotificationArns != nil {
ok := object.Key("notificationArns")
if err := awsRestjson1_serializeDocument__listOf__string(v.NotificationArns, ok); err != nil {
return err
}
}
if v.ParameterOverrides != nil {
ok := object.Key("parameterOverrides")
if err := awsRestjson1_serializeDocument__listOfParameterValue(v.ParameterOverrides, ok); err != nil {
return err
}
}
if v.ResourceTypes != nil {
ok := object.Key("resourceTypes")
if err := awsRestjson1_serializeDocument__listOf__string(v.ResourceTypes, ok); err != nil {
return err
}
}
if v.RollbackConfiguration != nil {
ok := object.Key("rollbackConfiguration")
if err := awsRestjson1_serializeDocumentRollbackConfiguration(v.RollbackConfiguration, ok); err != nil {
return err
}
}
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
if v.StackName != nil {
ok := object.Key("stackName")
ok.String(*v.StackName)
}
if v.Tags != nil {
ok := object.Key("tags")
if err := awsRestjson1_serializeDocument__listOfTag(v.Tags, ok); err != nil {
return err
}
}
if v.TemplateId != nil {
ok := object.Key("templateId")
ok.String(*v.TemplateId)
}
return nil
}
type awsRestjson1_serializeOpCreateCloudFormationTemplate struct {
}
func (*awsRestjson1_serializeOpCreateCloudFormationTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpCreateCloudFormationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*CreateCloudFormationTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/templates")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsCreateCloudFormationTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentCreateCloudFormationTemplateInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsCreateCloudFormationTemplateInput(v *CreateCloudFormationTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentCreateCloudFormationTemplateInput(v *CreateCloudFormationTemplateInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.SemanticVersion != nil {
ok := object.Key("semanticVersion")
ok.String(*v.SemanticVersion)
}
return nil
}
type awsRestjson1_serializeOpDeleteApplication struct {
}
func (*awsRestjson1_serializeOpDeleteApplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*DeleteApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "DELETE"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetApplication struct {
}
func (*awsRestjson1_serializeOpGetApplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetApplicationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetApplicationInput(v *GetApplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
if v.SemanticVersion != nil {
encoder.SetQuery("semanticVersion").String(*v.SemanticVersion)
}
return nil
}
type awsRestjson1_serializeOpGetApplicationPolicy struct {
}
func (*awsRestjson1_serializeOpGetApplicationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetApplicationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetApplicationPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetApplicationPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetApplicationPolicyInput(v *GetApplicationPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpGetCloudFormationTemplate struct {
}
func (*awsRestjson1_serializeOpGetCloudFormationTemplate) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpGetCloudFormationTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*GetCloudFormationTemplateInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/templates/{TemplateId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsGetCloudFormationTemplateInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsGetCloudFormationTemplateInput(v *GetCloudFormationTemplateInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
if v.TemplateId == nil || len(*v.TemplateId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateId must not be empty")}
}
if v.TemplateId != nil {
if err := encoder.SetURI("TemplateId").String(*v.TemplateId); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpListApplicationDependencies struct {
}
func (*awsRestjson1_serializeOpListApplicationDependencies) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListApplicationDependencies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListApplicationDependenciesInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/dependencies")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListApplicationDependenciesInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListApplicationDependenciesInput(v *ListApplicationDependenciesInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
if v.MaxItems != 0 {
encoder.SetQuery("maxItems").Integer(v.MaxItems)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
if v.SemanticVersion != nil {
encoder.SetQuery("semanticVersion").String(*v.SemanticVersion)
}
return nil
}
type awsRestjson1_serializeOpListApplications struct {
}
func (*awsRestjson1_serializeOpListApplications) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListApplicationsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListApplicationsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.MaxItems != 0 {
encoder.SetQuery("maxItems").Integer(v.MaxItems)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpListApplicationVersions struct {
}
func (*awsRestjson1_serializeOpListApplicationVersions) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpListApplicationVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*ListApplicationVersionsInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/versions")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "GET"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsListApplicationVersionsInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsListApplicationVersionsInput(v *ListApplicationVersionsInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
if v.MaxItems != 0 {
encoder.SetQuery("maxItems").Integer(v.MaxItems)
}
if v.NextToken != nil {
encoder.SetQuery("nextToken").String(*v.NextToken)
}
return nil
}
type awsRestjson1_serializeOpPutApplicationPolicy struct {
}
func (*awsRestjson1_serializeOpPutApplicationPolicy) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpPutApplicationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*PutApplicationPolicyInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/policy")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PUT"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsPutApplicationPolicyInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentPutApplicationPolicyInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsPutApplicationPolicyInput(v *PutApplicationPolicyInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentPutApplicationPolicyInput(v *PutApplicationPolicyInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Statements != nil {
ok := object.Key("statements")
if err := awsRestjson1_serializeDocument__listOfApplicationPolicyStatement(v.Statements, ok); err != nil {
return err
}
}
return nil
}
type awsRestjson1_serializeOpUnshareApplication struct {
}
func (*awsRestjson1_serializeOpUnshareApplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUnshareApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UnshareApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}/unshare")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "POST"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUnshareApplicationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUnshareApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUnshareApplicationInput(v *UnshareApplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUnshareApplicationInput(v *UnshareApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.OrganizationId != nil {
ok := object.Key("organizationId")
ok.String(*v.OrganizationId)
}
return nil
}
type awsRestjson1_serializeOpUpdateApplication struct {
}
func (*awsRestjson1_serializeOpUpdateApplication) ID() string {
return "OperationSerializer"
}
func (m *awsRestjson1_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) (
out middleware.SerializeOutput, metadata middleware.Metadata, err error,
) {
request, ok := in.Request.(*smithyhttp.Request)
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)}
}
input, ok := in.Parameters.(*UpdateApplicationInput)
_ = input
if !ok {
return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)}
}
opPath, opQuery := httpbinding.SplitURI("/applications/{ApplicationId}")
request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath)
request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery)
request.Method = "PATCH"
restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header)
if err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if err := awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
restEncoder.SetHeader("Content-Type").String("application/json")
jsonEncoder := smithyjson.NewEncoder()
if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(input, jsonEncoder.Value); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
if request.Request, err = restEncoder.Encode(request.Request); err != nil {
return out, metadata, &smithy.SerializationError{Err: err}
}
in.Request = request
return next.HandleSerialize(ctx, in)
}
func awsRestjson1_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error {
if v == nil {
return fmt.Errorf("unsupported serialization of nil %T", v)
}
if v.ApplicationId == nil || len(*v.ApplicationId) == 0 {
return &smithy.SerializationError{Err: fmt.Errorf("input member ApplicationId must not be empty")}
}
if v.ApplicationId != nil {
if err := encoder.SetURI("ApplicationId").String(*v.ApplicationId); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Author != nil {
ok := object.Key("author")
ok.String(*v.Author)
}
if v.Description != nil {
ok := object.Key("description")
ok.String(*v.Description)
}
if v.HomePageUrl != nil {
ok := object.Key("homePageUrl")
ok.String(*v.HomePageUrl)
}
if v.Labels != nil {
ok := object.Key("labels")
if err := awsRestjson1_serializeDocument__listOf__string(v.Labels, ok); err != nil {
return err
}
}
if v.ReadmeBody != nil {
ok := object.Key("readmeBody")
ok.String(*v.ReadmeBody)
}
if v.ReadmeUrl != nil {
ok := object.Key("readmeUrl")
ok.String(*v.ReadmeUrl)
}
return nil
}
func awsRestjson1_serializeDocument__listOf__string(v []string, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
av.String(v[i])
}
return nil
}
func awsRestjson1_serializeDocument__listOfApplicationPolicyStatement(v []types.ApplicationPolicyStatement, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentApplicationPolicyStatement(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOfParameterValue(v []types.ParameterValue, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentParameterValue(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOfRollbackTrigger(v []types.RollbackTrigger, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentRollbackTrigger(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocument__listOfTag(v []types.Tag, value smithyjson.Value) error {
array := value.Array()
defer array.Close()
for i := range v {
av := array.Value()
if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentApplicationPolicyStatement(v *types.ApplicationPolicyStatement, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Actions != nil {
ok := object.Key("actions")
if err := awsRestjson1_serializeDocument__listOf__string(v.Actions, ok); err != nil {
return err
}
}
if v.PrincipalOrgIDs != nil {
ok := object.Key("principalOrgIDs")
if err := awsRestjson1_serializeDocument__listOf__string(v.PrincipalOrgIDs, ok); err != nil {
return err
}
}
if v.Principals != nil {
ok := object.Key("principals")
if err := awsRestjson1_serializeDocument__listOf__string(v.Principals, ok); err != nil {
return err
}
}
if v.StatementId != nil {
ok := object.Key("statementId")
ok.String(*v.StatementId)
}
return nil
}
func awsRestjson1_serializeDocumentParameterValue(v *types.ParameterValue, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Name != nil {
ok := object.Key("name")
ok.String(*v.Name)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
func awsRestjson1_serializeDocumentRollbackConfiguration(v *types.RollbackConfiguration, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.MonitoringTimeInMinutes != 0 {
ok := object.Key("monitoringTimeInMinutes")
ok.Integer(v.MonitoringTimeInMinutes)
}
if v.RollbackTriggers != nil {
ok := object.Key("rollbackTriggers")
if err := awsRestjson1_serializeDocument__listOfRollbackTrigger(v.RollbackTriggers, ok); err != nil {
return err
}
}
return nil
}
func awsRestjson1_serializeDocumentRollbackTrigger(v *types.RollbackTrigger, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Arn != nil {
ok := object.Key("arn")
ok.String(*v.Arn)
}
if v.Type != nil {
ok := object.Key("type")
ok.String(*v.Type)
}
return nil
}
func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error {
object := value.Object()
defer object.Close()
if v.Key != nil {
ok := object.Key("key")
ok.String(*v.Key)
}
if v.Value != nil {
ok := object.Key("value")
ok.String(*v.Value)
}
return nil
}
| 1,366 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package serverlessapplicationrepository
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/serverlessapplicationrepository/types"
smithy "github.com/aws/smithy-go"
"github.com/aws/smithy-go/middleware"
)
type validateOpCreateApplication struct {
}
func (*validateOpCreateApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateApplicationVersion struct {
}
func (*validateOpCreateApplicationVersion) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateApplicationVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateApplicationVersionInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateApplicationVersionInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCloudFormationChangeSet struct {
}
func (*validateOpCreateCloudFormationChangeSet) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCloudFormationChangeSet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCloudFormationChangeSetInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCloudFormationChangeSetInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpCreateCloudFormationTemplate struct {
}
func (*validateOpCreateCloudFormationTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpCreateCloudFormationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*CreateCloudFormationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpCreateCloudFormationTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpDeleteApplication struct {
}
func (*validateOpDeleteApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*DeleteApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpDeleteApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetApplication struct {
}
func (*validateOpGetApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetApplicationPolicy struct {
}
func (*validateOpGetApplicationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetApplicationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetApplicationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetApplicationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpGetCloudFormationTemplate struct {
}
func (*validateOpGetCloudFormationTemplate) ID() string {
return "OperationInputValidation"
}
func (m *validateOpGetCloudFormationTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*GetCloudFormationTemplateInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpGetCloudFormationTemplateInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListApplicationDependencies struct {
}
func (*validateOpListApplicationDependencies) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListApplicationDependencies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListApplicationDependenciesInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListApplicationDependenciesInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpListApplicationVersions struct {
}
func (*validateOpListApplicationVersions) ID() string {
return "OperationInputValidation"
}
func (m *validateOpListApplicationVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*ListApplicationVersionsInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpListApplicationVersionsInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpPutApplicationPolicy struct {
}
func (*validateOpPutApplicationPolicy) ID() string {
return "OperationInputValidation"
}
func (m *validateOpPutApplicationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*PutApplicationPolicyInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpPutApplicationPolicyInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUnshareApplication struct {
}
func (*validateOpUnshareApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUnshareApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UnshareApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUnshareApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
type validateOpUpdateApplication struct {
}
func (*validateOpUpdateApplication) ID() string {
return "OperationInputValidation"
}
func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
input, ok := in.Parameters.(*UpdateApplicationInput)
if !ok {
return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters)
}
if err := validateOpUpdateApplicationInput(input); err != nil {
return out, metadata, err
}
return next.HandleInitialize(ctx, in)
}
func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After)
}
func addOpCreateApplicationVersionValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateApplicationVersion{}, middleware.After)
}
func addOpCreateCloudFormationChangeSetValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCloudFormationChangeSet{}, middleware.After)
}
func addOpCreateCloudFormationTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpCreateCloudFormationTemplate{}, middleware.After)
}
func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After)
}
func addOpGetApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetApplication{}, middleware.After)
}
func addOpGetApplicationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetApplicationPolicy{}, middleware.After)
}
func addOpGetCloudFormationTemplateValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpGetCloudFormationTemplate{}, middleware.After)
}
func addOpListApplicationDependenciesValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListApplicationDependencies{}, middleware.After)
}
func addOpListApplicationVersionsValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpListApplicationVersions{}, middleware.After)
}
func addOpPutApplicationPolicyValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpPutApplicationPolicy{}, middleware.After)
}
func addOpUnshareApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUnshareApplication{}, middleware.After)
}
func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error {
return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After)
}
func validate__listOfApplicationPolicyStatement(v []types.ApplicationPolicyStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListOfApplicationPolicyStatement"}
for i := range v {
if err := validateApplicationPolicyStatement(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validate__listOfParameterValue(v []types.ParameterValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListOfParameterValue"}
for i := range v {
if err := validateParameterValue(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validate__listOfRollbackTrigger(v []types.RollbackTrigger) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListOfRollbackTrigger"}
for i := range v {
if err := validateRollbackTrigger(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validate__listOfTag(v []types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListOfTag"}
for i := range v {
if err := validateTag(&v[i]); err != nil {
invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateApplicationPolicyStatement(v *types.ApplicationPolicyStatement) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ApplicationPolicyStatement"}
if v.Actions == nil {
invalidParams.Add(smithy.NewErrParamRequired("Actions"))
}
if v.Principals == nil {
invalidParams.Add(smithy.NewErrParamRequired("Principals"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateParameterValue(v *types.ParameterValue) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ParameterValue"}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRollbackConfiguration(v *types.RollbackConfiguration) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RollbackConfiguration"}
if v.RollbackTriggers != nil {
if err := validate__listOfRollbackTrigger(v.RollbackTriggers); err != nil {
invalidParams.AddNested("RollbackTriggers", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateRollbackTrigger(v *types.RollbackTrigger) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "RollbackTrigger"}
if v.Arn == nil {
invalidParams.Add(smithy.NewErrParamRequired("Arn"))
}
if v.Type == nil {
invalidParams.Add(smithy.NewErrParamRequired("Type"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateTag(v *types.Tag) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "Tag"}
if v.Key == nil {
invalidParams.Add(smithy.NewErrParamRequired("Key"))
}
if v.Value == nil {
invalidParams.Add(smithy.NewErrParamRequired("Value"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateApplicationInput(v *CreateApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"}
if v.Author == nil {
invalidParams.Add(smithy.NewErrParamRequired("Author"))
}
if v.Description == nil {
invalidParams.Add(smithy.NewErrParamRequired("Description"))
}
if v.Name == nil {
invalidParams.Add(smithy.NewErrParamRequired("Name"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateApplicationVersionInput(v *CreateApplicationVersionInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationVersionInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if v.SemanticVersion == nil {
invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCloudFormationChangeSetInput(v *CreateCloudFormationChangeSetInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCloudFormationChangeSetInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if v.ParameterOverrides != nil {
if err := validate__listOfParameterValue(v.ParameterOverrides); err != nil {
invalidParams.AddNested("ParameterOverrides", err.(smithy.InvalidParamsError))
}
}
if v.RollbackConfiguration != nil {
if err := validateRollbackConfiguration(v.RollbackConfiguration); err != nil {
invalidParams.AddNested("RollbackConfiguration", err.(smithy.InvalidParamsError))
}
}
if v.StackName == nil {
invalidParams.Add(smithy.NewErrParamRequired("StackName"))
}
if v.Tags != nil {
if err := validate__listOfTag(v.Tags); err != nil {
invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpCreateCloudFormationTemplateInput(v *CreateCloudFormationTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "CreateCloudFormationTemplateInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetApplicationInput(v *GetApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetApplicationInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetApplicationPolicyInput(v *GetApplicationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetApplicationPolicyInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpGetCloudFormationTemplateInput(v *GetCloudFormationTemplateInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "GetCloudFormationTemplateInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if v.TemplateId == nil {
invalidParams.Add(smithy.NewErrParamRequired("TemplateId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListApplicationDependenciesInput(v *ListApplicationDependenciesInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListApplicationDependenciesInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpListApplicationVersionsInput(v *ListApplicationVersionsInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "ListApplicationVersionsInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpPutApplicationPolicyInput(v *PutApplicationPolicyInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "PutApplicationPolicyInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if v.Statements == nil {
invalidParams.Add(smithy.NewErrParamRequired("Statements"))
} else if v.Statements != nil {
if err := validate__listOfApplicationPolicyStatement(v.Statements); err != nil {
invalidParams.AddNested("Statements", err.(smithy.InvalidParamsError))
}
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUnshareApplicationInput(v *UnshareApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UnshareApplicationInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if v.OrganizationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("OrganizationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error {
if v == nil {
return nil
}
invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"}
if v.ApplicationId == nil {
invalidParams.Add(smithy.NewErrParamRequired("ApplicationId"))
}
if invalidParams.Len() > 0 {
return invalidParams
} else {
return nil
}
}
| 716 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"github.com/aws/aws-sdk-go-v2/aws"
endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"
"github.com/aws/smithy-go/logging"
"regexp"
)
// Options is the endpoint resolver configuration options
type Options struct {
// Logger is a logging implementation that log events should be sent to.
Logger logging.Logger
// LogDeprecated indicates that deprecated endpoints should be logged to the
// provided logger.
LogDeprecated bool
// ResolvedRegion is used to override the region to be resolved, rather then the
// using the value passed to the ResolveEndpoint method. This value is used by the
// SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative
// name. You must not set this value directly in your application.
ResolvedRegion string
// DisableHTTPS informs the resolver to return an endpoint that does not use the
// HTTPS scheme.
DisableHTTPS bool
// UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint.
UseDualStackEndpoint aws.DualStackEndpointState
// UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint.
UseFIPSEndpoint aws.FIPSEndpointState
}
func (o Options) GetResolvedRegion() string {
return o.ResolvedRegion
}
func (o Options) GetDisableHTTPS() bool {
return o.DisableHTTPS
}
func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState {
return o.UseDualStackEndpoint
}
func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState {
return o.UseFIPSEndpoint
}
func transformToSharedOptions(options Options) endpoints.Options {
return endpoints.Options{
Logger: options.Logger,
LogDeprecated: options.LogDeprecated,
ResolvedRegion: options.ResolvedRegion,
DisableHTTPS: options.DisableHTTPS,
UseDualStackEndpoint: options.UseDualStackEndpoint,
UseFIPSEndpoint: options.UseFIPSEndpoint,
}
}
// Resolver ServerlessApplicationRepository endpoint resolver
type Resolver struct {
partitions endpoints.Partitions
}
// ResolveEndpoint resolves the service endpoint for the given region and options
func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) {
if len(region) == 0 {
return endpoint, &aws.MissingRegionError{}
}
opt := transformToSharedOptions(options)
return r.partitions.ResolveEndpoint(region, opt)
}
// New returns a new Resolver
func New() *Resolver {
return &Resolver{
partitions: defaultPartitions,
}
}
var partitionRegexp = struct {
Aws *regexp.Regexp
AwsCn *regexp.Regexp
AwsIso *regexp.Regexp
AwsIsoB *regexp.Regexp
AwsIsoE *regexp.Regexp
AwsIsoF *regexp.Regexp
AwsUsGov *regexp.Regexp
}{
Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"),
AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"),
AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"),
AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"),
AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"),
AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"),
AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"),
}
var defaultPartitions = endpoints.Partitions{
{
ID: "aws",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.Aws,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "ap-east-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ap-northeast-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ap-northeast-2",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ap-south-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ap-southeast-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ap-southeast-2",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "ca-central-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "eu-central-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "eu-north-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "eu-west-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "eu-west-2",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "eu-west-3",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "me-south-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "sa-east-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-east-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-east-2",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-west-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-west-2",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
},
},
{
ID: "aws-cn",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.api.amazonwebservices.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.amazonaws.com.cn",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsCn,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "cn-north-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "cn-northwest-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
},
},
{
ID: "aws-iso",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.c2s.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIso,
IsRegionalized: true,
},
{
ID: "aws-iso-b",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.sc2s.sgov.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoB,
IsRegionalized: true,
},
{
ID: "aws-iso-e",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.cloud.adc-e.uk",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoE,
IsRegionalized: true,
},
{
ID: "aws-iso-f",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.csp.hci.ic.gov",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsIsoF,
IsRegionalized: true,
},
{
ID: "aws-us-gov",
Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{
{
Variant: endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: endpoints.FIPSVariant | endpoints.DualStackVariant,
}: {
Hostname: "serverlessrepo-fips.{region}.api.aws",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
{
Variant: 0,
}: {
Hostname: "serverlessrepo.{region}.amazonaws.com",
Protocols: []string{"https"},
SignatureVersions: []string{"v4"},
},
},
RegionRegex: partitionRegexp.AwsUsGov,
IsRegionalized: true,
Endpoints: endpoints.Endpoints{
endpoints.EndpointKey{
Region: "us-gov-east-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-gov-east-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com",
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-gov-east-1-fips",
}: endpoints.Endpoint{
Hostname: "serverlessrepo.us-gov-east-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-east-1",
},
Deprecated: aws.TrueTernary,
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
}: endpoints.Endpoint{
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1",
Variant: endpoints.FIPSVariant,
}: {
Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com",
Protocols: []string{"https"},
},
endpoints.EndpointKey{
Region: "us-gov-west-1-fips",
}: endpoints.Endpoint{
Hostname: "serverlessrepo.us-gov-west-1.amazonaws.com",
CredentialScope: endpoints.CredentialScope{
Region: "us-gov-west-1",
},
Deprecated: aws.TrueTernary,
},
},
},
}
| 445 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package endpoints
import (
"testing"
)
func TestRegexCompile(t *testing.T) {
_ = defaultPartitions
}
| 12 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
type Capability string
// Enum values for Capability
const (
CapabilityCapabilityIam Capability = "CAPABILITY_IAM"
CapabilityCapabilityNamedIam Capability = "CAPABILITY_NAMED_IAM"
CapabilityCapabilityAutoExpand Capability = "CAPABILITY_AUTO_EXPAND"
CapabilityCapabilityResourcePolicy Capability = "CAPABILITY_RESOURCE_POLICY"
)
// Values returns all known values for Capability. Note that this can be expanded
// in the future, and so it is only as up to date as the client. The ordering of
// this slice is not guaranteed to be stable across updates.
func (Capability) Values() []Capability {
return []Capability{
"CAPABILITY_IAM",
"CAPABILITY_NAMED_IAM",
"CAPABILITY_AUTO_EXPAND",
"CAPABILITY_RESOURCE_POLICY",
}
}
type Status string
// Enum values for Status
const (
StatusPreparing Status = "PREPARING"
StatusActive Status = "ACTIVE"
StatusExpired Status = "EXPIRED"
)
// Values returns all known values for Status. Note that this can be expanded in
// the future, and so it is only as up to date as the client. The ordering of this
// slice is not guaranteed to be stable across updates.
func (Status) Values() []Status {
return []Status{
"PREPARING",
"ACTIVE",
"EXPIRED",
}
}
| 46 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
"fmt"
smithy "github.com/aws/smithy-go"
)
// One of the parameters in the request is invalid.
type BadRequestException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *BadRequestException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *BadRequestException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *BadRequestException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "BadRequestException"
}
return *e.ErrorCodeOverride
}
func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The resource already exists.
type ConflictException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *ConflictException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ConflictException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ConflictException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ConflictException"
}
return *e.ErrorCodeOverride
}
func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The client is not authenticated.
type ForbiddenException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *ForbiddenException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *ForbiddenException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *ForbiddenException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "ForbiddenException"
}
return *e.ErrorCodeOverride
}
func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The AWS Serverless Application Repository service encountered an internal error.
type InternalServerErrorException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *InternalServerErrorException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *InternalServerErrorException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *InternalServerErrorException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "InternalServerErrorException"
}
return *e.ErrorCodeOverride
}
func (e *InternalServerErrorException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer }
// The resource (for example, an access policy statement) specified in the request
// doesn't exist.
type NotFoundException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *NotFoundException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *NotFoundException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *NotFoundException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "NotFoundException"
}
return *e.ErrorCodeOverride
}
func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
// The client is sending more than the allowed number of requests per unit of time.
type TooManyRequestsException struct {
Message *string
ErrorCodeOverride *string
ErrorCode_ *string
noSmithyDocumentSerde
}
func (e *TooManyRequestsException) Error() string {
return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage())
}
func (e *TooManyRequestsException) ErrorMessage() string {
if e.Message == nil {
return ""
}
return *e.Message
}
func (e *TooManyRequestsException) ErrorCode() string {
if e == nil || e.ErrorCodeOverride == nil {
return "TooManyRequestsException"
}
return *e.ErrorCodeOverride
}
func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient }
| 178 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package types
import (
smithydocument "github.com/aws/smithy-go/document"
)
// A nested application summary.
type ApplicationDependencySummary struct {
// The Amazon Resource Name (ARN) of the nested application.
//
// This member is required.
ApplicationId *string
// The semantic version of the nested application.
//
// This member is required.
SemanticVersion *string
noSmithyDocumentSerde
}
// Policy statement applied to the application.
type ApplicationPolicyStatement struct {
// For the list of actions supported for this operation, see Application
// Permissions (https://docs.aws.amazon.com/serverlessrepo/latest/devguide/access-control-resource-based.html#application-permissions)
// .
//
// This member is required.
Actions []string
// An array of AWS account IDs, or * to make the application public.
//
// This member is required.
Principals []string
// An array of PrinciplalOrgIDs, which corresponds to AWS IAM aws:PrincipalOrgID (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#principal-org-id)
// global condition key.
PrincipalOrgIDs []string
// A unique ID for the statement.
StatementId *string
noSmithyDocumentSerde
}
// Summary of details about the application.
type ApplicationSummary struct {
// The application Amazon Resource Name (ARN).
//
// This member is required.
ApplicationId *string
// The name of the author publishing the app.Minimum length=1. Maximum
// length=127.Pattern "^[a-z0-9](([a-z0-9]|-(?!-))*[a-z0-9])?$";
//
// This member is required.
Author *string
// The description of the application.Minimum length=1. Maximum length=256
//
// This member is required.
Description *string
// The name of the application.Minimum length=1. Maximum length=140Pattern:
// "[a-zA-Z0-9\\-]+";
//
// This member is required.
Name *string
// The date and time this resource was created.
CreationTime *string
// A URL with more information about the application, for example the location of
// your GitHub repository for the application.
HomePageUrl *string
// Labels to improve discovery of apps in search results.Minimum length=1. Maximum
// length=127. Maximum number of labels: 10Pattern: "^[a-zA-Z0-9+\\-_:\\/@]+$";
Labels []string
// A valid identifier from https://spdx.org/licenses/ (https://spdx.org/licenses/) .
SpdxLicenseId *string
noSmithyDocumentSerde
}
// Parameters supported by the application.
type ParameterDefinition struct {
// The name of the parameter.
//
// This member is required.
Name *string
// A list of AWS SAM resources that use this parameter.
//
// This member is required.
ReferencedByResources []string
// A regular expression that represents the patterns to allow for String types.
AllowedPattern *string
// An array containing the list of values allowed for the parameter.
AllowedValues []string
// A string that explains a constraint when the constraint is violated. For
// example, without a constraint description, a parameter that has an allowed
// pattern of [A-Za-z0-9]+ displays the following error message when the user
// specifies an invalid value: Malformed input-Parameter MyParameter must match
// pattern [A-Za-z0-9]+ By adding a constraint description, such as "must contain
// only uppercase and lowercase letters and numbers," you can display the following
// customized error message: Malformed input-Parameter MyParameter must contain
// only uppercase and lowercase letters and numbers.
ConstraintDescription *string
// A value of the appropriate type for the template to use if no value is
// specified when a stack is created. If you define constraints for the parameter,
// you must specify a value that adheres to those constraints.
DefaultValue *string
// A string of up to 4,000 characters that describes the parameter.
Description *string
// An integer value that determines the largest number of characters that you want
// to allow for String types.
MaxLength int32
// A numeric value that determines the largest numeric value that you want to
// allow for Number types.
MaxValue int32
// An integer value that determines the smallest number of characters that you
// want to allow for String types.
MinLength int32
// A numeric value that determines the smallest numeric value that you want to
// allow for Number types.
MinValue int32
// Whether to mask the parameter value whenever anyone makes a call that describes
// the stack. If you set the value to true, the parameter value is masked with
// asterisks (*****).
NoEcho bool
// The type of the parameter.Valid values: String | Number | List<Number> |
// CommaDelimitedList String: A literal string.For example, users can specify
// "MyUserName". Number: An integer or float. AWS CloudFormation validates the
// parameter value as a number. However, when you use the parameter elsewhere in
// your template (for example, by using the Ref intrinsic function), the parameter
// value becomes a string.For example, users might specify "8888". List<Number>: An
// array of integers or floats that are separated by commas. AWS CloudFormation
// validates the parameter value as numbers. However, when you use the parameter
// elsewhere in your template (for example, by using the Ref intrinsic function),
// the parameter value becomes a list of strings.For example, users might specify
// "80,20", and then Ref results in ["80","20"]. CommaDelimitedList: An array of
// literal strings that are separated by commas. The total number of strings should
// be one more than the total number of commas. Also, each member string is
// space-trimmed.For example, users might specify "test,dev,prod", and then Ref
// results in ["test","dev","prod"].
Type *string
noSmithyDocumentSerde
}
// Parameter value of the application.
type ParameterValue struct {
// The key associated with the parameter. If you don't specify a key and value for
// a particular parameter, AWS CloudFormation uses the default value that is
// specified in your template.
//
// This member is required.
Name *string
// The input value associated with the parameter.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// This property corresponds to the AWS CloudFormation RollbackConfiguration (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackConfiguration)
// Data Type.
type RollbackConfiguration struct {
// This property corresponds to the content of the same name for the AWS
// CloudFormation RollbackConfiguration (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackConfiguration)
// Data Type.
MonitoringTimeInMinutes int32
// This property corresponds to the content of the same name for the AWS
// CloudFormation RollbackConfiguration (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackConfiguration)
// Data Type.
RollbackTriggers []RollbackTrigger
noSmithyDocumentSerde
}
// This property corresponds to the AWS CloudFormation RollbackTrigger (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackTrigger)
// Data Type.
type RollbackTrigger struct {
// This property corresponds to the content of the same name for the AWS
// CloudFormation RollbackTrigger (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackTrigger)
// Data Type.
//
// This member is required.
Arn *string
// This property corresponds to the content of the same name for the AWS
// CloudFormation RollbackTrigger (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RollbackTrigger)
// Data Type.
//
// This member is required.
Type *string
noSmithyDocumentSerde
}
// This property corresponds to the AWS CloudFormation Tag (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Tag)
// Data Type.
type Tag struct {
// This property corresponds to the content of the same name for the AWS
// CloudFormation Tag (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Tag)
// Data Type.
//
// This member is required.
Key *string
// This property corresponds to the content of the same name for the AWS
// CloudFormation Tag (https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/Tag)
// Data Type.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
// Application version details.
type Version struct {
// The application Amazon Resource Name (ARN).
//
// This member is required.
ApplicationId *string
// The date and time this resource was created.
//
// This member is required.
CreationTime *string
// An array of parameter types supported by the application.
//
// This member is required.
ParameterDefinitions []ParameterDefinition
// A list of values that you must specify before you can deploy certain
// applications. Some applications might include resources that can affect
// permissions in your AWS account, for example, by creating new AWS Identity and
// Access Management (IAM) users. For those applications, you must explicitly
// acknowledge their capabilities by specifying this parameter.The only valid
// values are CAPABILITY_IAM, CAPABILITY_NAMED_IAM, CAPABILITY_RESOURCE_POLICY, and
// CAPABILITY_AUTO_EXPAND.The following resources require you to specify
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM: AWS::IAM::Group (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-iam-group.html)
// , AWS::IAM::InstanceProfile (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-instanceprofile.html)
// , AWS::IAM::Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , and AWS::IAM::Role (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-role.html)
// . If the application contains IAM resources, you can specify either
// CAPABILITY_IAM or CAPABILITY_NAMED_IAM. If the application contains IAM
// resources with custom names, you must specify CAPABILITY_NAMED_IAM.The following
// resources require you to specify CAPABILITY_RESOURCE_POLICY:
// AWS::Lambda::Permission (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html)
// , AWS::IAM:Policy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-iam-policy.html)
// , AWS::ApplicationAutoScaling::ScalingPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-applicationautoscaling-scalingpolicy.html)
// , AWS::S3::BucketPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-policy.html)
// , AWS::SQS::QueuePolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sqs-policy.html)
// , and AWS::SNS::TopicPolicy (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-sns-policy.html)
// .Applications that contain one or more nested applications require you to
// specify CAPABILITY_AUTO_EXPAND.If your application template contains any of the
// above resources, we recommend that you review all permissions associated with
// the application before deploying. If you don't specify this parameter for an
// application that requires capabilities, the call will fail.
//
// This member is required.
RequiredCapabilities []Capability
// Whether all of the AWS resources contained in this application are supported in
// the region in which it is being retrieved.
//
// This member is required.
ResourcesSupported bool
// The semantic version of the application: https://semver.org/ (https://semver.org/)
//
// This member is required.
SemanticVersion *string
// A link to the packaged AWS SAM template of your application.
//
// This member is required.
TemplateUrl *string
// A link to the S3 object that contains the ZIP archive of the source code for
// this version of your application.Maximum size 50 MB
SourceCodeArchiveUrl *string
// A link to a public repository for the source code of your application, for
// example the URL of a specific GitHub commit.
SourceCodeUrl *string
noSmithyDocumentSerde
}
// An application version summary.
type VersionSummary struct {
// The application Amazon Resource Name (ARN).
//
// This member is required.
ApplicationId *string
// The date and time this resource was created.
//
// This member is required.
CreationTime *string
// The semantic version of the application: https://semver.org/ (https://semver.org/)
//
// This member is required.
SemanticVersion *string
// A link to a public repository for the source code of your application, for
// example the URL of a specific GitHub commit.
SourceCodeUrl *string
noSmithyDocumentSerde
}
type noSmithyDocumentSerde = smithydocument.NoSerde
| 348 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
cryptorand "crypto/rand"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyrand "github.com/aws/smithy-go/rand"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
const ServiceID = "Service Catalog"
const ServiceAPIVersion = "2015-12-10"
// Client provides the API client to make operations call for AWS Service Catalog.
type Client struct {
options Options
}
// New returns an initialized Client based on the functional options. Provide
// additional functional options to further configure the behavior of the client,
// such as changing the client's endpoint or adding custom middleware behavior.
func New(options Options, optFns ...func(*Options)) *Client {
options = options.Copy()
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
resolveHTTPSignerV4(&options)
resolveDefaultEndpointConfiguration(&options)
resolveIdempotencyTokenProvider(&options)
for _, fn := range optFns {
fn(&options)
}
client := &Client{
options: options,
}
return client
}
type Options struct {
// Set of options to modify how an operation is invoked. These apply to all
// operations invoked for this client. Use functional options on operation call to
// modify this list for per operation behavior.
APIOptions []func(*middleware.Stack) error
// Configures the events that will be sent to the configured logger.
ClientLogMode aws.ClientLogMode
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// The endpoint options to be used when attempting to resolve an endpoint.
EndpointOptions EndpointResolverOptions
// The service endpoint resolver.
EndpointResolver EndpointResolver
// Signature Version 4 (SigV4) Signer
HTTPSignerV4 HTTPSignerV4
// Provides idempotency tokens values that will be automatically populated into
// idempotent API operations.
IdempotencyTokenProvider IdempotencyTokenProvider
// The logger writer interface to write logging messages to.
Logger logging.Logger
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
}
// WithAPIOptions returns a functional option for setting the Client's APIOptions
// option.
func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) {
return func(o *Options) {
o.APIOptions = append(o.APIOptions, optFns...)
}
}
// WithEndpointResolver returns a functional option for setting the Client's
// EndpointResolver option.
func WithEndpointResolver(v EndpointResolver) func(*Options) {
return func(o *Options) {
o.EndpointResolver = v
}
}
type HTTPClient interface {
Do(*http.Request) (*http.Response, error)
}
// Copy creates a clone where the APIOptions list is deep copied.
func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
ctx = middleware.ClearStackValues(ctx)
stack := middleware.NewStack(opID, smithyhttp.NewStackRequest)
options := c.options.Copy()
for _, fn := range optFns {
fn(&options)
}
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
for _, fn := range stackFns {
if err := fn(stack, options); err != nil {
return nil, metadata, err
}
}
for _, fn := range options.APIOptions {
if err := fn(stack); err != nil {
return nil, metadata, err
}
}
handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack)
result, metadata, err = handler.Handle(ctx, params)
if err != nil {
err = &smithy.OperationError{
ServiceID: ServiceID,
OperationName: opID,
Err: err,
}
}
return result, metadata, err
}
type noSmithyDocumentSerde = smithydocument.NoSerde
func resolveDefaultLogger(o *Options) {
if o.Logger != nil {
return
}
o.Logger = logging.Nop{}
}
func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
resolveUseFIPSEndpoint(cfg, &opts)
return New(opts, optFns...)
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
if cfg.Retryer == nil {
return
}
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
}
func addClientUserAgent(stack *middleware.Stack) error {
return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "servicecatalog", goModuleVersion)(stack)
}
func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error {
mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
Signer: o.HTTPSignerV4,
LogSigning: o.ClientLogMode.IsSigning(),
})
return stack.Finalize.Add(mw, middleware.After)
}
type HTTPSignerV4 interface {
SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error
}
func resolveHTTPSignerV4(o *Options) {
if o.HTTPSignerV4 != nil {
return
}
o.HTTPSignerV4 = newDefaultV4Signer(*o)
}
func newDefaultV4Signer(o Options) *v4.Signer {
return v4.NewSigner(func(so *v4.SignerOptions) {
so.Logger = o.Logger
so.LogSigning = o.ClientLogMode.IsSigning()
})
}
func resolveIdempotencyTokenProvider(o *Options) {
if o.IdempotencyTokenProvider != nil {
return
}
o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader)
}
func addRetryMiddlewares(stack *middleware.Stack, o Options) error {
mo := retry.AddRetryMiddlewaresOptions{
Retryer: o.Retryer,
LogRetryAttempts: o.ClientLogMode.IsRetries(),
}
return retry.AddRetryMiddlewares(stack, mo)
}
// resolves dual-stack endpoint configuration
func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseDualStackEndpoint = value
}
return nil
}
// resolves FIPS endpoint configuration
func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error {
if len(cfg.ConfigSources) == 0 {
return nil
}
value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources)
if err != nil {
return err
}
if found {
o.EndpointOptions.UseFIPSEndpoint = value
}
return nil
}
// IdempotencyTokenProvider interface for providing idempotency token
type IdempotencyTokenProvider interface {
GetIdempotencyToken() (string, error)
}
func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error {
return awsmiddleware.AddRequestIDRetrieverMiddleware(stack)
}
func addResponseErrorMiddleware(stack *middleware.Stack) error {
return awshttp.AddResponseErrorMiddleware(stack)
}
func addRequestResponseLogging(stack *middleware.Stack, o Options) error {
return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{
LogRequest: o.ClientLogMode.IsRequest(),
LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(),
LogResponse: o.ClientLogMode.IsResponse(),
LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(),
}, middleware.After)
}
| 454 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"io/ioutil"
"net/http"
"strings"
"testing"
)
func TestClient_resolveRetryOptions(t *testing.T) {
nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) {
return &http.Response{
StatusCode: 200,
Header: http.Header{},
Body: ioutil.NopCloser(strings.NewReader("")),
}, nil
})
cases := map[string]struct {
defaultsMode aws.DefaultsMode
retryer aws.Retryer
retryMaxAttempts int
opRetryMaxAttempts *int
retryMode aws.RetryMode
expectClientRetryMode aws.RetryMode
expectClientMaxAttempts int
expectOpMaxAttempts int
}{
"defaults": {
defaultsMode: aws.DefaultsModeStandard,
expectClientRetryMode: aws.RetryModeStandard,
expectClientMaxAttempts: 3,
expectOpMaxAttempts: 3,
},
"custom default retry": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(2),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 2,
},
"custom op no change max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(10),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
"custom op 0 max attempts": {
retryMode: aws.RetryModeAdaptive,
retryMaxAttempts: 10,
opRetryMaxAttempts: aws.Int(0),
expectClientRetryMode: aws.RetryModeAdaptive,
expectClientMaxAttempts: 10,
expectOpMaxAttempts: 10,
},
}
for name, c := range cases {
t.Run(name, func(t *testing.T) {
client := NewFromConfig(aws.Config{
DefaultsMode: c.defaultsMode,
Retryer: func() func() aws.Retryer {
if c.retryer == nil {
return nil
}
return func() aws.Retryer { return c.retryer }
}(),
HTTPClient: nopClient,
RetryMaxAttempts: c.retryMaxAttempts,
RetryMode: c.retryMode,
})
if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a {
t.Errorf("expect %v retry mode, got %v", e, a)
}
if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v max attempts, got %v", e, a)
}
_, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{},
[]func(*Options){
func(o *Options) {
if c.opRetryMaxAttempts == nil {
return
}
o.RetryMaxAttempts = *c.opRetryMaxAttempts
},
},
func(s *middleware.Stack, o Options) error {
s.Initialize.Clear()
s.Serialize.Clear()
s.Build.Clear()
s.Finalize.Clear()
s.Deserialize.Clear()
if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a {
t.Errorf("expect %v op max attempts, got %v", e, a)
}
return nil
})
if err != nil {
t.Fatalf("expect no operation error, got %v", err)
}
})
}
}
| 124 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Accepts an offer to share the specified portfolio.
func (c *Client) AcceptPortfolioShare(ctx context.Context, params *AcceptPortfolioShareInput, optFns ...func(*Options)) (*AcceptPortfolioShareOutput, error) {
if params == nil {
params = &AcceptPortfolioShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AcceptPortfolioShare", params, optFns, c.addOperationAcceptPortfolioShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AcceptPortfolioShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type AcceptPortfolioShareInput struct {
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The type of shared portfolios to accept. The default is to accept imported
// portfolios.
// - AWS_ORGANIZATIONS - Accept portfolios shared by the management account of
// your organization.
// - IMPORTED - Accept imported portfolios.
// - AWS_SERVICECATALOG - Not supported. (Throws ResourceNotFoundException.)
// For example, aws servicecatalog accept-portfolio-share --portfolio-id
// "port-2qwzkwxt3y5fk" --portfolio-share-type AWS_ORGANIZATIONS
PortfolioShareType types.PortfolioShareType
noSmithyDocumentSerde
}
type AcceptPortfolioShareOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAcceptPortfolioShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAcceptPortfolioShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAcceptPortfolioShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAcceptPortfolioShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptPortfolioShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAcceptPortfolioShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AcceptPortfolioShare",
}
}
| 136 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates the specified budget with the specified resource.
func (c *Client) AssociateBudgetWithResource(ctx context.Context, params *AssociateBudgetWithResourceInput, optFns ...func(*Options)) (*AssociateBudgetWithResourceOutput, error) {
if params == nil {
params = &AssociateBudgetWithResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateBudgetWithResource", params, optFns, c.addOperationAssociateBudgetWithResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateBudgetWithResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateBudgetWithResourceInput struct {
// The name of the budget you want to associate.
//
// This member is required.
BudgetName *string
// The resource identifier. Either a portfolio-id or a product-id.
//
// This member is required.
ResourceId *string
noSmithyDocumentSerde
}
type AssociateBudgetWithResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateBudgetWithResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateBudgetWithResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateBudgetWithResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateBudgetWithResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateBudgetWithResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateBudgetWithResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AssociateBudgetWithResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates the specified principal ARN with the specified portfolio. If you
// share the portfolio with principal name sharing enabled, the PrincipalARN
// association is included in the share. The PortfolioID , PrincipalARN , and
// PrincipalType parameters are required. You can associate a maximum of 10
// Principals with a portfolio using PrincipalType as IAM_PATTERN When you
// associate a principal with portfolio, a potential privilege escalation path may
// occur when that portfolio is then shared with other accounts. For a user in a
// recipient account who is not an Service Catalog Admin, but still has the ability
// to create Principals (Users/Groups/Roles), that user could create a role that
// matches a principal name association for the portfolio. Although this user may
// not know which principal names are associated through Service Catalog, they may
// be able to guess the user. If this potential escalation path is a concern, then
// Service Catalog recommends using PrincipalType as IAM . With this configuration,
// the PrincipalARN must already exist in the recipient account before it can be
// associated.
func (c *Client) AssociatePrincipalWithPortfolio(ctx context.Context, params *AssociatePrincipalWithPortfolioInput, optFns ...func(*Options)) (*AssociatePrincipalWithPortfolioOutput, error) {
if params == nil {
params = &AssociatePrincipalWithPortfolioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociatePrincipalWithPortfolio", params, optFns, c.addOperationAssociatePrincipalWithPortfolioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociatePrincipalWithPortfolioOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociatePrincipalWithPortfolioInput struct {
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The ARN of the principal (user, role, or group). If the PrincipalType is IAM ,
// the supported value is a fully defined IAM Amazon Resource Name (ARN) (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns)
// . If the PrincipalType is IAM_PATTERN , the supported value is an IAM ARN
// without an AccountID in the following format:
// arn:partition:iam:::resource-type/resource-id The ARN resource-id can be either:
//
// - A fully formed resource-id. For example, arn:aws:iam:::role/resource-name
// or arn:aws:iam:::role/resource-path/resource-name
// - A wildcard ARN. The wildcard ARN accepts IAM_PATTERN values with a "*" or
// "?" in the resource-id segment of the ARN. For example
// arn:partition:service:::resource-type/resource-path/resource-name. The new
// symbols are exclusive to the resource-path and resource-name and cannot replace
// the resource-type or other ARN values. The ARN path and principal name allow
// unlimited wildcard characters.
// Examples of an acceptable wildcard ARN:
// - arn:aws:iam:::role/ResourceName_*
// - arn:aws:iam:::role/*/ResourceName_?
// Examples of an unacceptable wildcard ARN:
// - arn:aws:iam:::*/ResourceName
// You can associate multiple IAM_PATTERN s even if the account has no principal
// with that name. The "?" wildcard character matches zero or one of any character.
// This is similar to ".?" in regular regex context. The "*" wildcard character
// matches any number of any characters. This is similar to ".*" in regular regex
// context. In the IAM Principal ARN format
// (arn:partition:iam:::resource-type/resource-path/resource-name), valid
// resource-type values include user/, group/, or role/. The "?" and "*" characters
// are allowed only after the resource-type in the resource-id segment. You can use
// special characters anywhere within the resource-id. The "*" character also
// matches the "/" character, allowing paths to be formed within the resource-id.
// For example, arn:aws:iam:::role/*/ResourceName_? matches both
// arn:aws:iam:::role/pathA/pathB/ResourceName_1 and
// arn:aws:iam:::role/pathA/ResourceName_1.
//
// This member is required.
PrincipalARN *string
// The principal type. The supported value is IAM if you use a fully defined
// Amazon Resource Name (ARN), or IAM_PATTERN if you use an ARN with no accountID ,
// with or without wildcard characters.
//
// This member is required.
PrincipalType types.PrincipalType
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type AssociatePrincipalWithPortfolioOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociatePrincipalWithPortfolioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociatePrincipalWithPortfolio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociatePrincipalWithPortfolio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociatePrincipalWithPortfolioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociatePrincipalWithPortfolio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociatePrincipalWithPortfolio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AssociatePrincipalWithPortfolio",
}
}
| 183 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates the specified product with the specified portfolio. A delegated
// admin is authorized to invoke this command.
func (c *Client) AssociateProductWithPortfolio(ctx context.Context, params *AssociateProductWithPortfolioInput, optFns ...func(*Options)) (*AssociateProductWithPortfolioOutput, error) {
if params == nil {
params = &AssociateProductWithPortfolioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateProductWithPortfolio", params, optFns, c.addOperationAssociateProductWithPortfolioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateProductWithPortfolioOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateProductWithPortfolioInput struct {
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The product identifier.
//
// This member is required.
ProductId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The identifier of the source portfolio.
SourcePortfolioId *string
noSmithyDocumentSerde
}
type AssociateProductWithPortfolioOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateProductWithPortfolioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateProductWithPortfolio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateProductWithPortfolio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateProductWithPortfolioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateProductWithPortfolio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateProductWithPortfolio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AssociateProductWithPortfolio",
}
}
| 134 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates a self-service action with a provisioning artifact.
func (c *Client) AssociateServiceActionWithProvisioningArtifact(ctx context.Context, params *AssociateServiceActionWithProvisioningArtifactInput, optFns ...func(*Options)) (*AssociateServiceActionWithProvisioningArtifactOutput, error) {
if params == nil {
params = &AssociateServiceActionWithProvisioningArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateServiceActionWithProvisioningArtifact", params, optFns, c.addOperationAssociateServiceActionWithProvisioningArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateServiceActionWithProvisioningArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateServiceActionWithProvisioningArtifactInput struct {
// The product identifier. For example, prod-abcdzk7xy33qa .
//
// This member is required.
ProductId *string
// The identifier of the provisioning artifact. For example, pa-4abcdjnxjj6ne .
//
// This member is required.
ProvisioningArtifactId *string
// The self-service action identifier. For example, act-fs7abcd89wxyz .
//
// This member is required.
ServiceActionId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type AssociateServiceActionWithProvisioningArtifactOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateServiceActionWithProvisioningArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateServiceActionWithProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateServiceActionWithProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateServiceActionWithProvisioningArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateServiceActionWithProvisioningArtifact(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateServiceActionWithProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AssociateServiceActionWithProvisioningArtifact",
}
}
| 135 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associate the specified TagOption with the specified portfolio or product.
func (c *Client) AssociateTagOptionWithResource(ctx context.Context, params *AssociateTagOptionWithResourceInput, optFns ...func(*Options)) (*AssociateTagOptionWithResourceOutput, error) {
if params == nil {
params = &AssociateTagOptionWithResourceInput{}
}
result, metadata, err := c.invokeOperation(ctx, "AssociateTagOptionWithResource", params, optFns, c.addOperationAssociateTagOptionWithResourceMiddlewares)
if err != nil {
return nil, err
}
out := result.(*AssociateTagOptionWithResourceOutput)
out.ResultMetadata = metadata
return out, nil
}
type AssociateTagOptionWithResourceInput struct {
// The resource identifier.
//
// This member is required.
ResourceId *string
// The TagOption identifier.
//
// This member is required.
TagOptionId *string
noSmithyDocumentSerde
}
type AssociateTagOptionWithResourceOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationAssociateTagOptionWithResourceMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateTagOptionWithResource{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateTagOptionWithResource{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpAssociateTagOptionWithResourceValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateTagOptionWithResource(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opAssociateTagOptionWithResource(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "AssociateTagOptionWithResource",
}
}
| 125 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Associates multiple self-service actions with provisioning artifacts.
func (c *Client) BatchAssociateServiceActionWithProvisioningArtifact(ctx context.Context, params *BatchAssociateServiceActionWithProvisioningArtifactInput, optFns ...func(*Options)) (*BatchAssociateServiceActionWithProvisioningArtifactOutput, error) {
if params == nil {
params = &BatchAssociateServiceActionWithProvisioningArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchAssociateServiceActionWithProvisioningArtifact", params, optFns, c.addOperationBatchAssociateServiceActionWithProvisioningArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchAssociateServiceActionWithProvisioningArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchAssociateServiceActionWithProvisioningArtifactInput struct {
// One or more associations, each consisting of the Action ID, the Product ID, and
// the Provisioning Artifact ID.
//
// This member is required.
ServiceActionAssociations []types.ServiceActionAssociation
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type BatchAssociateServiceActionWithProvisioningArtifactOutput struct {
// An object that contains a list of errors, along with information to help you
// identify the self-service action.
FailedServiceActionAssociations []types.FailedServiceActionAssociation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchAssociateServiceActionWithProvisioningArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchAssociateServiceActionWithProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchAssociateServiceActionWithProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchAssociateServiceActionWithProvisioningArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchAssociateServiceActionWithProvisioningArtifact(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opBatchAssociateServiceActionWithProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "BatchAssociateServiceActionWithProvisioningArtifact",
}
}
| 132 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Disassociates a batch of self-service actions from the specified provisioning
// artifact.
func (c *Client) BatchDisassociateServiceActionFromProvisioningArtifact(ctx context.Context, params *BatchDisassociateServiceActionFromProvisioningArtifactInput, optFns ...func(*Options)) (*BatchDisassociateServiceActionFromProvisioningArtifactOutput, error) {
if params == nil {
params = &BatchDisassociateServiceActionFromProvisioningArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "BatchDisassociateServiceActionFromProvisioningArtifact", params, optFns, c.addOperationBatchDisassociateServiceActionFromProvisioningArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*BatchDisassociateServiceActionFromProvisioningArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type BatchDisassociateServiceActionFromProvisioningArtifactInput struct {
// One or more associations, each consisting of the Action ID, the Product ID, and
// the Provisioning Artifact ID.
//
// This member is required.
ServiceActionAssociations []types.ServiceActionAssociation
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type BatchDisassociateServiceActionFromProvisioningArtifactOutput struct {
// An object that contains a list of errors, along with information to help you
// identify the self-service action.
FailedServiceActionAssociations []types.FailedServiceActionAssociation
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationBatchDisassociateServiceActionFromProvisioningArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpBatchDisassociateServiceActionFromProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpBatchDisassociateServiceActionFromProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpBatchDisassociateServiceActionFromProvisioningArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDisassociateServiceActionFromProvisioningArtifact(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opBatchDisassociateServiceActionFromProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "BatchDisassociateServiceActionFromProvisioningArtifact",
}
}
| 133 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Copies the specified source product to the specified target product or a new
// product. You can copy a product to the same account or another account. You can
// copy a product to the same Region or another Region. If you copy a product to
// another account, you must first share the product in a portfolio using
// CreatePortfolioShare . This operation is performed asynchronously. To track the
// progress of the operation, use DescribeCopyProductStatus .
func (c *Client) CopyProduct(ctx context.Context, params *CopyProductInput, optFns ...func(*Options)) (*CopyProductOutput, error) {
if params == nil {
params = &CopyProductInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CopyProduct", params, optFns, c.addOperationCopyProductMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CopyProductOutput)
out.ResultMetadata = metadata
return out, nil
}
type CopyProductInput struct {
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The Amazon Resource Name (ARN) of the source product.
//
// This member is required.
SourceProductArn *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The copy options. If the value is CopyTags , the tags from the source product
// are copied to the target product.
CopyOptions []types.CopyOption
// The identifiers of the provisioning artifacts (also known as versions) of the
// product to copy. By default, all provisioning artifacts are copied.
SourceProvisioningArtifactIdentifiers []map[string]string
// The identifier of the target product. By default, a new product is created.
TargetProductId *string
// A name for the target product. The default is the name of the source product.
TargetProductName *string
noSmithyDocumentSerde
}
type CopyProductOutput struct {
// The token to use to track the progress of the operation.
CopyProductToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCopyProductMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCopyProduct{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCopyProduct{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCopyProductMiddleware(stack, options); err != nil {
return err
}
if err = addOpCopyProductValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyProduct(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCopyProduct struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCopyProduct) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCopyProduct) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CopyProductInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CopyProductInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCopyProductMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCopyProduct{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCopyProduct(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CopyProduct",
}
}
| 193 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a constraint. A delegated admin is authorized to invoke this command.
func (c *Client) CreateConstraint(ctx context.Context, params *CreateConstraintInput, optFns ...func(*Options)) (*CreateConstraintOutput, error) {
if params == nil {
params = &CreateConstraintInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateConstraint", params, optFns, c.addOperationCreateConstraintMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateConstraintOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateConstraintInput struct {
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The constraint parameters, in JSON format. The syntax depends on the constraint
// type as follows: LAUNCH You are required to specify either the RoleArn or the
// LocalRoleName but can't use both. Specify the RoleArn property as follows:
// {"RoleArn" : "arn:aws:iam::123456789012:role/LaunchRole"} Specify the
// LocalRoleName property as follows: {"LocalRoleName": "SCBasicLaunchRole"} If
// you specify the LocalRoleName property, when an account uses the launch
// constraint, the IAM role with that name in the account will be used. This allows
// launch-role constraints to be account-agnostic so the administrator can create
// fewer resources per shared account. The given role name must exist in the
// account used to create the launch constraint and the account of the user who
// launches a product with this launch constraint. You cannot have both a LAUNCH
// and a STACKSET constraint. You also cannot have more than one LAUNCH constraint
// on a product and portfolio. NOTIFICATION Specify the NotificationArns property
// as follows: {"NotificationArns" : ["arn:aws:sns:us-east-1:123456789012:Topic"]}
// RESOURCE_UPDATE Specify the TagUpdatesOnProvisionedProduct property as follows:
// {"Version":"2.0","Properties":{"TagUpdateOnProvisionedProduct":"String"}} The
// TagUpdatesOnProvisionedProduct property accepts a string value of ALLOWED or
// NOT_ALLOWED . STACKSET Specify the Parameters property as follows: {"Version":
// "String", "Properties": {"AccountList": [ "String" ], "RegionList": [ "String"
// ], "AdminRole": "String", "ExecutionRole": "String"}} You cannot have both a
// LAUNCH and a STACKSET constraint. You also cannot have more than one STACKSET
// constraint on a product and portfolio. Products with a STACKSET constraint will
// launch an CloudFormation stack set. TEMPLATE Specify the Rules property. For
// more information, see Template Constraint Rules (http://docs.aws.amazon.com/servicecatalog/latest/adminguide/reference-template_constraint_rules.html)
// .
//
// This member is required.
Parameters *string
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The product identifier.
//
// This member is required.
ProductId *string
// The type of constraint.
// - LAUNCH
// - NOTIFICATION
// - RESOURCE_UPDATE
// - STACKSET
// - TEMPLATE
//
// This member is required.
Type *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The description of the constraint.
Description *string
noSmithyDocumentSerde
}
type CreateConstraintOutput struct {
// Information about the constraint.
ConstraintDetail *types.ConstraintDetail
// The constraint parameters.
ConstraintParameters *string
// The status of the current request.
Status types.Status
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateConstraintMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateConstraint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateConstraint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateConstraintMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateConstraintValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateConstraint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateConstraint struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateConstraint) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateConstraint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateConstraintInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateConstraintInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateConstraintMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateConstraint{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateConstraint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateConstraint",
}
}
| 227 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a portfolio. A delegated admin is authorized to invoke this command.
func (c *Client) CreatePortfolio(ctx context.Context, params *CreatePortfolioInput, optFns ...func(*Options)) (*CreatePortfolioOutput, error) {
if params == nil {
params = &CreatePortfolioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreatePortfolio", params, optFns, c.addOperationCreatePortfolioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreatePortfolioOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreatePortfolioInput struct {
// The name to use for display purposes.
//
// This member is required.
DisplayName *string
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The name of the portfolio provider.
//
// This member is required.
ProviderName *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The description of the portfolio.
Description *string
// One or more tags.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreatePortfolioOutput struct {
// Information about the portfolio.
PortfolioDetail *types.PortfolioDetail
// Information about the tags associated with the portfolio.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreatePortfolioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePortfolio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePortfolio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreatePortfolioMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreatePortfolioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePortfolio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreatePortfolio struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreatePortfolio) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreatePortfolio) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreatePortfolioInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreatePortfolioInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreatePortfolioMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreatePortfolio{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreatePortfolio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreatePortfolio",
}
}
| 188 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Shares the specified portfolio with the specified account or organization node.
// Shares to an organization node can only be created by the management account of
// an organization or by a delegated administrator. You can share portfolios to an
// organization, an organizational unit, or a specific account. Note that if a
// delegated admin is de-registered, they can no longer create portfolio shares.
// AWSOrganizationsAccess must be enabled in order to create a portfolio share to
// an organization node. You can't share a shared resource, including portfolios
// that contain a shared product. If the portfolio share with the specified account
// or organization node already exists, this action will have no effect and will
// not return an error. To update an existing share, you must use the
// UpdatePortfolioShare API instead. When you associate a principal with portfolio,
// a potential privilege escalation path may occur when that portfolio is then
// shared with other accounts. For a user in a recipient account who is not an
// Service Catalog Admin, but still has the ability to create Principals
// (Users/Groups/Roles), that user could create a role that matches a principal
// name association for the portfolio. Although this user may not know which
// principal names are associated through Service Catalog, they may be able to
// guess the user. If this potential escalation path is a concern, then Service
// Catalog recommends using PrincipalType as IAM . With this configuration, the
// PrincipalARN must already exist in the recipient account before it can be
// associated.
func (c *Client) CreatePortfolioShare(ctx context.Context, params *CreatePortfolioShareInput, optFns ...func(*Options)) (*CreatePortfolioShareOutput, error) {
if params == nil {
params = &CreatePortfolioShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreatePortfolioShare", params, optFns, c.addOperationCreatePortfolioShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreatePortfolioShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreatePortfolioShareInput struct {
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The Amazon Web Services account ID. For example, 123456789012 .
AccountId *string
// The organization node to whom you are going to share. When you pass
// OrganizationNode , it creates PortfolioShare for all of the Amazon Web Services
// accounts that are associated to the OrganizationNode . The output returns a
// PortfolioShareToken , which enables the administrator to monitor the status of
// the PortfolioShare creation process.
OrganizationNode *types.OrganizationNode
// Enables or disables Principal sharing when creating the portfolio share. If
// this flag is not provided, principal sharing is disabled. When you enable
// Principal Name Sharing for a portfolio share, the share recipient account end
// users with a principal that matches any of the associated IAM patterns can
// provision products from the portfolio. Once shared, the share recipient can view
// associations of PrincipalType : IAM_PATTERN on their portfolio. You can create
// the principals in the recipient account before or after creating the share.
SharePrincipals bool
// Enables or disables TagOptions sharing when creating the portfolio share. If
// this flag is not provided, TagOptions sharing is disabled.
ShareTagOptions bool
noSmithyDocumentSerde
}
type CreatePortfolioShareOutput struct {
// The portfolio shares a unique identifier that only returns if the portfolio is
// shared to an organization node.
PortfolioShareToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreatePortfolioShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePortfolioShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePortfolioShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreatePortfolioShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePortfolioShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreatePortfolioShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreatePortfolioShare",
}
}
| 174 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a product. A delegated admin is authorized to invoke this command. The
// user or role that performs this operation must have the
// cloudformation:GetTemplate IAM policy permission. This policy permission is
// required when using the ImportFromPhysicalId template source in the information
// data section.
func (c *Client) CreateProduct(ctx context.Context, params *CreateProductInput, optFns ...func(*Options)) (*CreateProductOutput, error) {
if params == nil {
params = &CreateProductInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProduct", params, optFns, c.addOperationCreateProductMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProductOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProductInput struct {
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The name of the product.
//
// This member is required.
Name *string
// The owner of the product.
//
// This member is required.
Owner *string
// The type of product.
//
// This member is required.
ProductType types.ProductType
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The description of the product.
Description *string
// The distributor of the product.
Distributor *string
// The configuration of the provisioning artifact.
ProvisioningArtifactParameters *types.ProvisioningArtifactProperties
// Specifies connection details for the created product and syncs the product to
// the connection source artifact. This automatically manages the product's
// artifacts based on changes to the source. The SourceConnection parameter
// consists of the following sub-fields.
// - Type
// - ConnectionParamters
SourceConnection *types.SourceConnection
// The support information about the product.
SupportDescription *string
// The contact email for product support.
SupportEmail *string
// The contact URL for product support. ^https?:\/\// / is the pattern used to
// validate SupportUrl.
SupportUrl *string
// One or more tags.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateProductOutput struct {
// Information about the product view.
ProductViewDetail *types.ProductViewDetail
// Information about the provisioning artifact.
ProvisioningArtifactDetail *types.ProvisioningArtifactDetail
// Information about the tags associated with the product.
Tags []types.Tag
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProductMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProduct{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProduct{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateProductMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateProductValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProduct(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateProduct struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateProduct) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateProduct) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateProductInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProductInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateProductMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProduct{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateProduct(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateProduct",
}
}
| 224 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a plan. A plan includes the list of resources to be created (when
// provisioning a new product) or modified (when updating a provisioned product)
// when the plan is executed. You can create one plan for each provisioned product.
// To create a plan for an existing provisioned product, the product status must be
// AVAILABLE or TAINTED. To view the resource changes in the change set, use
// DescribeProvisionedProductPlan . To create or modify the provisioned product,
// use ExecuteProvisionedProductPlan .
func (c *Client) CreateProvisionedProductPlan(ctx context.Context, params *CreateProvisionedProductPlanInput, optFns ...func(*Options)) (*CreateProvisionedProductPlanOutput, error) {
if params == nil {
params = &CreateProvisionedProductPlanInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProvisionedProductPlan", params, optFns, c.addOperationCreateProvisionedProductPlanMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProvisionedProductPlanOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProvisionedProductPlanInput struct {
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The name of the plan.
//
// This member is required.
PlanName *string
// The plan type.
//
// This member is required.
PlanType types.ProvisionedProductPlanType
// The product identifier.
//
// This member is required.
ProductId *string
// A user-friendly name for the provisioned product. This value must be unique for
// the Amazon Web Services account and cannot be updated after the product is
// provisioned.
//
// This member is required.
ProvisionedProductName *string
// The identifier of the provisioning artifact.
//
// This member is required.
ProvisioningArtifactId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// Passed to CloudFormation. The SNS topic ARNs to which to publish stack-related
// events.
NotificationArns []string
// The path identifier of the product. This value is optional if the product has a
// default path, and required if the product has more than one path. To list the
// paths for a product, use ListLaunchPaths .
PathId *string
// Parameters specified by the administrator that are required for provisioning
// the product.
ProvisioningParameters []types.UpdateProvisioningParameter
// One or more tags. If the plan is for an existing provisioned product, the
// product must have a RESOURCE_UPDATE constraint with
// TagUpdatesOnProvisionedProduct set to ALLOWED to allow tag updates.
Tags []types.Tag
noSmithyDocumentSerde
}
type CreateProvisionedProductPlanOutput struct {
// The plan identifier.
PlanId *string
// The name of the plan.
PlanName *string
// The product identifier.
ProvisionProductId *string
// The user-friendly name of the provisioned product.
ProvisionedProductName *string
// The identifier of the provisioning artifact.
ProvisioningArtifactId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProvisionedProductPlanMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProvisionedProductPlan{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProvisionedProductPlan{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateProvisionedProductPlanMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateProvisionedProductPlanValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProvisionedProductPlan(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateProvisionedProductPlan struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateProvisionedProductPlan) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateProvisionedProductPlan) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateProvisionedProductPlanInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProvisionedProductPlanInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateProvisionedProductPlanMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProvisionedProductPlan{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateProvisionedProductPlan(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateProvisionedProductPlan",
}
}
| 232 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a provisioning artifact (also known as a version) for the specified
// product. You cannot create a provisioning artifact for a product that was shared
// with you. The user or role that performs this operation must have the
// cloudformation:GetTemplate IAM policy permission. This policy permission is
// required when using the ImportFromPhysicalId template source in the information
// data section.
func (c *Client) CreateProvisioningArtifact(ctx context.Context, params *CreateProvisioningArtifactInput, optFns ...func(*Options)) (*CreateProvisioningArtifactOutput, error) {
if params == nil {
params = &CreateProvisioningArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateProvisioningArtifact", params, optFns, c.addOperationCreateProvisioningArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateProvisioningArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateProvisioningArtifactInput struct {
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The configuration for the provisioning artifact.
//
// This member is required.
Parameters *types.ProvisioningArtifactProperties
// The product identifier.
//
// This member is required.
ProductId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type CreateProvisioningArtifactOutput struct {
// Specify the template source with one of the following options, but not both.
// Keys accepted: [ LoadTemplateFromURL , ImportFromPhysicalId ]. Use the URL of
// the CloudFormation template in Amazon S3 or GitHub in JSON format.
// LoadTemplateFromURL Use the URL of the CloudFormation template in Amazon S3 or
// GitHub in JSON format. ImportFromPhysicalId Use the physical id of the resource
// that contains the template; currently supports CloudFormation stack ARN.
Info map[string]string
// Information about the provisioning artifact.
ProvisioningArtifactDetail *types.ProvisioningArtifactDetail
// The status of the current request.
Status types.Status
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateProvisioningArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateProvisioningArtifactMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateProvisioningArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProvisioningArtifact(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateProvisioningArtifact struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateProvisioningArtifact) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateProvisioningArtifact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateProvisioningArtifactInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateProvisioningArtifactInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateProvisioningArtifactMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateProvisioningArtifact{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateProvisioningArtifact",
}
}
| 195 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a self-service action.
func (c *Client) CreateServiceAction(ctx context.Context, params *CreateServiceActionInput, optFns ...func(*Options)) (*CreateServiceActionOutput, error) {
if params == nil {
params = &CreateServiceActionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateServiceAction", params, optFns, c.addOperationCreateServiceActionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateServiceActionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateServiceActionInput struct {
// The self-service action definition. Can be one of the following: Name The name
// of the Amazon Web Services Systems Manager document (SSM document). For example,
// AWS-RestartEC2Instance . If you are using a shared SSM document, you must
// provide the ARN instead of the name. Version The Amazon Web Services Systems
// Manager automation document version. For example, "Version": "1" AssumeRole The
// Amazon Resource Name (ARN) of the role that performs the self-service actions on
// your behalf. For example, "AssumeRole":
// "arn:aws:iam::12345678910:role/ActionRole" . To reuse the provisioned product
// launch role, set to "AssumeRole": "LAUNCH_ROLE" . Parameters The list of
// parameters in JSON format. For example:
// [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or
// [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}] .
//
// This member is required.
Definition map[string]string
// The service action definition type. For example, SSM_AUTOMATION .
//
// This member is required.
DefinitionType types.ServiceActionDefinitionType
// A unique identifier that you provide to ensure idempotency. If multiple
// requests differ only by the idempotency token, the same response is returned for
// each repeated request.
//
// This member is required.
IdempotencyToken *string
// The self-service action name.
//
// This member is required.
Name *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The self-service action description.
Description *string
noSmithyDocumentSerde
}
type CreateServiceActionOutput struct {
// An object containing information about the self-service action.
ServiceActionDetail *types.ServiceActionDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateServiceActionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateServiceAction{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateServiceAction{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addIdempotencyToken_opCreateServiceActionMiddleware(stack, options); err != nil {
return err
}
if err = addOpCreateServiceActionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServiceAction(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
type idempotencyToken_initializeOpCreateServiceAction struct {
tokenProvider IdempotencyTokenProvider
}
func (*idempotencyToken_initializeOpCreateServiceAction) ID() string {
return "OperationIdempotencyTokenAutoFill"
}
func (m *idempotencyToken_initializeOpCreateServiceAction) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) (
out middleware.InitializeOutput, metadata middleware.Metadata, err error,
) {
if m.tokenProvider == nil {
return next.HandleInitialize(ctx, in)
}
input, ok := in.Parameters.(*CreateServiceActionInput)
if !ok {
return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceActionInput ")
}
if input.IdempotencyToken == nil {
t, err := m.tokenProvider.GetIdempotencyToken()
if err != nil {
return out, metadata, err
}
input.IdempotencyToken = &t
}
return next.HandleInitialize(ctx, in)
}
func addIdempotencyToken_opCreateServiceActionMiddleware(stack *middleware.Stack, cfg Options) error {
return stack.Initialize.Add(&idempotencyToken_initializeOpCreateServiceAction{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before)
}
func newServiceMetadataMiddleware_opCreateServiceAction(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateServiceAction",
}
}
| 198 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a TagOption.
func (c *Client) CreateTagOption(ctx context.Context, params *CreateTagOptionInput, optFns ...func(*Options)) (*CreateTagOptionOutput, error) {
if params == nil {
params = &CreateTagOptionInput{}
}
result, metadata, err := c.invokeOperation(ctx, "CreateTagOption", params, optFns, c.addOperationCreateTagOptionMiddlewares)
if err != nil {
return nil, err
}
out := result.(*CreateTagOptionOutput)
out.ResultMetadata = metadata
return out, nil
}
type CreateTagOptionInput struct {
// The TagOption key.
//
// This member is required.
Key *string
// The TagOption value.
//
// This member is required.
Value *string
noSmithyDocumentSerde
}
type CreateTagOptionOutput struct {
// Information about the TagOption.
TagOptionDetail *types.TagOptionDetail
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationCreateTagOptionMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateTagOption{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateTagOption{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpCreateTagOptionValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateTagOption(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opCreateTagOption(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "CreateTagOption",
}
}
| 130 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified constraint. A delegated admin is authorized to invoke
// this command.
func (c *Client) DeleteConstraint(ctx context.Context, params *DeleteConstraintInput, optFns ...func(*Options)) (*DeleteConstraintOutput, error) {
if params == nil {
params = &DeleteConstraintInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteConstraint", params, optFns, c.addOperationDeleteConstraintMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteConstraintOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteConstraintInput struct {
// The identifier of the constraint.
//
// This member is required.
Id *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type DeleteConstraintOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteConstraintMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteConstraint{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteConstraint{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteConstraintValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteConstraint(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteConstraint(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeleteConstraint",
}
}
| 126 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified portfolio. You cannot delete a portfolio if it was shared
// with you or if it has associated products, users, constraints, or shared
// accounts. A delegated admin is authorized to invoke this command.
func (c *Client) DeletePortfolio(ctx context.Context, params *DeletePortfolioInput, optFns ...func(*Options)) (*DeletePortfolioOutput, error) {
if params == nil {
params = &DeletePortfolioInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePortfolio", params, optFns, c.addOperationDeletePortfolioMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePortfolioOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePortfolioInput struct {
// The portfolio identifier.
//
// This member is required.
Id *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type DeletePortfolioOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePortfolioMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePortfolio{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePortfolio{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePortfolioValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePortfolio(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeletePortfolio(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeletePortfolio",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/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"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Stops sharing the specified portfolio with the specified account or
// organization node. Shares to an organization node can only be deleted by the
// management account of an organization or by a delegated administrator. Note that
// if a delegated admin is de-registered, portfolio shares created from that
// account are removed.
func (c *Client) DeletePortfolioShare(ctx context.Context, params *DeletePortfolioShareInput, optFns ...func(*Options)) (*DeletePortfolioShareOutput, error) {
if params == nil {
params = &DeletePortfolioShareInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeletePortfolioShare", params, optFns, c.addOperationDeletePortfolioShareMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeletePortfolioShareOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeletePortfolioShareInput struct {
// The portfolio identifier.
//
// This member is required.
PortfolioId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// The Amazon Web Services account ID.
AccountId *string
// The organization node to whom you are going to stop sharing.
OrganizationNode *types.OrganizationNode
noSmithyDocumentSerde
}
type DeletePortfolioShareOutput struct {
// The portfolio share unique identifier. This will only be returned if delete is
// made to an organization node.
PortfolioShareToken *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeletePortfolioShareMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePortfolioShare{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePortfolioShare{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeletePortfolioShareValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePortfolioShare(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeletePortfolioShare(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeletePortfolioShare",
}
}
| 141 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified product. You cannot delete a product if it was shared
// with you or is associated with a portfolio. A delegated admin is authorized to
// invoke this command.
func (c *Client) DeleteProduct(ctx context.Context, params *DeleteProductInput, optFns ...func(*Options)) (*DeleteProductOutput, error) {
if params == nil {
params = &DeleteProductInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProduct", params, optFns, c.addOperationDeleteProductMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProductOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProductInput struct {
// The product identifier.
//
// This member is required.
Id *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type DeleteProductOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProductMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProduct{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProduct{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProductValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProduct(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteProduct(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeleteProduct",
}
}
| 127 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified plan.
func (c *Client) DeleteProvisionedProductPlan(ctx context.Context, params *DeleteProvisionedProductPlanInput, optFns ...func(*Options)) (*DeleteProvisionedProductPlanOutput, error) {
if params == nil {
params = &DeleteProvisionedProductPlanInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProvisionedProductPlan", params, optFns, c.addOperationDeleteProvisionedProductPlanMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProvisionedProductPlanOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProvisionedProductPlanInput struct {
// The plan identifier.
//
// This member is required.
PlanId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
// If set to true, Service Catalog stops managing the specified provisioned
// product even if it cannot delete the underlying resources.
IgnoreErrors bool
noSmithyDocumentSerde
}
type DeleteProvisionedProductPlanOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProvisionedProductPlanMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProvisionedProductPlan{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProvisionedProductPlan{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProvisionedProductPlanValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProvisionedProductPlan(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteProvisionedProductPlan(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeleteProvisionedProductPlan",
}
}
| 129 |
aws-sdk-go-v2 | aws | Go | // Code generated by smithy-go-codegen DO NOT EDIT.
package servicecatalog
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Deletes the specified provisioning artifact (also known as a version) for the
// specified product. You cannot delete a provisioning artifact associated with a
// product that was shared with you. You cannot delete the last provisioning
// artifact for a product, because a product must have at least one provisioning
// artifact.
func (c *Client) DeleteProvisioningArtifact(ctx context.Context, params *DeleteProvisioningArtifactInput, optFns ...func(*Options)) (*DeleteProvisioningArtifactOutput, error) {
if params == nil {
params = &DeleteProvisioningArtifactInput{}
}
result, metadata, err := c.invokeOperation(ctx, "DeleteProvisioningArtifact", params, optFns, c.addOperationDeleteProvisioningArtifactMiddlewares)
if err != nil {
return nil, err
}
out := result.(*DeleteProvisioningArtifactOutput)
out.ResultMetadata = metadata
return out, nil
}
type DeleteProvisioningArtifactInput struct {
// The product identifier.
//
// This member is required.
ProductId *string
// The identifier of the provisioning artifact.
//
// This member is required.
ProvisioningArtifactId *string
// The language code.
// - jp - Japanese
// - zh - Chinese
AcceptLanguage *string
noSmithyDocumentSerde
}
type DeleteProvisioningArtifactOutput struct {
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationDeleteProvisioningArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteProvisioningArtifact{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteProvisioningArtifactValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProvisioningArtifact(options.Region), middleware.Before); err != nil {
return err
}
if err = awsmiddleware.AddRecursionDetection(stack); err != nil {
return err
}
if err = addRequestIDRetrieverMiddleware(stack); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opDeleteProvisioningArtifact(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "servicecatalog",
OperationName: "DeleteProvisioningArtifact",
}
}
| 134 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.