Skip to content

Commit

Permalink
Add AwsIAMConditionKeyValueTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Mar 28, 2024
1 parent d17d7e2 commit cff79a1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Sources/SotoSmithyAWS/Smithy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ extension Smithy {
AwsIAMRequiredActionsTrait.self,
AwsIAMDefineConditionKeysTrait.self,
AwsIAMActionPermissionDescriptionTrait.self,
AwsDisableConditionKeyInferenceTrait.self,
AwsIAMConditionKeyValueTrait.self,
AwsIAMDisableConditionKeyInferenceTrait.self,
AwsIAMSupportPrincipalTypesTrait.self,
AwsIAMResourceTrait.self,
// API Gateway traits
Expand Down
14 changes: 12 additions & 2 deletions Sources/SotoSmithyAWS/Traits/AwsIAMTraits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,20 @@ public struct AwsIAMDefineConditionKeysTrait: SingleValueTrait {
}
}

/// Uses the associated member’s value for the specified condition key.
public struct AwsIAMConditionKeyValueTrait: SingleValueTrait {
public static let staticName: ShapeId = "aws.iam#conditionKeyValue"
public var selector: Selector { TypeSelector<MemberShape>() }
public let value: String
public init(value: String) {
self.value = value
}
}

/// Declares that the condition keys of a resource should not be inferred.
public struct AwsDisableConditionKeyInferenceTrait: StaticTrait {
public struct AwsIAMDisableConditionKeyInferenceTrait: StaticTrait {
public static let staticName: ShapeId = "aws.iam#disableConditionKeyInference"
public var selector: Selector { TypeSelector<ResourceShape>() }
public var selector: Selector { OrSelector(TypeSelector<ResourceShape>(), TypeSelector<ServiceShape>()) }
}

/// Other actions that the invoker must be authorized to perform when executing the targeted operation.
Expand Down

0 comments on commit cff79a1

Please sign in to comment.