// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/swift-aws/aws-sdk-swift/blob/master/CodeGenerator/Sources/CodeGenerator/main.swift. DO NOT EDIT.

import Foundation
import AWSSDKSwiftCore

extension EC2InstanceConnect {

    public struct SendSSHPublicKeyRequest: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "AvailabilityZone", required: true, type: .string), 
            AWSShapeMember(label: "InstanceId", required: true, type: .string), 
            AWSShapeMember(label: "InstanceOSUser", required: true, type: .string), 
            AWSShapeMember(label: "SSHPublicKey", required: true, type: .string)
        ]

        /// The availability zone the EC2 instance was launched in.
        public let availabilityZone: String
        /// The EC2 instance you wish to publish the SSH key to.
        public let instanceId: String
        /// The OS user on the EC2 instance whom the key may be used to authenticate as.
        public let instanceOSUser: String
        /// The public key to be published to the instance. To use it after publication you must have the matching private key.
        public let sSHPublicKey: String

        public init(availabilityZone: String, instanceId: String, instanceOSUser: String, sSHPublicKey: String) {
            self.availabilityZone = availabilityZone
            self.instanceId = instanceId
            self.instanceOSUser = instanceOSUser
            self.sSHPublicKey = sSHPublicKey
        }

        public func validate(name: String) throws {
            try validate(self.availabilityZone, name:"availabilityZone", parent: name, max: 32)
            try validate(self.availabilityZone, name:"availabilityZone", parent: name, min: 6)
            try validate(self.availabilityZone, name:"availabilityZone", parent: name, pattern: "^(\\w+-){2,3}\\d+\\w+$")
            try validate(self.instanceId, name:"instanceId", parent: name, max: 32)
            try validate(self.instanceId, name:"instanceId", parent: name, min: 10)
            try validate(self.instanceId, name:"instanceId", parent: name, pattern: "^i-[a-f0-9]+$")
            try validate(self.instanceOSUser, name:"instanceOSUser", parent: name, max: 32)
            try validate(self.instanceOSUser, name:"instanceOSUser", parent: name, min: 1)
            try validate(self.instanceOSUser, name:"instanceOSUser", parent: name, pattern: "^[A-Za-z_][A-Za-z0-9\\@\\._-]{0,30}[A-Za-z0-9\\$_-]?$")
            try validate(self.sSHPublicKey, name:"sSHPublicKey", parent: name, max: 4096)
            try validate(self.sSHPublicKey, name:"sSHPublicKey", parent: name, min: 256)
        }

        private enum CodingKeys: String, CodingKey {
            case availabilityZone = "AvailabilityZone"
            case instanceId = "InstanceId"
            case instanceOSUser = "InstanceOSUser"
            case sSHPublicKey = "SSHPublicKey"
        }
    }

    public struct SendSSHPublicKeyResponse: AWSShape {
        public static var _members: [AWSShapeMember] = [
            AWSShapeMember(label: "RequestId", required: false, type: .string), 
            AWSShapeMember(label: "Success", required: false, type: .boolean)
        ]

        /// The request ID as logged by EC2 Connect. Please provide this when contacting AWS Support.
        public let requestId: String?
        /// Indicates request success.
        public let success: Bool?

        public init(requestId: String? = nil, success: Bool? = nil) {
            self.requestId = requestId
            self.success = success
        }

        private enum CodingKeys: String, CodingKey {
            case requestId = "RequestId"
            case success = "Success"
        }
    }
}
