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, SensitiveBlob } from "../sensitive.js";
const svc = T.AwsApiService({
    sdkId: "ACM",
    serviceShapeName: "CertificateManager",
});
const auth = T.AwsAuthSigv4({ name: "acm" });
const ver = T.ServiceVersion("2015-12-08");
const proto = T.AwsProtocolsAwsJson1_1();
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://acm-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://acm.${Region}.amazonaws.com`);
                        }
                        return e(`https://acm-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://acm.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://acm.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const Tag = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Key: S.String, Value: S.optional(S.String) })).annotate({ identifier: "Tag" });
export const TagList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Tag);
export const AddTagsToCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String, Tags: TagList }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "AddTagsToCertificateRequest",
});
export const AddTagsToCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "AddTagsToCertificateResponse",
});
export const ThrottlingReason = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ reason: S.optional(S.String), resource: S.optional(S.String) })).annotate({
    identifier: "ThrottlingReason",
});
export const ThrottlingReasonList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ThrottlingReason);
export const DeleteCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteCertificateRequest",
});
export const DeleteCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteCertificateResponse",
});
export const DescribeCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeCertificateRequest",
});
export const DomainList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const CertificateManagedBy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ValidationEmailList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const DomainStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RecordType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceRecord = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.String, Type: RecordType, Value: S.String })).annotate({ identifier: "ResourceRecord" });
export const HttpRedirect = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    RedirectFrom: S.optional(S.String),
    RedirectTo: S.optional(S.String),
})).annotate({ identifier: "HttpRedirect" });
export const ValidationMethod = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DomainValidation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    DomainName: S.String,
    ValidationEmails: S.optional(ValidationEmailList),
    ValidationDomain: S.optional(S.String),
    ValidationStatus: S.optional(DomainStatus),
    ResourceRecord: S.optional(ResourceRecord),
    HttpRedirect: S.optional(HttpRedirect),
    ValidationMethod: S.optional(ValidationMethod),
})).annotate({
    identifier: "DomainValidation",
});
export const DomainValidationList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(DomainValidation);
export const CertificateStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RevocationReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const KeyAlgorithm = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const InUseList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const FailureReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CertificateType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RenewalStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const RenewalSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    RenewalStatus: RenewalStatus,
    DomainValidationOptions: DomainValidationList,
    RenewalStatusReason: S.optional(FailureReason),
    UpdatedAt: S.Date.pipe(T.TimestampFormat("epoch-seconds")),
})).annotate({ identifier: "RenewalSummary" });
export const KeyUsageName = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const KeyUsage = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.optional(KeyUsageName) })).annotate({ identifier: "KeyUsage" });
export const KeyUsageList = /*@__PURE__*/ /*#__PURE__*/ S.Array(KeyUsage);
export const ExtendedKeyUsageName = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ExtendedKeyUsage = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: S.optional(ExtendedKeyUsageName),
    OID: S.optional(S.String),
})).annotate({
    identifier: "ExtendedKeyUsage",
});
export const ExtendedKeyUsageList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ExtendedKeyUsage);
export const RenewalEligibility = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CertificateTransparencyLoggingPreference = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const CertificateExport = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CertificateOptions = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateTransparencyLoggingPreference: S.optional(CertificateTransparencyLoggingPreference),
    Export: S.optional(CertificateExport),
})).annotate({
    identifier: "CertificateOptions",
});
export const CertificateDetail = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.optional(S.String),
    DomainName: S.optional(S.String),
    SubjectAlternativeNames: S.optional(DomainList),
    ManagedBy: S.optional(CertificateManagedBy),
    DomainValidationOptions: S.optional(DomainValidationList),
    Serial: S.optional(S.String),
    Subject: S.optional(S.String),
    Issuer: S.optional(S.String),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    IssuedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    ImportedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    Status: S.optional(CertificateStatus),
    RevokedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    RevocationReason: S.optional(RevocationReason),
    NotBefore: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    NotAfter: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    KeyAlgorithm: S.optional(KeyAlgorithm),
    SignatureAlgorithm: S.optional(S.String),
    InUseBy: S.optional(InUseList),
    FailureReason: S.optional(FailureReason),
    Type: S.optional(CertificateType),
    RenewalSummary: S.optional(RenewalSummary),
    KeyUsages: S.optional(KeyUsageList),
    ExtendedKeyUsages: S.optional(ExtendedKeyUsageList),
    CertificateAuthorityArn: S.optional(S.String),
    RenewalEligibility: S.optional(RenewalEligibility),
    Options: S.optional(CertificateOptions),
})).annotate({
    identifier: "CertificateDetail",
});
export const DescribeCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Certificate: S.optional(CertificateDetail) })).annotate({
    identifier: "DescribeCertificateResponse",
});
export const ExportCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String, Passphrase: SensitiveBlob }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ExportCertificateRequest",
});
export const ExportCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Certificate: S.optional(S.String),
    CertificateChain: S.optional(S.String),
    PrivateKey: S.optional(SensitiveString),
})).annotate({
    identifier: "ExportCertificateResponse",
});
export const GetAccountConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAccountConfigurationRequest",
});
export const ExpiryEventsConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ DaysBeforeExpiry: S.optional(S.Number) })).annotate({
    identifier: "ExpiryEventsConfiguration",
});
export const GetAccountConfigurationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ExpiryEvents: S.optional(ExpiryEventsConfiguration) })).annotate({
    identifier: "GetAccountConfigurationResponse",
});
export const GetCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetCertificateRequest",
});
export const GetCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Certificate: S.optional(S.String),
    CertificateChain: S.optional(S.String),
})).annotate({
    identifier: "GetCertificateResponse",
});
export const ImportCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.optional(S.String),
    Certificate: T.Blob,
    PrivateKey: SensitiveBlob,
    CertificateChain: S.optional(T.Blob),
    Tags: S.optional(TagList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ImportCertificateRequest",
});
export const ImportCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.optional(S.String) })).annotate({
    identifier: "ImportCertificateResponse",
});
export const CertificateStatuses = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(CertificateStatus);
export const ExtendedKeyUsageFilterList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ExtendedKeyUsageName);
export const KeyUsageFilterList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(KeyUsageName);
export const KeyAlgorithmList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(KeyAlgorithm);
export const Filters = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    extendedKeyUsage: S.optional(ExtendedKeyUsageFilterList),
    keyUsage: S.optional(KeyUsageFilterList),
    keyTypes: S.optional(KeyAlgorithmList),
    exportOption: S.optional(CertificateExport),
    managedBy: S.optional(CertificateManagedBy),
})).annotate({ identifier: "Filters" });
export const SortBy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SortOrder = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ListCertificatesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateStatuses: S.optional(CertificateStatuses),
    Includes: S.optional(Filters),
    NextToken: S.optional(S.String),
    MaxItems: S.optional(S.Number),
    SortBy: S.optional(SortBy),
    SortOrder: S.optional(SortOrder),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListCertificatesRequest",
});
export const KeyUsageNames = /*@__PURE__*/ /*#__PURE__*/ S.Array(KeyUsageName);
export const ExtendedKeyUsageNames = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ExtendedKeyUsageName);
export const CertificateSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.optional(S.String),
    DomainName: S.optional(S.String),
    SubjectAlternativeNameSummaries: S.optional(DomainList),
    HasAdditionalSubjectAlternativeNames: S.optional(S.Boolean),
    Status: S.optional(CertificateStatus),
    Type: S.optional(CertificateType),
    KeyAlgorithm: S.optional(KeyAlgorithm),
    KeyUsages: S.optional(KeyUsageNames),
    ExtendedKeyUsages: S.optional(ExtendedKeyUsageNames),
    ExportOption: S.optional(CertificateExport),
    InUse: S.optional(S.Boolean),
    Exported: S.optional(S.Boolean),
    RenewalEligibility: S.optional(RenewalEligibility),
    NotBefore: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    NotAfter: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    IssuedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    ImportedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    RevokedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    ManagedBy: S.optional(CertificateManagedBy),
})).annotate({
    identifier: "CertificateSummary",
});
export const CertificateSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(CertificateSummary);
export const ListCertificatesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    CertificateSummaryList: S.optional(CertificateSummaryList),
})).annotate({
    identifier: "ListCertificatesResponse",
});
export const ListTagsForCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagsForCertificateRequest",
});
export const ListTagsForCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Tags: S.optional(TagList) })).annotate({
    identifier: "ListTagsForCertificateResponse",
});
export const PutAccountConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ExpiryEvents: S.optional(ExpiryEventsConfiguration),
    IdempotencyToken: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "PutAccountConfigurationRequest",
});
export const PutAccountConfigurationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "PutAccountConfigurationResponse",
});
export const RemoveTagsFromCertificateRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String, Tags: TagList }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RemoveTagsFromCertificateRequest",
});
export const RemoveTagsFromCertificateResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "RemoveTagsFromCertificateResponse",
});
export const RenewCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RenewCertificateRequest",
});
export const RenewCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "RenewCertificateResponse",
});
export const DomainValidationOption = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ DomainName: S.String, ValidationDomain: S.String })).annotate({
    identifier: "DomainValidationOption",
});
export const DomainValidationOptionList = /*@__PURE__*/ /*#__PURE__*/ S.Array(DomainValidationOption);
export const RequestCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    DomainName: S.String,
    ValidationMethod: S.optional(ValidationMethod),
    SubjectAlternativeNames: S.optional(DomainList),
    IdempotencyToken: S.optional(S.String),
    DomainValidationOptions: S.optional(DomainValidationOptionList),
    Options: S.optional(CertificateOptions),
    CertificateAuthorityArn: S.optional(S.String),
    Tags: S.optional(TagList),
    KeyAlgorithm: S.optional(KeyAlgorithm),
    ManagedBy: S.optional(CertificateManagedBy),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RequestCertificateRequest",
});
export const RequestCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.optional(S.String) })).annotate({
    identifier: "RequestCertificateResponse",
});
export const ResendValidationEmailRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.String,
    Domain: S.String,
    ValidationDomain: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ResendValidationEmailRequest",
});
export const ResendValidationEmailResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "ResendValidationEmailResponse",
});
export const RevokeCertificateRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.String,
    RevocationReason: RevocationReason,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RevokeCertificateRequest",
});
export const RevokeCertificateResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.optional(S.String) })).annotate({
    identifier: "RevokeCertificateResponse",
});
export const CertificateFilterStatementList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.suspend(() => CertificateFilterStatement).annotate({
    identifier: "CertificateFilterStatement",
}));
export const ComparisonOperator = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CommonNameFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Value: S.String, ComparisonOperator: ComparisonOperator })).annotate({
    identifier: "CommonNameFilter",
});
export const SubjectFilter = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ CommonName: CommonNameFilter }),
]);
export const DnsNameFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Value: S.String, ComparisonOperator: ComparisonOperator })).annotate({ identifier: "DnsNameFilter" });
export const SubjectAlternativeNameFilter = /*@__PURE__*/ /*#__PURE__*/ S.Union([S.Struct({ DnsName: DnsNameFilter })]);
export const TimestampRange = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Start: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    End: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "TimestampRange" });
export const X509AttributeFilter = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ Subject: SubjectFilter }),
    S.Struct({ SubjectAlternativeName: SubjectAlternativeNameFilter }),
    S.Struct({ ExtendedKeyUsage: ExtendedKeyUsageName }),
    S.Struct({ KeyUsage: KeyUsageName }),
    S.Struct({ KeyAlgorithm: KeyAlgorithm }),
    S.Struct({ SerialNumber: S.String }),
    S.Struct({ NotAfter: TimestampRange }),
    S.Struct({ NotBefore: TimestampRange }),
]);
export const AcmCertificateMetadataFilter = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ Status: CertificateStatus }),
    S.Struct({ RenewalStatus: RenewalStatus }),
    S.Struct({ Type: CertificateType }),
    S.Struct({ InUse: S.Boolean }),
    S.Struct({ Exported: S.Boolean }),
    S.Struct({ ExportOption: CertificateExport }),
    S.Struct({ ManagedBy: CertificateManagedBy }),
    S.Struct({ ValidationMethod: ValidationMethod }),
]);
export const CertificateFilter = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ CertificateArn: S.String }),
    S.Struct({ X509AttributeFilter: X509AttributeFilter }),
    S.Struct({ AcmCertificateMetadataFilter: AcmCertificateMetadataFilter }),
]);
export const CertificateFilterStatement = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({
        And: S.suspend(() => CertificateFilterStatementList).annotate({
            identifier: "CertificateFilterStatementList",
        }),
    }),
    S.Struct({
        Or: S.suspend(() => CertificateFilterStatementList).annotate({
            identifier: "CertificateFilterStatementList",
        }),
    }),
    S.Struct({
        Not: S.suspend(() => CertificateFilterStatement).annotate({
            identifier: "CertificateFilterStatement",
        }),
    }),
    S.Struct({ Filter: CertificateFilter }),
]);
export const SearchCertificatesSortBy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SearchCertificatesSortOrder = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SearchCertificatesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    FilterStatement: S.optional(CertificateFilterStatement),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    SortBy: S.optional(SearchCertificatesSortBy),
    SortOrder: S.optional(SearchCertificatesSortOrder),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SearchCertificatesRequest",
});
export const DomainComponentList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const CustomAttribute = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ObjectIdentifier: S.optional(S.String),
    Value: S.optional(S.String),
})).annotate({
    identifier: "CustomAttribute",
});
export const CustomAttributeList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(CustomAttribute);
export const DistinguishedName = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CommonName: S.optional(S.String),
    DomainComponents: S.optional(DomainComponentList),
    Country: S.optional(S.String),
    CustomAttributes: S.optional(CustomAttributeList),
    DistinguishedNameQualifier: S.optional(S.String),
    GenerationQualifier: S.optional(S.String),
    GivenName: S.optional(S.String),
    Initials: S.optional(S.String),
    Locality: S.optional(S.String),
    Organization: S.optional(S.String),
    OrganizationalUnit: S.optional(S.String),
    Pseudonym: S.optional(S.String),
    SerialNumber: S.optional(S.String),
    State: S.optional(S.String),
    Surname: S.optional(S.String),
    Title: S.optional(S.String),
})).annotate({
    identifier: "DistinguishedName",
});
export const OtherName = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ObjectIdentifier: S.optional(S.String),
    Value: S.optional(S.String),
})).annotate({ identifier: "OtherName" });
export const GeneralName = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ DirectoryName: DistinguishedName }),
    S.Struct({ DnsName: S.String }),
    S.Struct({ IpAddress: S.String }),
    S.Struct({ OtherName: OtherName }),
    S.Struct({ RegisteredId: S.String }),
    S.Struct({ Rfc822Name: S.String }),
    S.Struct({ UniformResourceIdentifier: S.String }),
]);
export const GeneralNameList = /*@__PURE__*/ /*#__PURE__*/ S.Array(GeneralName);
export const X509Attributes = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Issuer: S.optional(DistinguishedName),
    Subject: S.optional(DistinguishedName),
    SubjectAlternativeNames: S.optional(GeneralNameList),
    ExtendedKeyUsages: S.optional(ExtendedKeyUsageNames),
    KeyAlgorithm: S.optional(KeyAlgorithm),
    KeyUsages: S.optional(KeyUsageNames),
    SerialNumber: S.optional(S.String),
    NotAfter: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    NotBefore: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({ identifier: "X509Attributes" });
export const AcmCertificateMetadata = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    Exported: S.optional(S.Boolean),
    ImportedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    InUse: S.optional(S.Boolean),
    IssuedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    RenewalEligibility: S.optional(RenewalEligibility),
    RevokedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    Status: S.optional(CertificateStatus),
    RenewalStatus: S.optional(RenewalStatus),
    Type: S.optional(CertificateType),
    ExportOption: S.optional(CertificateExport),
    ManagedBy: S.optional(CertificateManagedBy),
    ValidationMethod: S.optional(ValidationMethod),
})).annotate({
    identifier: "AcmCertificateMetadata",
});
export const CertificateMetadata = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ AcmCertificateMetadata: AcmCertificateMetadata }),
]);
export const CertificateSearchResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CertificateArn: S.optional(S.String),
    X509Attributes: S.optional(X509Attributes),
    CertificateMetadata: S.optional(CertificateMetadata),
})).annotate({
    identifier: "CertificateSearchResult",
});
export const CertificateSearchResultList = /*@__PURE__*/ /*#__PURE__*/ S.Array(CertificateSearchResult);
export const SearchCertificatesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Results: S.optional(CertificateSearchResultList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "SearchCertificatesResponse",
});
export const UpdateCertificateOptionsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ CertificateArn: S.String, Options: CertificateOptions }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateCertificateOptionsRequest",
});
export const UpdateCertificateOptionsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateCertificateOptionsResponse",
});
//# Errors
export class InvalidArnException extends S.TaggedErrorClass()("InvalidArnException", { message: S.optional(S.String) }) {
}
export class InvalidParameterException extends S.TaggedErrorClass()("InvalidParameterException", { message: S.optional(S.String) }) {
}
export class InvalidTagException extends S.TaggedErrorClass()("InvalidTagException", { message: S.optional(S.String) }) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.optional(S.String) }) {
}
export class TagPolicyException extends S.TaggedErrorClass()("TagPolicyException", { message: S.optional(S.String) }) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", {
    message: S.optional(S.String),
    throttlingReasons: S.optional(ThrottlingReasonList),
}, T.AwsQueryError({ code: "Throttling", httpResponseCode: 400 })).pipe(C.withBadRequestError, C.withThrottlingError, C.withRetryableError) {
}
export class TooManyTagsException extends S.TaggedErrorClass()("TooManyTagsException", { message: S.optional(S.String) }) {
}
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { Message: S.optional(S.String) }, T.AwsQueryError({ code: "AccessDenied", httpResponseCode: 403 })).pipe(C.withAuthError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.optional(S.String) }) {
}
export class ResourceInUseException extends S.TaggedErrorClass()("ResourceInUseException", { message: S.optional(S.String) }) {
}
export class RequestInProgressException extends S.TaggedErrorClass()("RequestInProgressException", { message: S.optional(S.String) }).pipe(C.withConflictError, C.withRetryableError) {
}
export class LimitExceededException extends S.TaggedErrorClass()("LimitExceededException", { message: S.optional(S.String) }).pipe(C.withQuotaError) {
}
export class InvalidArgsException extends S.TaggedErrorClass()("InvalidArgsException", { message: S.optional(S.String) }) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { message: S.optional(S.String) }, T.AwsQueryError({ code: "ValidationError", httpResponseCode: 400 })).pipe(C.withBadRequestError) {
}
export class InvalidDomainValidationOptionsException extends S.TaggedErrorClass()("InvalidDomainValidationOptionsException", { message: S.optional(S.String) }) {
}
export class InvalidStateException extends S.TaggedErrorClass()("InvalidStateException", { message: S.optional(S.String) }) {
}
/**
 * Adds one or more tags to an ACM certificate. Tags are labels that you can use to identify and organize your Amazon Web Services resources. Each tag consists of a `key` and an optional `value`. You specify the certificate on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair.
 *
 * You can apply a tag to just one certificate if you want to identify a specific characteristic of that certificate, or you can apply the same tag to multiple certificates if you want to filter for a common relationship among those certificates. Similarly, you can apply the same tag to multiple resources if you want to specify a relationship among those resources. For example, you can add the same tag to an ACM certificate and an Elastic Load Balancing load balancer to indicate that they are both used by the same website. For more information, see Tagging ACM certificates.
 *
 * To remove one or more tags, use the RemoveTagsFromCertificate action. To view all of the tags that have been applied to the certificate, use the ListTagsForCertificate action.
 */
export const addTagsToCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AddTagsToCertificateRequest,
    output: AddTagsToCertificateResponse,
    errors: [
        InvalidArnException,
        InvalidParameterException,
        InvalidTagException,
        ResourceNotFoundException,
        TagPolicyException,
        ThrottlingException,
        TooManyTagsException,
    ],
}));
/**
 * Deletes a certificate and its associated private key. If this action succeeds, the certificate is not available for use by Amazon Web Services services integrated with ACM. Deleting a certificate is eventually consistent. The may be a short delay before the certificate no longer appears in the list that can be displayed by calling the ListCertificates action or be retrieved by calling the GetCertificate action.
 *
 * You cannot delete an ACM certificate that is being used by another Amazon Web Services service. To delete a certificate that is in use, you must first remove the certificate association using the console or the CLI for the associated service.
 *
 * Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see Deleting Your Private CA in the *Private Certificate Authority User Guide*.
 *
 * Deleting a certificate issued by a private certificate authority (CA) has no effect on the CA. You will continue to be charged for the CA until it is deleted. For more information, see Deleting your private CA in the *Amazon Web Services Private Certificate Authority User Guide*.
 */
export const deleteCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteCertificateRequest,
    output: DeleteCertificateResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InvalidArnException,
        ResourceInUseException,
        ResourceNotFoundException,
        ThrottlingException,
    ],
}));
/**
 * Returns detailed metadata about the specified ACM certificate.
 *
 * If you have just created a certificate using the `RequestCertificate` action, there is a delay of several seconds before you can retrieve information about it.
 */
export const describeCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeCertificateRequest,
    output: DescribeCertificateResponse,
    errors: [InvalidArnException, ResourceNotFoundException],
}));
/**
 * Exports a private certificate issued by a private certificate authority (CA) or a public certificate for use anywhere. The exported file contains the certificate, the certificate chain, and the encrypted private key associated with the public key that is embedded in the certificate. For security, you must assign a passphrase for the private key when exporting it.
 *
 * For information about exporting and formatting a certificate using the ACM console or CLI, see Export a private certificate and Export a public certificate.
 *
 * ACM public certificates created prior to June 17, 2025 cannot be exported.
 */
export const exportCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ExportCertificateRequest,
    output: ExportCertificateResponse,
    errors: [
        InvalidArnException,
        RequestInProgressException,
        ResourceNotFoundException,
        ThrottlingException,
    ],
}));
/**
 * Returns the account configuration options associated with an Amazon Web Services account.
 */
export const getAccountConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAccountConfigurationRequest,
    output: GetAccountConfigurationResponse,
    errors: [AccessDeniedException, ThrottlingException],
}));
/**
 * Retrieves a certificate and its certificate chain. The certificate may be either a public or private certificate issued using the ACM `RequestCertificate` action, or a certificate imported into ACM using the `ImportCertificate` action. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use OpenSSL to decode the certificates and inspect individual fields.
 */
export const getCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetCertificateRequest,
    output: GetCertificateResponse,
    errors: [
        InvalidArnException,
        RequestInProgressException,
        ResourceNotFoundException,
    ],
}));
/**
 * Imports a certificate into Certificate Manager (ACM) to use with services that are integrated with ACM. Note that integrated services allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see Importing Certificates in the *Certificate Manager User Guide*.
 *
 * ACM does not provide managed renewal for certificates that you import.
 *
 * Note the following guidelines when importing third party certificates:
 *
 * - You must enter the private key that matches the certificate you are importing.
 *
 * - The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.
 *
 * - The private key must be no larger than 5 KB (5,120 bytes).
 *
 * - The certificate, private key, and certificate chain must be PEM-encoded.
 *
 * - The current time must be between the `Not Before` and `Not After` certificate fields.
 *
 * - The `Issuer` field must not be empty.
 *
 * - The OCSP authority URL, if present, must not exceed 1000 characters.
 *
 * - To import a new certificate, omit the `CertificateArn` argument. Include this argument only when you want to replace a previously imported certificate.
 *
 * - When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by `fileb://`. For example, you can specify a certificate saved in the `C:\temp` folder as `fileb://C:\temp\certificate_to_import.pem`. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs.
 *
 * - When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you're using.
 *
 * - The cryptographic algorithm of an imported certificate must match the algorithm of the signing CA. For example, if the signing CA key type is RSA, then the certificate key type must also be RSA.
 *
 * This operation returns the Amazon Resource Name (ARN) of the imported certificate.
 */
export const importCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ImportCertificateRequest,
    output: ImportCertificateResponse,
    errors: [
        ConflictException,
        InvalidArnException,
        InvalidParameterException,
        InvalidTagException,
        LimitExceededException,
        ResourceNotFoundException,
        TagPolicyException,
        TooManyTagsException,
    ],
}));
/**
 * Retrieves a list of certificate ARNs and domain names. You can request that only certificates that match a specific status be listed. You can also filter by specific attributes of the certificate. Default filtering returns only `RSA_2048` certificates. For more information, see Filters.
 */
export const listCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListCertificatesRequest,
    output: ListCertificatesResponse,
    errors: [InvalidArgsException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "CertificateSummaryList",
        pageSize: "MaxItems",
    },
}));
/**
 * Lists the tags that have been applied to the ACM certificate. Use the certificate's Amazon Resource Name (ARN) to specify the certificate. To add a tag to an ACM certificate, use the AddTagsToCertificate action. To delete a tag, use the RemoveTagsFromCertificate action.
 */
export const listTagsForCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForCertificateRequest,
    output: ListTagsForCertificateResponse,
    errors: [InvalidArnException, ResourceNotFoundException],
}));
/**
 * Adds or modifies account-level configurations in ACM.
 *
 * The supported configuration option is `DaysBeforeExpiry`. This option specifies the number of days prior to certificate expiration when ACM starts generating `EventBridge` events. ACM sends one event per day per certificate until the certificate expires. By default, accounts receive events starting 45 days before certificate expiration.
 */
export const putAccountConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutAccountConfigurationRequest,
    output: PutAccountConfigurationResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Remove one or more tags from an ACM certificate. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this function, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value.
 *
 * To add tags to a certificate, use the AddTagsToCertificate action. To view all of the tags that have been applied to a specific ACM certificate, use the ListTagsForCertificate action.
 */
export const removeTagsFromCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RemoveTagsFromCertificateRequest,
    output: RemoveTagsFromCertificateResponse,
    errors: [
        InvalidArnException,
        InvalidParameterException,
        InvalidTagException,
        ResourceNotFoundException,
        TagPolicyException,
        ThrottlingException,
    ],
}));
/**
 * Renews an eligible ACM certificate. In order to renew your Amazon Web Services Private CA certificates with ACM, you must first grant the ACM service principal permission to do so. For more information, see Testing Managed Renewal in the ACM User Guide.
 */
export const renewCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RenewCertificateRequest,
    output: RenewCertificateResponse,
    errors: [
        InvalidArnException,
        RequestInProgressException,
        ResourceNotFoundException,
    ],
}));
/**
 * Requests an ACM certificate for use with other Amazon Web Services services. To request an ACM certificate, you must specify a fully qualified domain name (FQDN) in the `DomainName` parameter. You can also specify additional FQDNs in the `SubjectAlternativeNames` parameter.
 *
 * If you are requesting a private certificate, domain validation is not required. If you are requesting a public certificate, each domain name that you specify must be validated to verify that you own or control the domain. You can use DNS validation or email validation. We recommend that you use DNS validation.
 *
 * ACM behavior differs from the RFC 6125 specification of the certificate validation process. ACM first checks for a Subject Alternative Name, and, if it finds one, ignores the common name (CN).
 *
 * After successful completion of the `RequestCertificate` action, there is a delay of several seconds before you can retrieve information about the new certificate.
 */
export const requestCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RequestCertificateRequest,
    output: RequestCertificateResponse,
    errors: [
        InvalidArnException,
        InvalidDomainValidationOptionsException,
        InvalidParameterException,
        InvalidTagException,
        LimitExceededException,
        TagPolicyException,
        TooManyTagsException,
    ],
}));
/**
 * Resends the email that requests domain ownership validation. The domain owner or an authorized representative must approve the ACM certificate before it can be issued. The certificate can be approved by clicking a link in the mail to navigate to the Amazon certificate approval website and then clicking **I Approve**. However, the validation email can be blocked by spam filters. Therefore, if you do not receive the original mail, you can request that the mail be resent within 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed since your original request or since your last attempt to resend validation mail, you must request a new certificate. For more information about setting up your contact email addresses, see Configure Email for your Domain.
 */
export const resendValidationEmail = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ResendValidationEmailRequest,
    output: ResendValidationEmailResponse,
    errors: [
        InvalidArnException,
        InvalidDomainValidationOptionsException,
        InvalidStateException,
        ResourceNotFoundException,
    ],
}));
/**
 * Revokes a public ACM certificate. You can only revoke certificates that have been previously exported.
 *
 * Once a certificate is revoked, you cannot reuse the certificate. Revoking a certificate is permanent.
 */
export const revokeCertificate = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RevokeCertificateRequest,
    output: RevokeCertificateResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InvalidArnException,
        ResourceInUseException,
        ResourceNotFoundException,
        ThrottlingException,
    ],
}));
/**
 * Retrieves a list of certificates matching search criteria. You can filter certificates by X.509 attributes and ACM specific properties like certificate status, type and renewal eligibility. This operation provides more flexible filtering than ListCertificates by supporting complex filter statements.
 */
export const searchCertificates = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: SearchCertificatesRequest,
    output: SearchCertificatesResponse,
    errors: [AccessDeniedException, ThrottlingException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Results",
        pageSize: "MaxResults",
    },
}));
/**
 * Updates a certificate. You can use this function to specify whether to opt in to or out of recording your certificate in a certificate transparency log and exporting. For more information, see Opting Out of Certificate Transparency Logging and Certificate Manager Exportable Managed Certificates.
 */
export const updateCertificateOptions = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateCertificateOptionsRequest,
    output: UpdateCertificateOptionsResponse,
    errors: [
        InvalidArnException,
        InvalidStateException,
        LimitExceededException,
        ResourceNotFoundException,
    ],
}));
//# sourceMappingURL=acm.js.map