Skip to content

Commit

Permalink
Add aws.iam#action and aws.iam#actionName
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-fowler committed Dec 4, 2023
1 parent 73074e9 commit b8b0058
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/SotoSmithyAWS/Smithy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ extension Smithy {
AwsProtocolsRestXmlTrait.self,
AwsProtocolsEc2QueryNameTrait.self,
// IAM traits
AwsIAMAction.self,
AwsIAMActionName.self,
AwsIAMConditionKeysTrait.self,
AwsIAMRequiredActionsTrait.self,
AwsIAMDefineConditionKeysTrait.self,
Expand Down
31 changes: 31 additions & 0 deletions Sources/SotoSmithyAWS/Traits/AwsIAMTraits.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,37 @@

import SotoSmithy

/// Indicates properties of a Smithy operation in AWS IAM.
public struct AwsIAMAction: StaticTrait {
public struct ActionResource: Codable {
let conditionKeys: [String]
}

public struct ActionResources: Codable {
let required: [String: ActionResource]
let optional: [String: ActionResource]
}

public static let staticName: ShapeId = "aws.iam#action"
public var selector: Selector { TypeSelector<OperationShape>() }
public let name: String
public let documentation: String
public let relativeDocumentation: String
public let requiredActions: [String]
public let resources: ActionResources
public let createsResources: [String]
}

/// Provides a custom IAM action name.
public struct AwsIAMActionName: SingleValueTrait {
public static let staticName: ShapeId = "aws.iam#actionName"
public var selector: Selector { TypeSelector<OperationShape>() }
public let value: String
public init(value: String) {
self.value = value
}
}

/// A brief description of what granting the user permission to invoke an operation would entail.
public struct AwsIAMActionPermissionDescriptionTrait: SingleValueTrait {
public static let staticName: ShapeId = "aws.iam#actionPermissionDescription"
Expand Down

0 comments on commit b8b0058

Please sign in to comment.