import * as HttpClient from "effect/unstable/http/HttpClient";
import * as redacted from "effect/Redacted";
import * as S from "effect/Schema";
import * as stream from "effect/Stream";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
import { SensitiveString } from "../sensitive.js";
const svc = T.AwsApiService({
    sdkId: "AccessAnalyzer",
    serviceShapeName: "AccessAnalyzer",
});
const auth = T.AwsAuthSigv4({ name: "access-analyzer" });
const ver = T.ServiceVersion("2019-11-01");
const proto = T.AwsProtocolsRestJson1();
const rules = T.EndpointResolver((p, _) => {
    const { Region, UseDualStack = false, UseFIPS = false, Endpoint } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://access-analyzer-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        if (_.getAttr(PartitionResult, "name") === "aws-us-gov") {
                            return e(`https://access-analyzer.${Region}.amazonaws.com`);
                        }
                        return e(`https://access-analyzer-fips.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
                    }
                    return err("FIPS is enabled but this partition does not support FIPS");
                }
                if (UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://access-analyzer.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://access-analyzer.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const ApplyArchiveRuleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    ruleName: S.String,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/archive-rule" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ApplyArchiveRuleRequest",
});
export const ApplyArchiveRuleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "ApplyArchiveRuleResponse",
});
export const ValidationExceptionField = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ name: S.String, message: S.String })).annotate({
    identifier: "ValidationExceptionField",
});
export const ValidationExceptionFieldList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ValidationExceptionField);
export const CancelPolicyGenerationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ jobId: S.String.pipe(T.HttpLabel("jobId")) }).pipe(T.all(T.Http({ method: "PUT", uri: "/policy/generation/{jobId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CancelPolicyGenerationRequest",
});
export const CancelPolicyGenerationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "CancelPolicyGenerationResponse",
});
export const ActionsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ResourcesList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Access = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    actions: S.optional(ActionsList),
    resources: S.optional(ResourcesList),
})).annotate({ identifier: "Access" });
export const AccessList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Access);
export const CheckAccessNotGrantedRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    policyDocument: SensitiveString,
    access: AccessList,
    policyType: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/policy/check-access-not-granted" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CheckAccessNotGrantedRequest",
});
export const ReasonSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    description: S.optional(S.String),
    statementIndex: S.optional(S.Number),
    statementId: S.optional(S.String),
})).annotate({ identifier: "ReasonSummary" });
export const ReasonSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ReasonSummary);
export const CheckAccessNotGrantedResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    result: S.optional(S.String),
    message: S.optional(S.String),
    reasons: S.optional(ReasonSummaryList),
})).annotate({
    identifier: "CheckAccessNotGrantedResponse",
});
export const CheckNoNewAccessRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    newPolicyDocument: SensitiveString,
    existingPolicyDocument: SensitiveString,
    policyType: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/policy/check-no-new-access" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CheckNoNewAccessRequest",
});
export const CheckNoNewAccessResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    result: S.optional(S.String),
    message: S.optional(S.String),
    reasons: S.optional(ReasonSummaryList),
})).annotate({
    identifier: "CheckNoNewAccessResponse",
});
export const CheckNoPublicAccessRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ policyDocument: SensitiveString, resourceType: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/policy/check-no-public-access" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CheckNoPublicAccessRequest",
});
export const CheckNoPublicAccessResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    result: S.optional(S.String),
    message: S.optional(S.String),
    reasons: S.optional(ReasonSummaryList),
})).annotate({
    identifier: "CheckNoPublicAccessResponse",
});
export const EbsUserIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const EbsGroupList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const EbsSnapshotConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    userIds: S.optional(EbsUserIdList),
    groups: S.optional(EbsGroupList),
    kmsKeyId: S.optional(S.String),
})).annotate({
    identifier: "EbsSnapshotConfiguration",
});
export const EcrRepositoryConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ repositoryPolicy: S.optional(S.String) })).annotate({
    identifier: "EcrRepositoryConfiguration",
});
export const IamRoleConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ trustPolicy: S.optional(S.String) })).annotate({
    identifier: "IamRoleConfiguration",
});
export const EfsFileSystemConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ fileSystemPolicy: S.optional(S.String) })).annotate({
    identifier: "EfsFileSystemConfiguration",
});
export const KmsKeyPoliciesMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const KmsGrantOperationsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const KmsConstraintsMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const KmsGrantConstraints = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    encryptionContextEquals: S.optional(KmsConstraintsMap),
    encryptionContextSubset: S.optional(KmsConstraintsMap),
})).annotate({
    identifier: "KmsGrantConstraints",
});
export const KmsGrantConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    operations: KmsGrantOperationsList,
    granteePrincipal: S.String,
    retiringPrincipal: S.optional(S.String),
    constraints: S.optional(KmsGrantConstraints),
    issuingAccount: S.String,
})).annotate({
    identifier: "KmsGrantConfiguration",
});
export const KmsGrantConfigurationsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(KmsGrantConfiguration);
export const KmsKeyConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    keyPolicies: S.optional(KmsKeyPoliciesMap),
    grants: S.optional(KmsGrantConfigurationsList),
})).annotate({
    identifier: "KmsKeyConfiguration",
});
export const RdsDbClusterSnapshotAccountIdsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const RdsDbClusterSnapshotAttributeValue = 
/*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ accountIds: RdsDbClusterSnapshotAccountIdsList }),
]);
export const RdsDbClusterSnapshotAttributesMap = 
/*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, RdsDbClusterSnapshotAttributeValue.pipe(S.optional));
export const RdsDbClusterSnapshotConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributes: S.optional(RdsDbClusterSnapshotAttributesMap),
    kmsKeyId: S.optional(S.String),
})).annotate({
    identifier: "RdsDbClusterSnapshotConfiguration",
});
export const RdsDbSnapshotAccountIdsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const RdsDbSnapshotAttributeValue = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ accountIds: RdsDbSnapshotAccountIdsList }),
]);
export const RdsDbSnapshotAttributesMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, RdsDbSnapshotAttributeValue.pipe(S.optional));
export const RdsDbSnapshotConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributes: S.optional(RdsDbSnapshotAttributesMap),
    kmsKeyId: S.optional(S.String),
})).annotate({
    identifier: "RdsDbSnapshotConfiguration",
});
export const SecretsManagerSecretConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    kmsKeyId: S.optional(S.String),
    secretPolicy: S.optional(S.String),
})).annotate({
    identifier: "SecretsManagerSecretConfiguration",
});
export const AclGrantee = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ id: S.String }),
    S.Struct({ uri: S.String }),
]);
export const S3BucketAclGrantConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ permission: S.String, grantee: AclGrantee })).annotate({
    identifier: "S3BucketAclGrantConfiguration",
});
export const S3BucketAclGrantConfigurationsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S3BucketAclGrantConfiguration);
export const S3PublicAccessBlockConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ignorePublicAcls: S.Boolean, restrictPublicBuckets: S.Boolean })).annotate({
    identifier: "S3PublicAccessBlockConfiguration",
});
export const VpcConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ vpcId: S.String })).annotate({
    identifier: "VpcConfiguration",
});
export const InternetConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "InternetConfiguration",
});
export const NetworkOriginConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ vpcConfiguration: VpcConfiguration }),
    S.Struct({ internetConfiguration: InternetConfiguration }),
]);
export const S3AccessPointConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPointPolicy: S.optional(S.String),
    publicAccessBlock: S.optional(S3PublicAccessBlockConfiguration),
    networkOrigin: S.optional(NetworkOriginConfiguration),
})).annotate({
    identifier: "S3AccessPointConfiguration",
});
export const S3AccessPointConfigurationsMap = 
/*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S3AccessPointConfiguration.pipe(S.optional));
export const S3BucketConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    bucketPolicy: S.optional(S.String),
    bucketAclGrants: S.optional(S3BucketAclGrantConfigurationsList),
    bucketPublicAccessBlock: S.optional(S3PublicAccessBlockConfiguration),
    accessPoints: S.optional(S3AccessPointConfigurationsMap),
})).annotate({
    identifier: "S3BucketConfiguration",
});
export const SnsTopicConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ topicPolicy: S.optional(S.String) })).annotate({
    identifier: "SnsTopicConfiguration",
});
export const SqsQueueConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ queuePolicy: S.optional(S.String) })).annotate({
    identifier: "SqsQueueConfiguration",
});
export const S3ExpressDirectoryAccessPointConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPointPolicy: S.optional(S.String),
    networkOrigin: S.optional(NetworkOriginConfiguration),
})).annotate({
    identifier: "S3ExpressDirectoryAccessPointConfiguration",
});
export const S3ExpressDirectoryAccessPointConfigurationsMap = 
/*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S3ExpressDirectoryAccessPointConfiguration.pipe(S.optional));
export const S3ExpressDirectoryBucketConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    bucketPolicy: S.optional(S.String),
    accessPoints: S.optional(S3ExpressDirectoryAccessPointConfigurationsMap),
})).annotate({
    identifier: "S3ExpressDirectoryBucketConfiguration",
});
export const DynamodbStreamConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ streamPolicy: S.optional(S.String) })).annotate({
    identifier: "DynamodbStreamConfiguration",
});
export const DynamodbTableConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tablePolicy: S.optional(S.String) })).annotate({
    identifier: "DynamodbTableConfiguration",
});
export const Configuration = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ ebsSnapshot: EbsSnapshotConfiguration }),
    S.Struct({ ecrRepository: EcrRepositoryConfiguration }),
    S.Struct({ iamRole: IamRoleConfiguration }),
    S.Struct({ efsFileSystem: EfsFileSystemConfiguration }),
    S.Struct({ kmsKey: KmsKeyConfiguration }),
    S.Struct({ rdsDbClusterSnapshot: RdsDbClusterSnapshotConfiguration }),
    S.Struct({ rdsDbSnapshot: RdsDbSnapshotConfiguration }),
    S.Struct({ secretsManagerSecret: SecretsManagerSecretConfiguration }),
    S.Struct({ s3Bucket: S3BucketConfiguration }),
    S.Struct({ snsTopic: SnsTopicConfiguration }),
    S.Struct({ sqsQueue: SqsQueueConfiguration }),
    S.Struct({ s3ExpressDirectoryBucket: S3ExpressDirectoryBucketConfiguration }),
    S.Struct({ dynamodbStream: DynamodbStreamConfiguration }),
    S.Struct({ dynamodbTable: DynamodbTableConfiguration }),
]);
export const ConfigurationsMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, Configuration.pipe(S.optional));
export const CreateAccessPreviewRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    configurations: ConfigurationsMap,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/access-preview" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateAccessPreviewRequest",
});
export const CreateAccessPreviewResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ id: S.String })).annotate({
    identifier: "CreateAccessPreviewResponse",
});
export const GenerateFindingRecommendationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    id: S.String.pipe(T.HttpLabel("id")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/recommendation/{id}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GenerateFindingRecommendationRequest",
});
export const GenerateFindingRecommendationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "GenerateFindingRecommendationResponse",
});
export const GetAccessPreviewRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPreviewId: S.String.pipe(T.HttpLabel("accessPreviewId")),
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/access-preview/{accessPreviewId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAccessPreviewRequest",
});
export const AccessPreviewStatusReason = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ code: S.String })).annotate({
    identifier: "AccessPreviewStatusReason",
});
export const AccessPreview = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    analyzerArn: S.String,
    configurations: ConfigurationsMap,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: S.String,
    statusReason: S.optional(AccessPreviewStatusReason),
})).annotate({ identifier: "AccessPreview" });
export const GetAccessPreviewResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ accessPreview: AccessPreview })).annotate({
    identifier: "GetAccessPreviewResponse",
});
export const GetAnalyzedResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    resourceArn: S.String.pipe(T.HttpQuery("resourceArn")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/analyzed-resource" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAnalyzedResourceRequest",
});
export const ActionList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SharedViaList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const AnalyzedResource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String,
    resourceType: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    analyzedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    isPublic: S.Boolean,
    actions: S.optional(ActionList),
    sharedVia: S.optional(SharedViaList),
    status: S.optional(S.String),
    resourceOwnerAccount: S.String,
    error: S.optional(S.String),
})).annotate({
    identifier: "AnalyzedResource",
});
export const GetAnalyzedResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resource: S.optional(AnalyzedResource) })).annotate({
    identifier: "GetAnalyzedResourceResponse",
});
export const GetFindingRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    id: S.String.pipe(T.HttpLabel("id")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/finding/{id}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetFindingRequest",
});
export const PrincipalMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const ConditionKeyMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const FindingSourceDetail = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPointArn: S.optional(S.String),
    accessPointAccount: S.optional(S.String),
})).annotate({
    identifier: "FindingSourceDetail",
});
export const FindingSource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.String, detail: S.optional(FindingSourceDetail) })).annotate({ identifier: "FindingSource" });
export const FindingSourceList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FindingSource);
export const Finding = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    principal: S.optional(PrincipalMap),
    action: S.optional(ActionList),
    resource: S.optional(S.String),
    isPublic: S.optional(S.Boolean),
    resourceType: S.String,
    condition: ConditionKeyMap,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    analyzedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: S.String,
    resourceOwnerAccount: S.String,
    error: S.optional(S.String),
    sources: S.optional(FindingSourceList),
    resourceControlPolicyRestriction: S.optional(S.String),
})).annotate({ identifier: "Finding" });
export const GetFindingResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ finding: S.optional(Finding) })).annotate({
    identifier: "GetFindingResponse",
});
export const GetFindingRecommendationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    id: S.String.pipe(T.HttpLabel("id")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/recommendation/{id}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetFindingRecommendationRequest",
});
export const RecommendationError = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ code: S.String, message: S.String })).annotate({
    identifier: "RecommendationError",
});
export const UnusedPermissionsRecommendedStep = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    policyUpdatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    recommendedAction: S.String,
    recommendedPolicy: S.optional(S.String),
    existingPolicyId: S.optional(S.String),
})).annotate({
    identifier: "UnusedPermissionsRecommendedStep",
});
export const RecommendedStep = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({
        unusedPermissionsRecommendedStep: UnusedPermissionsRecommendedStep,
    }),
]);
export const RecommendedStepList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(RecommendedStep);
export const GetFindingRecommendationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    startedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    completedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    nextToken: S.optional(S.String),
    error: S.optional(RecommendationError),
    resourceArn: S.String,
    recommendedSteps: S.optional(RecommendedStepList),
    recommendationType: S.String,
    status: S.String,
})).annotate({
    identifier: "GetFindingRecommendationResponse",
});
export const GetFindingsStatisticsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ analyzerArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/analyzer/findings/statistics" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetFindingsStatisticsRequest",
});
export const ResourceTypeDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    totalActivePublic: S.optional(S.Number),
    totalActiveCrossAccount: S.optional(S.Number),
    totalActiveErrors: S.optional(S.Number),
})).annotate({
    identifier: "ResourceTypeDetails",
});
export const ResourceTypeStatisticsMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, ResourceTypeDetails.pipe(S.optional));
export const ExternalAccessFindingsStatistics = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceTypeStatistics: S.optional(ResourceTypeStatisticsMap),
    totalActiveFindings: S.optional(S.Number),
    totalArchivedFindings: S.optional(S.Number),
    totalResolvedFindings: S.optional(S.Number),
})).annotate({
    identifier: "ExternalAccessFindingsStatistics",
});
export const InternalAccessResourceTypeDetails = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    totalActiveFindings: S.optional(S.Number),
    totalResolvedFindings: S.optional(S.Number),
    totalArchivedFindings: S.optional(S.Number),
})).annotate({
    identifier: "InternalAccessResourceTypeDetails",
});
export const InternalAccessResourceTypeStatisticsMap = 
/*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, InternalAccessResourceTypeDetails.pipe(S.optional));
export const InternalAccessFindingsStatistics = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceTypeStatistics: S.optional(InternalAccessResourceTypeStatisticsMap),
    totalActiveFindings: S.optional(S.Number),
    totalArchivedFindings: S.optional(S.Number),
    totalResolvedFindings: S.optional(S.Number),
})).annotate({
    identifier: "InternalAccessFindingsStatistics",
});
export const UnusedAccessTypeStatistics = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    unusedAccessType: S.optional(S.String),
    total: S.optional(S.Number),
})).annotate({
    identifier: "UnusedAccessTypeStatistics",
});
export const UnusedAccessTypeStatisticsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(UnusedAccessTypeStatistics);
export const FindingAggregationAccountDetailsMap = 
/*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.Number.pipe(S.optional));
export const FindingAggregationAccountDetails = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    account: S.optional(S.String),
    numberOfActiveFindings: S.optional(S.Number),
    details: S.optional(FindingAggregationAccountDetailsMap),
})).annotate({
    identifier: "FindingAggregationAccountDetails",
});
export const AccountAggregations = /*@__PURE__*/ /*#__PURE__*/ S.Array(FindingAggregationAccountDetails);
export const UnusedAccessFindingsStatistics = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    unusedAccessTypeStatistics: S.optional(UnusedAccessTypeStatisticsList),
    topAccounts: S.optional(AccountAggregations),
    totalActiveFindings: S.optional(S.Number),
    totalArchivedFindings: S.optional(S.Number),
    totalResolvedFindings: S.optional(S.Number),
})).annotate({
    identifier: "UnusedAccessFindingsStatistics",
});
export const FindingsStatistics = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({
        externalAccessFindingsStatistics: ExternalAccessFindingsStatistics,
    }),
    S.Struct({
        internalAccessFindingsStatistics: InternalAccessFindingsStatistics,
    }),
    S.Struct({ unusedAccessFindingsStatistics: UnusedAccessFindingsStatistics }),
]);
export const FindingsStatisticsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FindingsStatistics);
export const GetFindingsStatisticsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    findingsStatistics: S.optional(FindingsStatisticsList),
    lastUpdatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "GetFindingsStatisticsResponse",
});
export const GetFindingV2Request = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    id: S.String.pipe(T.HttpLabel("id")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/findingv2/{id}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetFindingV2Request",
});
export const InternalAccessDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    action: S.optional(ActionList),
    condition: S.optional(ConditionKeyMap),
    principal: S.optional(PrincipalMap),
    principalOwnerAccount: S.optional(S.String),
    accessType: S.optional(S.String),
    principalType: S.optional(S.String),
    sources: S.optional(FindingSourceList),
    resourceControlPolicyRestriction: S.optional(S.String),
    serviceControlPolicyRestriction: S.optional(S.String),
})).annotate({
    identifier: "InternalAccessDetails",
});
export const ExternalAccessDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    action: S.optional(ActionList),
    condition: ConditionKeyMap,
    isPublic: S.optional(S.Boolean),
    principal: S.optional(PrincipalMap),
    sources: S.optional(FindingSourceList),
    resourceControlPolicyRestriction: S.optional(S.String),
})).annotate({
    identifier: "ExternalAccessDetails",
});
export const UnusedAction = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    action: S.String,
    lastAccessed: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({ identifier: "UnusedAction" });
export const UnusedActionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(UnusedAction);
export const UnusedPermissionDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    actions: S.optional(UnusedActionList),
    serviceNamespace: S.String,
    lastAccessed: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "UnusedPermissionDetails",
});
export const UnusedIamUserAccessKeyDetails = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessKeyId: S.String,
    lastAccessed: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "UnusedIamUserAccessKeyDetails",
});
export const UnusedIamRoleDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    lastAccessed: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "UnusedIamRoleDetails",
});
export const UnusedIamUserPasswordDetails = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    lastAccessed: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "UnusedIamUserPasswordDetails",
});
export const FindingDetails = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ internalAccessDetails: InternalAccessDetails }),
    S.Struct({ externalAccessDetails: ExternalAccessDetails }),
    S.Struct({ unusedPermissionDetails: UnusedPermissionDetails }),
    S.Struct({ unusedIamUserAccessKeyDetails: UnusedIamUserAccessKeyDetails }),
    S.Struct({ unusedIamRoleDetails: UnusedIamRoleDetails }),
    S.Struct({ unusedIamUserPasswordDetails: UnusedIamUserPasswordDetails }),
]);
export const FindingDetailsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FindingDetails);
export const GetFindingV2Response = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    error: S.optional(S.String),
    id: S.String,
    nextToken: S.optional(S.String),
    resource: S.optional(S.String),
    resourceType: S.String,
    resourceOwnerAccount: S.String,
    status: S.String,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    findingDetails: FindingDetailsList,
    findingType: S.optional(S.String),
})).annotate({
    identifier: "GetFindingV2Response",
});
export const GetGeneratedPolicyRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    jobId: S.String.pipe(T.HttpLabel("jobId")),
    includeResourcePlaceholders: S.optional(S.Boolean).pipe(T.HttpQuery("includeResourcePlaceholders")),
    includeServiceLevelTemplate: S.optional(S.Boolean).pipe(T.HttpQuery("includeServiceLevelTemplate")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/policy/generation/{jobId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetGeneratedPolicyRequest",
});
export const JobError = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ code: S.String, message: S.String })).annotate({ identifier: "JobError" });
export const JobDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    jobId: S.String,
    status: S.String,
    startedOn: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    completedOn: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    jobError: S.optional(JobError),
})).annotate({ identifier: "JobDetails" });
export const RegionList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const TrailProperties = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    cloudTrailArn: S.String,
    regions: S.optional(RegionList),
    allRegions: S.optional(S.Boolean),
})).annotate({
    identifier: "TrailProperties",
});
export const TrailPropertiesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(TrailProperties);
export const CloudTrailProperties = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    trailProperties: TrailPropertiesList,
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    endTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({
    identifier: "CloudTrailProperties",
});
export const GeneratedPolicyProperties = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    isComplete: S.optional(S.Boolean),
    principalArn: S.String,
    cloudTrailProperties: S.optional(CloudTrailProperties),
})).annotate({
    identifier: "GeneratedPolicyProperties",
});
export const GeneratedPolicy = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ policy: S.String })).annotate({
    identifier: "GeneratedPolicy",
});
export const GeneratedPolicyList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GeneratedPolicy);
export const GeneratedPolicyResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    properties: GeneratedPolicyProperties,
    generatedPolicies: S.optional(GeneratedPolicyList),
})).annotate({
    identifier: "GeneratedPolicyResult",
});
export const GetGeneratedPolicyResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    jobDetails: JobDetails,
    generatedPolicyResult: GeneratedPolicyResult,
})).annotate({
    identifier: "GetGeneratedPolicyResponse",
});
export const ValueList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Criterion = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    eq: S.optional(ValueList),
    neq: S.optional(ValueList),
    contains: S.optional(ValueList),
    exists: S.optional(S.Boolean),
})).annotate({ identifier: "Criterion" });
export const FilterCriteriaMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, Criterion.pipe(S.optional));
export const ListAccessPreviewFindingsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPreviewId: S.String.pipe(T.HttpLabel("accessPreviewId")),
    analyzerArn: S.String,
    filter: S.optional(FilterCriteriaMap),
    nextToken: S.optional(S.String),
    maxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/access-preview/{accessPreviewId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAccessPreviewFindingsRequest",
});
export const AccessPreviewFinding = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    existingFindingId: S.optional(S.String),
    existingFindingStatus: S.optional(S.String),
    principal: S.optional(PrincipalMap),
    action: S.optional(ActionList),
    condition: S.optional(ConditionKeyMap),
    resource: S.optional(S.String),
    isPublic: S.optional(S.Boolean),
    resourceType: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    changeType: S.String,
    status: S.String,
    resourceOwnerAccount: S.String,
    error: S.optional(S.String),
    sources: S.optional(FindingSourceList),
    resourceControlPolicyRestriction: S.optional(S.String),
})).annotate({
    identifier: "AccessPreviewFinding",
});
export const AccessPreviewFindingsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AccessPreviewFinding);
export const ListAccessPreviewFindingsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    findings: AccessPreviewFindingsList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAccessPreviewFindingsResponse",
});
export const ListAccessPreviewsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String.pipe(T.HttpQuery("analyzerArn")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/access-preview" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAccessPreviewsRequest",
});
export const AccessPreviewSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    analyzerArn: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: S.String,
    statusReason: S.optional(AccessPreviewStatusReason),
})).annotate({
    identifier: "AccessPreviewSummary",
});
export const AccessPreviewsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AccessPreviewSummary);
export const ListAccessPreviewsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accessPreviews: AccessPreviewsList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAccessPreviewsResponse",
});
export const ListAnalyzedResourcesRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    resourceType: S.optional(S.String),
    nextToken: S.optional(S.String),
    maxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/analyzed-resource" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAnalyzedResourcesRequest",
});
export const AnalyzedResourceSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String,
    resourceOwnerAccount: S.String,
    resourceType: S.String,
})).annotate({
    identifier: "AnalyzedResourceSummary",
});
export const AnalyzedResourcesList = /*@__PURE__*/ /*#__PURE__*/ S.Array(AnalyzedResourceSummary);
export const ListAnalyzedResourcesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzedResources: AnalyzedResourcesList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAnalyzedResourcesResponse",
});
export const SortCriteria = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeName: S.optional(S.String),
    orderBy: S.optional(S.String),
})).annotate({ identifier: "SortCriteria" });
export const ListFindingsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    filter: S.optional(FilterCriteriaMap),
    sort: S.optional(SortCriteria),
    nextToken: S.optional(S.String),
    maxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/finding" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListFindingsRequest",
});
export const FindingSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    principal: S.optional(PrincipalMap),
    action: S.optional(ActionList),
    resource: S.optional(S.String),
    isPublic: S.optional(S.Boolean),
    resourceType: S.String,
    condition: ConditionKeyMap,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    analyzedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: S.String,
    resourceOwnerAccount: S.String,
    error: S.optional(S.String),
    sources: S.optional(FindingSourceList),
    resourceControlPolicyRestriction: S.optional(S.String),
})).annotate({ identifier: "FindingSummary" });
export const FindingsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(FindingSummary);
export const ListFindingsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ findings: FindingsList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListFindingsResponse",
});
export const ListFindingsV2Request = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    filter: S.optional(FilterCriteriaMap),
    maxResults: S.optional(S.Number),
    nextToken: S.optional(S.String),
    sort: S.optional(SortCriteria),
}).pipe(T.all(T.Http({ method: "POST", uri: "/findingv2" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListFindingsV2Request",
});
export const FindingSummaryV2 = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    error: S.optional(S.String),
    id: S.String,
    resource: S.optional(S.String),
    resourceType: S.String,
    resourceOwnerAccount: S.String,
    status: S.String,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    findingType: S.optional(S.String),
})).annotate({
    identifier: "FindingSummaryV2",
});
export const FindingsListV2 = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FindingSummaryV2);
export const ListFindingsV2Response = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ findings: FindingsListV2, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListFindingsV2Response",
});
export const ListPolicyGenerationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    principalArn: S.optional(S.String).pipe(T.HttpQuery("principalArn")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/policy/generation" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListPolicyGenerationsRequest",
});
export const PolicyGeneration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    jobId: S.String,
    principalArn: S.String,
    status: S.String,
    startedOn: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    completedOn: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "PolicyGeneration",
});
export const PolicyGenerationList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PolicyGeneration);
export const ListPolicyGenerationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    policyGenerations: PolicyGenerationList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListPolicyGenerationsResponse",
});
export const ListTagsForResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resourceArn: S.String.pipe(T.HttpLabel("resourceArn")) }).pipe(T.all(T.Http({ method: "GET", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagsForResourceRequest",
});
export const TagsMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tags: S.optional(TagsMap) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const PolicyGenerationDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ principalArn: S.String })).annotate({
    identifier: "PolicyGenerationDetails",
});
export const Trail = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    cloudTrailArn: S.String,
    regions: S.optional(RegionList),
    allRegions: S.optional(S.Boolean),
})).annotate({ identifier: "Trail" });
export const TrailList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Trail);
export const CloudTrailDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    trails: TrailList,
    accessRole: S.String,
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    endTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "CloudTrailDetails",
});
export const StartPolicyGenerationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    policyGenerationDetails: PolicyGenerationDetails,
    cloudTrailDetails: S.optional(CloudTrailDetails),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/policy/generation" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartPolicyGenerationRequest",
});
export const StartPolicyGenerationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ jobId: S.String })).annotate({
    identifier: "StartPolicyGenerationResponse",
});
export const StartResourceScanRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    resourceArn: S.String,
    resourceOwnerAccount: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/resource/scan" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartResourceScanRequest",
});
export const StartResourceScanResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "StartResourceScanResponse",
});
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tags: TagsMap,
}).pipe(T.all(T.Http({ method: "POST", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceRequest",
});
export const TagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "TagResourceResponse",
});
export const TagKeys = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tagKeys: TagKeys.pipe(T.HttpQuery("tagKeys")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceRequest",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceResponse",
});
export const FindingIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UpdateFindingsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerArn: S.String,
    status: S.String,
    ids: S.optional(FindingIdList),
    resourceArn: S.optional(S.String),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/finding" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateFindingsRequest",
});
export const UpdateFindingsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateFindingsResponse",
});
export const ValidatePolicyRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    locale: S.optional(S.String),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    policyDocument: S.String,
    policyType: S.String,
    validatePolicyResourceType: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/policy/validation" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ValidatePolicyRequest",
});
export const Substring = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ start: S.Number, length: S.Number })).annotate({ identifier: "Substring" });
export const PathElement = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ index: S.Number }),
    S.Struct({ key: S.String }),
    S.Struct({ substring: Substring }),
    S.Struct({ value: S.String }),
]);
export const PathElementList = /*@__PURE__*/ /*#__PURE__*/ S.Array(PathElement);
export const Position = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ line: S.Number, column: S.Number, offset: S.Number })).annotate({ identifier: "Position" });
export const Span = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ start: Position, end: Position })).annotate({ identifier: "Span" });
export const Location = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ path: PathElementList, span: Span })).annotate({ identifier: "Location" });
export const LocationList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Location);
export const ValidatePolicyFinding = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    findingDetails: S.String,
    findingType: S.String,
    issueCode: S.String,
    learnMoreLink: S.String,
    locations: LocationList,
})).annotate({
    identifier: "ValidatePolicyFinding",
});
export const ValidatePolicyFindingList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ValidatePolicyFinding);
export const ValidatePolicyResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    findings: ValidatePolicyFindingList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ValidatePolicyResponse",
});
export const InlineArchiveRule = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ruleName: S.String, filter: FilterCriteriaMap })).annotate({
    identifier: "InlineArchiveRule",
});
export const InlineArchiveRulesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(InlineArchiveRule);
export const AccountIdsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const TagsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(TagsMap);
export const AnalysisRuleCriteria = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accountIds: S.optional(AccountIdsList),
    resourceTags: S.optional(TagsList),
})).annotate({
    identifier: "AnalysisRuleCriteria",
});
export const AnalysisRuleCriteriaList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AnalysisRuleCriteria);
export const AnalysisRule = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ exclusions: S.optional(AnalysisRuleCriteriaList) })).annotate({ identifier: "AnalysisRule" });
export const UnusedAccessConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    unusedAccessAge: S.optional(S.Number),
    analysisRule: S.optional(AnalysisRule),
})).annotate({
    identifier: "UnusedAccessConfiguration",
});
export const ResourceTypeList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ResourceArnsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const InternalAccessAnalysisRuleCriteria = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    accountIds: S.optional(AccountIdsList),
    resourceTypes: S.optional(ResourceTypeList),
    resourceArns: S.optional(ResourceArnsList),
})).annotate({
    identifier: "InternalAccessAnalysisRuleCriteria",
});
export const InternalAccessAnalysisRuleCriteriaList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(InternalAccessAnalysisRuleCriteria);
export const InternalAccessAnalysisRule = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    inclusions: S.optional(InternalAccessAnalysisRuleCriteriaList),
})).annotate({
    identifier: "InternalAccessAnalysisRule",
});
export const InternalAccessConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ analysisRule: S.optional(InternalAccessAnalysisRule) })).annotate({
    identifier: "InternalAccessConfiguration",
});
export const AnalyzerConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ unusedAccess: UnusedAccessConfiguration }),
    S.Struct({ internalAccess: InternalAccessConfiguration }),
]);
export const CreateAnalyzerRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String,
    type: S.String,
    archiveRules: S.optional(InlineArchiveRulesList),
    tags: S.optional(TagsMap),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    configuration: S.optional(AnalyzerConfiguration),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/analyzer" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateAnalyzerRequest",
});
export const CreateAnalyzerResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ arn: S.optional(S.String) })).annotate({
    identifier: "CreateAnalyzerResponse",
});
export const GetAnalyzerRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ analyzerName: S.String.pipe(T.HttpLabel("analyzerName")) }).pipe(T.all(T.Http({ method: "GET", uri: "/analyzer/{analyzerName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAnalyzerRequest",
});
export const StatusReason = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ code: S.String })).annotate({ identifier: "StatusReason" });
export const AnalyzerSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    arn: S.String,
    name: S.String,
    type: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    lastResourceAnalyzed: S.optional(S.String),
    lastResourceAnalyzedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    tags: S.optional(TagsMap),
    status: S.String,
    statusReason: S.optional(StatusReason),
    configuration: S.optional(AnalyzerConfiguration),
})).annotate({
    identifier: "AnalyzerSummary",
});
export const GetAnalyzerResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ analyzer: AnalyzerSummary })).annotate({
    identifier: "GetAnalyzerResponse",
});
export const UpdateAnalyzerRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    configuration: S.optional(AnalyzerConfiguration),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/analyzer/{analyzerName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateAnalyzerRequest",
});
export const UpdateAnalyzerResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ configuration: S.optional(AnalyzerConfiguration) })).annotate({
    identifier: "UpdateAnalyzerResponse",
});
export const DeleteAnalyzerRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    clientToken: S.optional(S.String).pipe(T.HttpQuery("clientToken"), T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/analyzer/{analyzerName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteAnalyzerRequest",
});
export const DeleteAnalyzerResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteAnalyzerResponse",
});
export const ListAnalyzersRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    type: S.optional(S.String).pipe(T.HttpQuery("type")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/analyzer" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAnalyzersRequest",
});
export const AnalyzersList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AnalyzerSummary);
export const ListAnalyzersResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ analyzers: AnalyzersList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListAnalyzersResponse",
});
export const CreateArchiveRuleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    ruleName: S.String,
    filter: FilterCriteriaMap,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "PUT", uri: "/analyzer/{analyzerName}/archive-rule" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateArchiveRuleRequest",
});
export const CreateArchiveRuleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "CreateArchiveRuleResponse",
});
export const GetArchiveRuleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    ruleName: S.String.pipe(T.HttpLabel("ruleName")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/analyzer/{analyzerName}/archive-rule/{ruleName}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetArchiveRuleRequest",
});
export const ArchiveRuleSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ruleName: S.String,
    filter: FilterCriteriaMap,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({
    identifier: "ArchiveRuleSummary",
});
export const GetArchiveRuleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ archiveRule: ArchiveRuleSummary })).annotate({
    identifier: "GetArchiveRuleResponse",
});
export const UpdateArchiveRuleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    ruleName: S.String.pipe(T.HttpLabel("ruleName")),
    filter: FilterCriteriaMap,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({
    method: "PUT",
    uri: "/analyzer/{analyzerName}/archive-rule/{ruleName}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateArchiveRuleRequest",
});
export const UpdateArchiveRuleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateArchiveRuleResponse",
});
export const DeleteArchiveRuleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    ruleName: S.String.pipe(T.HttpLabel("ruleName")),
    clientToken: S.optional(S.String).pipe(T.HttpQuery("clientToken"), T.IdempotencyToken()),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/analyzer/{analyzerName}/archive-rule/{ruleName}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteArchiveRuleRequest",
});
export const DeleteArchiveRuleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteArchiveRuleResponse",
});
export const ListArchiveRulesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    analyzerName: S.String.pipe(T.HttpLabel("analyzerName")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/analyzer/{analyzerName}/archive-rule" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListArchiveRulesRequest",
});
export const ArchiveRulesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ArchiveRuleSummary);
export const ListArchiveRulesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    archiveRules: ArchiveRulesList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListArchiveRulesResponse",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { message: S.String }).pipe(C.withAuthError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", {
    message: S.String,
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withBadRequestError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", {
    message: S.String,
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable({ throttling: true })).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    message: S.String,
    reason: S.String,
    fieldList: S.optional(ValidationExceptionFieldList),
}).pipe(C.withBadRequestError) {
}
export class InvalidParameterException extends S.TaggedErrorClass()("InvalidParameterException", { message: S.String }).pipe(C.withBadRequestError) {
}
export class UnprocessableEntityException extends S.TaggedErrorClass()("UnprocessableEntityException", { message: S.String }, T.Retryable()).pipe(C.withBadRequestError, C.withRetryableError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withConflictError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withQuotaError) {
}
/**
 * Retroactively applies the archive rule to existing findings that meet the archive rule criteria.
 */
export const applyArchiveRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ApplyArchiveRuleRequest,
    output: ApplyArchiveRuleResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Cancels the requested policy generation.
 */
export const cancelPolicyGeneration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CancelPolicyGenerationRequest,
    output: CancelPolicyGenerationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Checks whether the specified access isn't allowed by a policy.
 */
export const checkAccessNotGranted = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CheckAccessNotGrantedRequest,
    output: CheckAccessNotGrantedResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        InvalidParameterException,
        ThrottlingException,
        UnprocessableEntityException,
        ValidationException,
    ],
}));
/**
 * Checks whether new access is allowed for an updated policy when compared to the existing policy.
 *
 * You can find examples for reference policies and learn how to set up and run a custom policy check for new access in the IAM Access Analyzer custom policy checks samples repository on GitHub. The reference policies in this repository are meant to be passed to the `existingPolicyDocument` request parameter.
 */
export const checkNoNewAccess = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CheckNoNewAccessRequest,
    output: CheckNoNewAccessResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        InvalidParameterException,
        ThrottlingException,
        UnprocessableEntityException,
        ValidationException,
    ],
}));
/**
 * Checks whether a resource policy can grant public access to the specified resource type.
 */
export const checkNoPublicAccess = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CheckNoPublicAccessRequest,
    output: CheckNoPublicAccessResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        InvalidParameterException,
        ThrottlingException,
        UnprocessableEntityException,
        ValidationException,
    ],
}));
/**
 * Creates an access preview that allows you to preview IAM Access Analyzer findings for your resource before deploying resource permissions.
 */
export const createAccessPreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAccessPreviewRequest,
    output: CreateAccessPreviewResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a recommendation for an unused permissions finding.
 */
export const generateFindingRecommendation = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GenerateFindingRecommendationRequest,
    output: GenerateFindingRecommendationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about an access preview for the specified analyzer.
 */
export const getAccessPreview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAccessPreviewRequest,
    output: GetAccessPreviewResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about a resource that was analyzed.
 *
 * This action is supported only for external access analyzers.
 */
export const getAnalyzedResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyzedResourceRequest,
    output: GetAnalyzedResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about the specified finding. GetFinding and GetFindingV2 both use `access-analyzer:GetFinding` in the `Action` element of an IAM policy statement. You must have permission to perform the `access-analyzer:GetFinding` action.
 *
 * GetFinding is supported only for external access analyzers. You must use GetFindingV2 for internal and unused access analyzers.
 */
export const getFinding = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetFindingRequest,
    output: GetFindingResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about a finding recommendation for the specified analyzer.
 */
export const getFindingRecommendation = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetFindingRecommendationRequest,
    output: GetFindingRecommendationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "recommendedSteps",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of aggregated finding statistics for an external access or unused access analyzer.
 */
export const getFindingsStatistics = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetFindingsStatisticsRequest,
    output: GetFindingsStatisticsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about the specified finding. GetFinding and GetFindingV2 both use `access-analyzer:GetFinding` in the `Action` element of an IAM policy statement. You must have permission to perform the `access-analyzer:GetFinding` action.
 */
export const getFindingV2 = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetFindingV2Request,
    output: GetFindingV2Response,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "findingDetails",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves the policy that was generated using `StartPolicyGeneration`.
 */
export const getGeneratedPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGeneratedPolicyRequest,
    output: GetGeneratedPolicyResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves a list of access preview findings generated by the specified access preview.
 */
export const listAccessPreviewFindings = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAccessPreviewFindingsRequest,
    output: ListAccessPreviewFindingsResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "findings",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of access previews for the specified analyzer.
 */
export const listAccessPreviews = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAccessPreviewsRequest,
    output: ListAccessPreviewsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "accessPreviews",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of resources of the specified type that have been analyzed by the specified analyzer.
 */
export const listAnalyzedResources = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAnalyzedResourcesRequest,
    output: ListAnalyzedResourcesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "analyzedResources",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use `access-analyzer:ListFindings` in the `Action` element of an IAM policy statement. You must have permission to perform the `access-analyzer:ListFindings` action.
 *
 * To learn about filter keys that you can use to retrieve a list of findings, see IAM Access Analyzer filter keys in the **IAM User Guide**.
 *
 * ListFindings is supported only for external access analyzers. You must use ListFindingsV2 for internal and unused access analyzers.
 */
export const listFindings = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListFindingsRequest,
    output: ListFindingsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "findings",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of findings generated by the specified analyzer. ListFindings and ListFindingsV2 both use `access-analyzer:ListFindings` in the `Action` element of an IAM policy statement. You must have permission to perform the `access-analyzer:ListFindings` action.
 *
 * To learn about filter keys that you can use to retrieve a list of findings, see IAM Access Analyzer filter keys in the **IAM User Guide**.
 */
export const listFindingsV2 = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListFindingsV2Request,
    output: ListFindingsV2Response,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "findings",
        pageSize: "maxResults",
    },
}));
/**
 * Lists all of the policy generations requested in the last seven days.
 */
export const listPolicyGenerations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListPolicyGenerationsRequest,
    output: ListPolicyGenerationsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "policyGenerations",
        pageSize: "maxResults",
    },
}));
/**
 * Retrieves a list of tags applied to the specified resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Starts the policy generation request.
 */
export const startPolicyGeneration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartPolicyGenerationRequest,
    output: StartPolicyGenerationResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Immediately starts a scan of the policies applied to the specified resource.
 *
 * This action is supported only for external access analyzers.
 */
export const startResourceScan = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartResourceScanRequest,
    output: StartResourceScanResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Adds a tag to the specified resource.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Removes a tag from the specified resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates the status for the specified findings.
 */
export const updateFindings = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateFindingsRequest,
    output: UpdateFindingsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices.
 */
export const validatePolicy = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ValidatePolicyRequest,
    output: ValidatePolicyResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "findings",
        pageSize: "maxResults",
    },
}));
/**
 * Creates an analyzer for your account.
 */
export const createAnalyzer = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAnalyzerRequest,
    output: CreateAnalyzerResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about the specified analyzer.
 */
export const getAnalyzer = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAnalyzerRequest,
    output: GetAnalyzerResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Modifies the configuration of an existing analyzer.
 *
 * This action is not supported for external access analyzers.
 */
export const updateAnalyzer = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAnalyzerRequest,
    output: UpdateAnalyzerResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes the specified analyzer. When you delete an analyzer, IAM Access Analyzer is disabled for the account or organization in the current or specific Region. All findings that were generated by the analyzer are deleted. You cannot undo this action.
 */
export const deleteAnalyzer = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAnalyzerRequest,
    output: DeleteAnalyzerResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves a list of analyzers.
 */
export const listAnalyzers = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAnalyzersRequest,
    output: ListAnalyzersResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "analyzers",
        pageSize: "maxResults",
    },
}));
/**
 * Creates an archive rule for the specified analyzer. Archive rules automatically archive new findings that meet the criteria you define when you create the rule.
 *
 * To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the **IAM User Guide**.
 */
export const createArchiveRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateArchiveRuleRequest,
    output: CreateArchiveRuleResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves information about an archive rule.
 *
 * To learn about filter keys that you can use to create an archive rule, see IAM Access Analyzer filter keys in the **IAM User Guide**.
 */
export const getArchiveRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetArchiveRuleRequest,
    output: GetArchiveRuleResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates the criteria and values for the specified archive rule.
 */
export const updateArchiveRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateArchiveRuleRequest,
    output: UpdateArchiveRuleResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes the specified archive rule.
 */
export const deleteArchiveRule = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteArchiveRuleRequest,
    output: DeleteArchiveRuleResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves a list of archive rules created for the specified analyzer.
 */
export const listArchiveRules = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListArchiveRulesRequest,
    output: ListArchiveRulesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "archiveRules",
        pageSize: "maxResults",
    },
}));
//# sourceMappingURL=accessanalyzer.js.map