import * as HttpClient from "effect/unstable/http/HttpClient";
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";
const svc = T.AwsApiService({
    sdkId: "InternetMonitor",
    serviceShapeName: "InternetMonitor20210603",
});
const auth = T.AwsAuthSigv4({ name: "internetmonitor" });
const ver = T.ServiceVersion("2021-06-03");
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://internetmonitor-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) {
                        return e(`https://internetmonitor-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://internetmonitor.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://internetmonitor.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const ListTagsForResourceInput = /*@__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: "ListTagsForResourceInput",
});
export const TagMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const ListTagsForResourceOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Tags: S.optional(TagMap) })).annotate({
    identifier: "ListTagsForResourceOutput",
});
export const TagResourceInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String.pipe(T.HttpLabel("ResourceArn")),
    Tags: TagMap,
}).pipe(T.all(T.Http({ method: "POST", uri: "/tags/{ResourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceInput",
});
export const TagResourceOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "TagResourceOutput",
});
export const TagKeys = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceInput = /*@__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: "UntagResourceInput",
});
export const UntagResourceOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceOutput",
});
export const GetInternetEventInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ EventId: S.String.pipe(T.HttpLabel("EventId")) }).pipe(T.all(T.Http({ method: "GET", uri: "/v20210603/InternetEvents/{EventId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetInternetEventInput",
});
export const ClientLocation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ASName: S.String,
    ASNumber: S.Number,
    Country: S.String,
    Subdivision: S.optional(S.String),
    Metro: S.optional(S.String),
    City: S.String,
    Latitude: S.Number,
    Longitude: S.Number,
})).annotate({ identifier: "ClientLocation" });
export const GetInternetEventOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    EventId: S.String,
    EventArn: S.String,
    StartedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    EndedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ClientLocation: ClientLocation,
    EventType: S.String,
    EventStatus: S.String,
})).annotate({
    identifier: "GetInternetEventOutput",
});
export const ListInternetEventsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("InternetEventMaxResults")),
    StartTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("StartTime")),
    EndTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("EndTime")),
    EventStatus: S.optional(S.String).pipe(T.HttpQuery("EventStatus")),
    EventType: S.optional(S.String).pipe(T.HttpQuery("EventType")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/v20210603/InternetEvents" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListInternetEventsInput",
});
export const InternetEventSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    EventId: S.String,
    EventArn: S.String,
    StartedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    EndedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ClientLocation: ClientLocation,
    EventType: S.String,
    EventStatus: S.String,
})).annotate({
    identifier: "InternetEventSummary",
});
export const InternetEventsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(InternetEventSummary);
export const ListInternetEventsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    InternetEvents: InternetEventsList,
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListInternetEventsOutput",
});
export const SetOfARNs = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const S3Config = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    BucketName: S.optional(S.String),
    BucketPrefix: S.optional(S.String),
    LogDeliveryStatus: S.optional(S.String),
})).annotate({ identifier: "S3Config" });
export const InternetMeasurementsLogDelivery = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ S3Config: S.optional(S3Config) })).annotate({
    identifier: "InternetMeasurementsLogDelivery",
});
export const LocalHealthEventsConfig = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Status: S.optional(S.String),
    HealthScoreThreshold: S.optional(S.Number),
    MinTrafficImpact: S.optional(S.Number),
})).annotate({
    identifier: "LocalHealthEventsConfig",
});
export const HealthEventsConfig = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    AvailabilityScoreThreshold: S.optional(S.Number),
    PerformanceScoreThreshold: S.optional(S.Number),
    AvailabilityLocalHealthEventsConfig: S.optional(LocalHealthEventsConfig),
    PerformanceLocalHealthEventsConfig: S.optional(LocalHealthEventsConfig),
})).annotate({
    identifier: "HealthEventsConfig",
});
export const CreateMonitorInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String,
    Resources: S.optional(SetOfARNs),
    ClientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    Tags: S.optional(TagMap),
    MaxCityNetworksToMonitor: S.optional(S.Number),
    InternetMeasurementsLogDelivery: S.optional(InternetMeasurementsLogDelivery),
    TrafficPercentageToMonitor: S.optional(S.Number),
    HealthEventsConfig: S.optional(HealthEventsConfig),
}).pipe(T.all(T.Http({ method: "POST", uri: "/v20210603/Monitors" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateMonitorInput",
});
export const CreateMonitorOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.String, Status: S.String })).annotate({
    identifier: "CreateMonitorOutput",
});
export const GetMonitorInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    LinkedAccountId: S.optional(S.String).pipe(T.HttpQuery("LinkedAccountId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/v20210603/Monitors/{MonitorName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetMonitorInput",
});
export const GetMonitorOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String,
    MonitorArn: S.String,
    Resources: SetOfARNs,
    Status: S.String,
    CreatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    ModifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    ProcessingStatus: S.optional(S.String),
    ProcessingStatusInfo: S.optional(S.String),
    Tags: S.optional(TagMap),
    MaxCityNetworksToMonitor: S.optional(S.Number),
    InternetMeasurementsLogDelivery: S.optional(InternetMeasurementsLogDelivery),
    TrafficPercentageToMonitor: S.optional(S.Number),
    HealthEventsConfig: S.optional(HealthEventsConfig),
})).annotate({
    identifier: "GetMonitorOutput",
});
export const UpdateMonitorInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    ResourcesToAdd: S.optional(SetOfARNs),
    ResourcesToRemove: S.optional(SetOfARNs),
    Status: S.optional(S.String),
    ClientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    MaxCityNetworksToMonitor: S.optional(S.Number),
    InternetMeasurementsLogDelivery: S.optional(InternetMeasurementsLogDelivery),
    TrafficPercentageToMonitor: S.optional(S.Number),
    HealthEventsConfig: S.optional(HealthEventsConfig),
}).pipe(T.all(T.Http({ method: "PATCH", uri: "/v20210603/Monitors/{MonitorName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateMonitorInput",
});
export const UpdateMonitorOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MonitorArn: S.String, Status: S.String })).annotate({
    identifier: "UpdateMonitorOutput",
});
export const DeleteMonitorInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MonitorName: S.String.pipe(T.HttpLabel("MonitorName")) }).pipe(T.all(T.Http({ method: "DELETE", uri: "/v20210603/Monitors/{MonitorName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteMonitorInput",
});
export const DeleteMonitorOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteMonitorOutput",
});
export const ListMonitorsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    MonitorStatus: S.optional(S.String).pipe(T.HttpQuery("MonitorStatus")),
    IncludeLinkedAccounts: S.optional(S.Boolean).pipe(T.HttpQuery("IncludeLinkedAccounts")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/v20210603/Monitors" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListMonitorsInput",
});
export const Monitor = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String,
    MonitorArn: S.String,
    Status: S.String,
    ProcessingStatus: S.optional(S.String),
})).annotate({ identifier: "Monitor" });
export const MonitorList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Monitor);
export const ListMonitorsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Monitors: MonitorList, NextToken: S.optional(S.String) })).annotate({
    identifier: "ListMonitorsOutput",
});
export const GetQueryResultsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    QueryId: S.String.pipe(T.HttpLabel("QueryId")),
    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: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetQueryResultsInput",
});
export const QueryField = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.optional(S.String), Type: S.optional(S.String) })).annotate({ identifier: "QueryField" });
export const QueryFields = /*@__PURE__*/ /*#__PURE__*/ S.Array(QueryField);
export const QueryRow = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const QueryData = /*@__PURE__*/ /*#__PURE__*/ S.Array(QueryRow);
export const GetQueryResultsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Fields: QueryFields,
    Data: QueryData,
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "GetQueryResultsOutput",
});
export const GetQueryStatusInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    QueryId: S.String.pipe(T.HttpLabel("QueryId")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetQueryStatusInput",
});
export const GetQueryStatusOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Status: S.String })).annotate({
    identifier: "GetQueryStatusOutput",
});
export const FilterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const FilterParameter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Field: S.optional(S.String),
    Operator: S.optional(S.String),
    Values: S.optional(FilterList),
})).annotate({
    identifier: "FilterParameter",
});
export const FilterParameters = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FilterParameter);
export const StartQueryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    StartTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    EndTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    QueryType: S.String,
    FilterParameters: S.optional(FilterParameters),
    LinkedAccountId: S.optional(S.String),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/v20210603/Monitors/{MonitorName}/Queries",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartQueryInput",
});
export const StartQueryOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ QueryId: S.String })).annotate({
    identifier: "StartQueryOutput",
});
export const StopQueryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    QueryId: S.String.pipe(T.HttpLabel("QueryId")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}",
}), svc, auth, proto, ver, rules))).annotate({ identifier: "StopQueryInput" });
export const StopQueryOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "StopQueryOutput",
});
export const GetHealthEventInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    EventId: S.String.pipe(T.HttpLabel("EventId")),
    LinkedAccountId: S.optional(S.String).pipe(T.HttpQuery("LinkedAccountId")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetHealthEventInput",
});
export const Network = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ASName: S.String, ASNumber: S.Number })).annotate({ identifier: "Network" });
export const NetworkList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Network);
export const NetworkImpairment = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Networks: NetworkList,
    AsPath: NetworkList,
    NetworkEventType: S.String,
})).annotate({
    identifier: "NetworkImpairment",
});
export const AvailabilityMeasurement = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ExperienceScore: S.optional(S.Number),
    PercentOfTotalTrafficImpacted: S.optional(S.Number),
    PercentOfClientLocationImpacted: S.optional(S.Number),
})).annotate({
    identifier: "AvailabilityMeasurement",
});
export const RoundTripTime = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    P50: S.optional(S.Number),
    P90: S.optional(S.Number),
    P95: S.optional(S.Number),
})).annotate({ identifier: "RoundTripTime" });
export const PerformanceMeasurement = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ExperienceScore: S.optional(S.Number),
    PercentOfTotalTrafficImpacted: S.optional(S.Number),
    PercentOfClientLocationImpacted: S.optional(S.Number),
    RoundTripTime: S.optional(RoundTripTime),
})).annotate({
    identifier: "PerformanceMeasurement",
});
export const InternetHealth = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Availability: S.optional(AvailabilityMeasurement),
    Performance: S.optional(PerformanceMeasurement),
})).annotate({ identifier: "InternetHealth" });
export const Ipv4PrefixList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ImpactedLocation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ASName: S.String,
    ASNumber: S.Number,
    Country: S.String,
    Subdivision: S.optional(S.String),
    Metro: S.optional(S.String),
    City: S.optional(S.String),
    Latitude: S.optional(S.Number),
    Longitude: S.optional(S.Number),
    CountryCode: S.optional(S.String),
    SubdivisionCode: S.optional(S.String),
    ServiceLocation: S.optional(S.String),
    Status: S.String,
    CausedBy: S.optional(NetworkImpairment),
    InternetHealth: S.optional(InternetHealth),
    Ipv4Prefixes: S.optional(Ipv4PrefixList),
})).annotate({
    identifier: "ImpactedLocation",
});
export const ImpactedLocationsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ImpactedLocation);
export const GetHealthEventOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    EventArn: S.String,
    EventId: S.String,
    StartedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    EndedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    CreatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    LastUpdatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    ImpactedLocations: ImpactedLocationsList,
    Status: S.String,
    PercentOfTotalTrafficImpacted: S.optional(S.Number),
    ImpactType: S.String,
    HealthScoreThreshold: S.optional(S.Number),
})).annotate({
    identifier: "GetHealthEventOutput",
});
export const ListHealthEventsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MonitorName: S.String.pipe(T.HttpLabel("MonitorName")),
    StartTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("StartTime")),
    EndTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("EndTime")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    EventStatus: S.optional(S.String).pipe(T.HttpQuery("EventStatus")),
    LinkedAccountId: S.optional(S.String).pipe(T.HttpQuery("LinkedAccountId")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/v20210603/Monitors/{MonitorName}/HealthEvents",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListHealthEventsInput",
});
export const HealthEvent = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    EventArn: S.String,
    EventId: S.String,
    StartedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    EndedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    CreatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    LastUpdatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    ImpactedLocations: ImpactedLocationsList,
    Status: S.String,
    PercentOfTotalTrafficImpacted: S.optional(S.Number),
    ImpactType: S.String,
    HealthScoreThreshold: S.optional(S.Number),
})).annotate({ identifier: "HealthEvent" });
export const HealthEventList = /*@__PURE__*/ /*#__PURE__*/ S.Array(HealthEvent);
export const ListHealthEventsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    HealthEvents: HealthEventList,
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListHealthEventsOutput",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class BadRequestException extends S.TaggedErrorClass()("BadRequestException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class InternalServerErrorException extends S.TaggedErrorClass()("InternalServerErrorException", { message: S.optional(S.String) }, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class NotFoundException extends S.TaggedErrorClass()("NotFoundException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class TooManyRequestsException extends S.TaggedErrorClass()("TooManyRequestsException", { message: S.optional(S.String) }, T.Retryable({ throttling: true })).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { message: S.optional(S.String) }, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { message: S.optional(S.String) }, T.Retryable({ throttling: true })).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.optional(S.String) }).pipe(C.withConflictError) {
}
export class LimitExceededException extends S.TaggedErrorClass()("LimitExceededException", { message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
/**
 * Lists the tags for a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceInput,
    output: ListTagsForResourceOutput,
    errors: [
        AccessDeniedException,
        BadRequestException,
        InternalServerErrorException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Adds a tag to a resource. Tags are supported only for monitors in Amazon CloudWatch Internet Monitor. You can add a maximum of 50 tags in Internet Monitor.
 *
 * A minimum of one tag is required for this call. It returns an error if you use the `TagResource` request with 0 tags.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceInput,
    output: TagResourceOutput,
    errors: [
        AccessDeniedException,
        BadRequestException,
        InternalServerErrorException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Removes a tag from a resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceInput,
    output: UntagResourceOutput,
    errors: [
        AccessDeniedException,
        BadRequestException,
        InternalServerErrorException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Gets information that Amazon CloudWatch Internet Monitor has generated about an internet event. Internet Monitor displays information about
 * recent global health events, called internet events, on a global outages map that is available to all Amazon Web Services
 * customers.
 *
 * The information returned here includes the impacted location,
 * when the event started and (if the event is over) ended, the type of event (`PERFORMANCE` or `AVAILABILITY`),
 * and the status (`ACTIVE` or `RESOLVED`).
 */
export const getInternetEvent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetInternetEventInput,
    output: GetInternetEventOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Lists internet events that cause performance or availability issues for client locations. Amazon CloudWatch Internet Monitor displays information about
 * recent global health events, called internet events, on a global outages map that is available to all Amazon Web Services
 * customers.
 *
 * You can constrain the list of internet events returned by providing a start time and end time to define a total
 * time frame for events you want to list. Both start time and end time specify the time when an event started. End time
 * is optional. If you don't include it, the default end time is the current time.
 *
 * You can also limit the events returned to a specific status
 * (`ACTIVE` or `RESOLVED`) or type (`PERFORMANCE` or `AVAILABILITY`).
 */
export const listInternetEvents = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListInternetEventsInput,
    output: ListInternetEventsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "InternetEvents",
        pageSize: "MaxResults",
    },
}));
/**
 * Creates a monitor in Amazon CloudWatch Internet Monitor. A monitor is built based on information from the application resources that you add: VPCs,
 * Network Load Balancers (NLBs), Amazon CloudFront distributions, and Amazon WorkSpaces directories. Internet Monitor then publishes internet measurements from Amazon Web Services
 * that are specific to the *city-networks*. That is, the locations and ASNs (typically internet service providers or ISPs),
 * where clients access your application. For more information, see Using Amazon CloudWatch Internet Monitor in the Amazon CloudWatch User
 * Guide.
 *
 * When you create a monitor, you choose the percentage of traffic that you want to monitor. You can also set a maximum limit for the
 * number of city-networks where client traffic is monitored, that caps the total traffic that Internet Monitor monitors. A city-network
 * maximum is the limit of city-networks, but you only pay for the number of city-networks that are actually monitored. You can update your monitor
 * at any time to change the percentage of traffic to monitor or the city-networks maximum. For more information, see Choosing a city-network maximum value in the *Amazon CloudWatch User Guide*.
 */
export const createMonitor = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateMonitorInput,
    output: CreateMonitorOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        LimitExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Gets information about a monitor in Amazon CloudWatch Internet Monitor based on a monitor name. The information returned includes the Amazon Resource Name (ARN), create time,
 * modified time, resources included in the monitor, and status information.
 */
export const getMonitor = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetMonitorInput,
    output: GetMonitorOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates a monitor. You can update a monitor to change the percentage of traffic to monitor or the maximum number of city-networks
 * (locations and ASNs), to add or remove resources, or to change the status of the monitor. Note that you can't change the name of a monitor.
 *
 * The city-network maximum that you choose is the limit, but you only pay for the number of city-networks that are actually monitored.
 * For more information, see Choosing a city-network maximum value in the *Amazon CloudWatch User Guide*.
 */
export const updateMonitor = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateMonitorInput,
    output: UpdateMonitorOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        LimitExceededException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes a monitor in Amazon CloudWatch Internet Monitor.
 */
export const deleteMonitor = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteMonitorInput,
    output: DeleteMonitorOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Lists all of your monitors for Amazon CloudWatch Internet Monitor and their statuses, along with the Amazon Resource Name (ARN) and name of each monitor.
 */
export const listMonitors = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListMonitorsInput,
    output: ListMonitorsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Monitors",
        pageSize: "MaxResults",
    },
}));
/**
 * Return the data for a query with the Amazon CloudWatch Internet Monitor query interface. Specify the query that you want to return results for by providing
 * a `QueryId` and a monitor name.
 *
 * For more information about using the query interface, including examples, see
 * Using the Amazon CloudWatch Internet Monitor query interface
 * in the Amazon CloudWatch Internet Monitor User Guide.
 */
export const getQueryResults = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetQueryResultsInput,
    output: GetQueryResultsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        LimitExceededException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns the current status of a query for the Amazon CloudWatch Internet Monitor query interface, for a specified query ID and monitor.
 * When you run a query, check the status to make sure that the query has `SUCCEEDED` before you review the results.
 *
 * - `QUEUED`: The query is scheduled to run.
 *
 * - `RUNNING`: The query is in progress but not complete.
 *
 * - `SUCCEEDED`: The query completed sucessfully.
 *
 * - `FAILED`: The query failed due to an error.
 *
 * - `CANCELED`: The query was canceled.
 */
export const getQueryStatus = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetQueryStatusInput,
    output: GetQueryStatusOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        LimitExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Start a query to return data for a specific query type for the Amazon CloudWatch Internet Monitor query interface. Specify a time period
 * for the data that you want returned by using `StartTime` and `EndTime`. You filter the query
 * results to return by providing parameters that you specify with `FilterParameters`.
 *
 * For more information about using the query interface, including examples, see
 * Using the Amazon CloudWatch Internet Monitor query interface
 * in the Amazon CloudWatch Internet Monitor User Guide.
 */
export const startQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartQueryInput,
    output: StartQueryOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        LimitExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Stop a query that is progress for a specific monitor.
 */
export const stopQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StopQueryInput,
    output: StopQueryOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        LimitExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Gets information that Amazon CloudWatch Internet Monitor has created and stored about a health event for a specified monitor. This information includes the impacted locations,
 * and all the information related to the event, by location.
 *
 * The information returned includes the impact on performance, availability, and round-trip time, information about the network providers (ASNs),
 * the event type, and so on.
 *
 * Information rolled up at the global traffic level is also returned, including the impact type and total traffic impact.
 */
export const getHealthEvent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetHealthEventInput,
    output: GetHealthEventOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Lists all health events for a monitor in Amazon CloudWatch Internet Monitor. Returns information for health events including the event start and end times, and
 * the status.
 *
 * Health events that have start times during the time frame that is requested are not included in the list of health events.
 */
export const listHealthEvents = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListHealthEventsInput,
    output: ListHealthEventsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "HealthEvents",
        pageSize: "MaxResults",
    },
}));
//# sourceMappingURL=internetmonitor.js.map