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: "CodeGuruProfiler",
    serviceShapeName: "CodeGuruProfiler",
});
const auth = T.AwsAuthSigv4({ name: "codeguru-profiler" });
const ver = T.ServiceVersion("2019-07-18");
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://codeguru-profiler-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://codeguru-profiler-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://codeguru-profiler.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://codeguru-profiler.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const GetFindingsReportAccountSummaryRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    dailyReportsOnly: S.optional(S.Boolean).pipe(T.HttpQuery("dailyReportsOnly")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/internal/findingsReports" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetFindingsReportAccountSummaryRequest",
});
export const FindingsReportSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    profilingGroupName: S.optional(S.String),
    profileStartTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    profileEndTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    totalNumberOfFindings: S.optional(S.Number),
})).annotate({
    identifier: "FindingsReportSummary",
});
export const FindingsReportSummaries = /*@__PURE__*/ /*#__PURE__*/ S.Array(FindingsReportSummary);
export const GetFindingsReportAccountSummaryResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    reportSummaries: FindingsReportSummaries,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "GetFindingsReportAccountSummaryResponse",
});
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 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 AgentOrchestrationConfig = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ profilingEnabled: S.Boolean })).annotate({
    identifier: "AgentOrchestrationConfig",
});
export const CreateProfilingGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String,
    computePlatform: S.optional(S.String),
    clientToken: S.String.pipe(T.HttpQuery("clientToken"), T.IdempotencyToken()),
    agentOrchestrationConfig: S.optional(AgentOrchestrationConfig),
    tags: S.optional(TagsMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/profilingGroups" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateProfilingGroupRequest",
});
export const AggregatedProfileTime = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    start: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    period: S.optional(S.String),
})).annotate({
    identifier: "AggregatedProfileTime",
});
export const ProfilingStatus = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    latestAgentProfileReportedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    latestAggregatedProfile: S.optional(AggregatedProfileTime),
    latestAgentOrchestratedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "ProfilingStatus",
});
export const ProfilingGroupDescription = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.optional(S.String),
    agentOrchestrationConfig: S.optional(AgentOrchestrationConfig),
    arn: S.optional(S.String),
    createdAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    profilingStatus: S.optional(ProfilingStatus),
    computePlatform: S.optional(S.String),
    tags: S.optional(TagsMap),
})).annotate({
    identifier: "ProfilingGroupDescription",
});
export const CreateProfilingGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroup: ProfilingGroupDescription.pipe(T.HttpPayload()).annotate({
        identifier: "ProfilingGroupDescription",
    }),
})).annotate({
    identifier: "CreateProfilingGroupResponse",
});
export const DescribeProfilingGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/profilingGroups/{profilingGroupName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeProfilingGroupRequest",
});
export const DescribeProfilingGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroup: ProfilingGroupDescription.pipe(T.HttpPayload()).annotate({
        identifier: "ProfilingGroupDescription",
    }),
})).annotate({
    identifier: "DescribeProfilingGroupResponse",
});
export const UpdateProfilingGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    agentOrchestrationConfig: AgentOrchestrationConfig,
}).pipe(T.all(T.Http({ method: "PUT", uri: "/profilingGroups/{profilingGroupName}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateProfilingGroupRequest",
});
export const UpdateProfilingGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroup: ProfilingGroupDescription.pipe(T.HttpPayload()).annotate({
        identifier: "ProfilingGroupDescription",
    }),
})).annotate({
    identifier: "UpdateProfilingGroupResponse",
});
export const DeleteProfilingGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/profilingGroups/{profilingGroupName}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteProfilingGroupRequest",
});
export const DeleteProfilingGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteProfilingGroupResponse",
});
export const ListProfilingGroupsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    includeDescription: S.optional(S.Boolean).pipe(T.HttpQuery("includeDescription")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/profilingGroups" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListProfilingGroupsRequest",
});
export const ProfilingGroupNames = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ProfilingGroupDescriptions = /*@__PURE__*/ /*#__PURE__*/ S.Array(ProfilingGroupDescription);
export const ListProfilingGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupNames: ProfilingGroupNames,
    profilingGroups: S.optional(ProfilingGroupDescriptions),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListProfilingGroupsResponse",
});
export const EventPublishers = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Channel = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    uri: S.String,
    eventPublishers: EventPublishers,
})).annotate({ identifier: "Channel" });
export const Channels = /*@__PURE__*/ /*#__PURE__*/ S.Array(Channel);
export const AddNotificationChannelsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    channels: Channels,
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/profilingGroups/{profilingGroupName}/notificationConfiguration",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "AddNotificationChannelsRequest",
});
export const NotificationConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ channels: S.optional(Channels) })).annotate({
    identifier: "NotificationConfiguration",
});
export const AddNotificationChannelsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    notificationConfiguration: S.optional(NotificationConfiguration),
})).annotate({
    identifier: "AddNotificationChannelsResponse",
});
export const ThreadStates = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const FrameMetric = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ frameName: S.String, type: S.String, threadStates: ThreadStates })).annotate({ identifier: "FrameMetric" });
export const FrameMetrics = /*@__PURE__*/ /*#__PURE__*/ S.Array(FrameMetric);
export const BatchGetFrameMetricDataRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    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")),
    period: S.optional(S.String).pipe(T.HttpQuery("period")),
    targetResolution: S.optional(S.String).pipe(T.HttpQuery("targetResolution")),
    frameMetrics: S.optional(FrameMetrics),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/profilingGroups/{profilingGroupName}/frames/-/metrics",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchGetFrameMetricDataRequest",
});
export const TimestampStructure = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ value: T.DateFromString.pipe(T.TimestampFormat("date-time")) })).annotate({
    identifier: "TimestampStructure",
});
export const ListOfTimestamps = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(TimestampStructure);
export const UnprocessedEndTimeMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, ListOfTimestamps.pipe(S.optional));
export const FrameMetricValues = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.Number);
export const FrameMetricDatum = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ frameMetric: FrameMetric, values: FrameMetricValues })).annotate({
    identifier: "FrameMetricDatum",
});
export const FrameMetricData = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FrameMetricDatum);
export const BatchGetFrameMetricDataResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    endTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    resolution: S.String,
    endTimes: ListOfTimestamps,
    unprocessedEndTimes: UnprocessedEndTimeMap,
    frameMetricData: FrameMetricData,
})).annotate({
    identifier: "BatchGetFrameMetricDataResponse",
});
export const Metadata = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const ConfigureAgentRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    fleetInstanceId: S.optional(S.String),
    metadata: S.optional(Metadata),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/profilingGroups/{profilingGroupName}/configureAgent",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ConfigureAgentRequest",
});
export const AgentParameters = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const AgentConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    shouldProfile: S.Boolean,
    periodInSeconds: S.Number,
    agentParameters: S.optional(AgentParameters),
})).annotate({
    identifier: "AgentConfiguration",
});
export const ConfigureAgentResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    configuration: AgentConfiguration.pipe(T.HttpPayload()).annotate({
        identifier: "AgentConfiguration",
    }),
})).annotate({
    identifier: "ConfigureAgentResponse",
});
export const GetNotificationConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/profilingGroups/{profilingGroupName}/notificationConfiguration",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetNotificationConfigurationRequest",
});
export const GetNotificationConfigurationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ notificationConfiguration: NotificationConfiguration })).annotate({
    identifier: "GetNotificationConfigurationResponse",
});
export const GetPolicyRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/profilingGroups/{profilingGroupName}/policy",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetPolicyRequest",
});
export const GetPolicyResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ policy: S.String, revisionId: S.String })).annotate({
    identifier: "GetPolicyResponse",
});
export const GetProfileRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    startTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("startTime")),
    period: S.optional(S.String).pipe(T.HttpQuery("period")),
    endTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))).pipe(T.HttpQuery("endTime")),
    maxDepth: S.optional(S.Number).pipe(T.HttpQuery("maxDepth")),
    accept: S.optional(S.String).pipe(T.HttpHeader("Accept")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/profilingGroups/{profilingGroupName}/profile",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetProfileRequest",
});
export const GetProfileResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profile: T.StreamingOutput.pipe(T.HttpPayload()),
    contentType: S.String.pipe(T.HttpHeader("Content-Type")),
    contentEncoding: S.optional(S.String).pipe(T.HttpHeader("Content-Encoding")),
})).annotate({
    identifier: "GetProfileResponse",
});
export const GetRecommendationsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")).pipe(T.HttpQuery("startTime")),
    endTime: T.DateFromString.pipe(T.TimestampFormat("date-time")).pipe(T.HttpQuery("endTime")),
    locale: S.optional(S.String).pipe(T.HttpQuery("locale")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/internal/profilingGroups/{profilingGroupName}/recommendations",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetRecommendationsRequest",
});
export const TargetFrame = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const TargetFrames = /*@__PURE__*/ /*#__PURE__*/ S.Array(TargetFrame);
export const Strings = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const Pattern = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    resolutionSteps: S.optional(S.String),
    targetFrames: S.optional(TargetFrames),
    thresholdPercent: S.optional(S.Number),
    countersToAggregate: S.optional(Strings),
})).annotate({ identifier: "Pattern" });
export const Match = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    targetFramesIndex: S.optional(S.Number),
    frameAddress: S.optional(S.String),
    thresholdBreachValue: S.optional(S.Number),
})).annotate({ identifier: "Match" });
export const Matches = /*@__PURE__*/ /*#__PURE__*/ S.Array(Match);
export const Recommendation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    allMatchesCount: S.Number,
    allMatchesSum: S.Number,
    pattern: Pattern,
    topMatches: Matches,
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    endTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({ identifier: "Recommendation" });
export const Recommendations = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(Recommendation);
export const Metric = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ frameName: S.String, type: S.String, threadStates: Strings })).annotate({ identifier: "Metric" });
export const UserFeedback = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: S.String })).annotate({ identifier: "UserFeedback" });
export const AnomalyInstance = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    endTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    userFeedback: S.optional(UserFeedback),
})).annotate({
    identifier: "AnomalyInstance",
});
export const AnomalyInstances = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AnomalyInstance);
export const Anomaly = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ metric: Metric, reason: S.String, instances: AnomalyInstances })).annotate({ identifier: "Anomaly" });
export const Anomalies = /*@__PURE__*/ /*#__PURE__*/ S.Array(Anomaly);
export const GetRecommendationsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String,
    profileStartTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    profileEndTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    recommendations: Recommendations,
    anomalies: Anomalies,
})).annotate({
    identifier: "GetRecommendationsResponse",
});
export const ListFindingsReportsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")).pipe(T.HttpQuery("startTime")),
    endTime: 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")),
    dailyReportsOnly: S.optional(S.Boolean).pipe(T.HttpQuery("dailyReportsOnly")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/internal/profilingGroups/{profilingGroupName}/findingsReports",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListFindingsReportsRequest",
});
export const ListFindingsReportsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    findingsReportSummaries: FindingsReportSummaries,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListFindingsReportsResponse",
});
export const ListProfileTimesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    startTime: T.DateFromString.pipe(T.TimestampFormat("date-time")).pipe(T.HttpQuery("startTime")),
    endTime: T.DateFromString.pipe(T.TimestampFormat("date-time")).pipe(T.HttpQuery("endTime")),
    period: S.String.pipe(T.HttpQuery("period")),
    orderBy: S.optional(S.String).pipe(T.HttpQuery("orderBy")),
    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: "/profilingGroups/{profilingGroupName}/profileTimes",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListProfileTimesRequest",
});
export const ProfileTime = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    start: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({ identifier: "ProfileTime" });
export const ProfileTimes = /*@__PURE__*/ /*#__PURE__*/ S.Array(ProfileTime);
export const ListProfileTimesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ profileTimes: ProfileTimes, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListProfileTimesResponse",
});
export const PostAgentProfileRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    agentProfile: T.StreamingInput.pipe(T.HttpPayload()),
    profileToken: S.optional(S.String).pipe(T.HttpQuery("profileToken"), T.IdempotencyToken()),
    contentType: S.String.pipe(T.HttpHeader("Content-Type")),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/profilingGroups/{profilingGroupName}/agentProfile",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "PostAgentProfileRequest",
});
export const PostAgentProfileResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "PostAgentProfileResponse",
});
export const Principals = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const PutPermissionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    actionGroup: S.String.pipe(T.HttpLabel("actionGroup")),
    principals: Principals,
    revisionId: S.optional(S.String),
}).pipe(T.all(T.Http({
    method: "PUT",
    uri: "/profilingGroups/{profilingGroupName}/policy/{actionGroup}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "PutPermissionRequest",
});
export const PutPermissionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ policy: S.String, revisionId: S.String })).annotate({
    identifier: "PutPermissionResponse",
});
export const RemoveNotificationChannelRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    channelId: S.String.pipe(T.HttpLabel("channelId")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/profilingGroups/{profilingGroupName}/notificationConfiguration/{channelId}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "RemoveNotificationChannelRequest",
});
export const RemoveNotificationChannelResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    notificationConfiguration: S.optional(NotificationConfiguration),
})).annotate({
    identifier: "RemoveNotificationChannelResponse",
});
export const RemovePermissionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    actionGroup: S.String.pipe(T.HttpLabel("actionGroup")),
    revisionId: S.String.pipe(T.HttpQuery("revisionId")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/profilingGroups/{profilingGroupName}/policy/{actionGroup}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "RemovePermissionRequest",
});
export const RemovePermissionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ policy: S.String, revisionId: S.String })).annotate({
    identifier: "RemovePermissionResponse",
});
export const SubmitFeedbackRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    profilingGroupName: S.String.pipe(T.HttpLabel("profilingGroupName")),
    anomalyInstanceId: S.String.pipe(T.HttpLabel("anomalyInstanceId")),
    type: S.String,
    comment: S.optional(S.String),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/internal/profilingGroups/{profilingGroupName}/anomalies/{anomalyInstanceId}/feedback",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "SubmitFeedbackRequest",
});
export const SubmitFeedbackResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "SubmitFeedbackResponse",
});
//# Errors
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { message: S.String }, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { message: S.String }, T.Retryable()).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { message: S.String }).pipe(C.withBadRequestError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.String }).pipe(C.withBadRequestError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.String }).pipe(C.withConflictError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", { message: S.String }, T.Retryable()).pipe(C.withQuotaError, C.withRetryableError) {
}
/**
 * Returns a list of
 *
 * `FindingsReportSummary`
 *
 * objects that contain analysis results for all profiling groups in your AWS account.
 */
export const getFindingsReportAccountSummary = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: GetFindingsReportAccountSummaryRequest,
    output: GetFindingsReportAccountSummaryResponse,
    errors: [InternalServerException, ThrottlingException, ValidationException],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        pageSize: "maxResults",
    },
}));
/**
 * Returns a list of the tags that are assigned to a specified resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Use to assign one or more tags to a resource.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Use to remove one or more tags from a resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Creates a profiling group.
 */
export const createProfilingGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateProfilingGroupRequest,
    output: CreateProfilingGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a
 * `ProfilingGroupDescription`
 *
 * object that contains information about the requested profiling group.
 */
export const describeProfilingGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeProfilingGroupRequest,
    output: DescribeProfilingGroupResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates a profiling group.
 */
export const updateProfilingGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateProfilingGroupRequest,
    output: UpdateProfilingGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes a profiling group.
 */
export const deleteProfilingGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteProfilingGroupRequest,
    output: DeleteProfilingGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of profiling groups. The profiling groups are returned as
 *
 * `ProfilingGroupDescription`
 *
 * objects.
 */
export const listProfilingGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListProfilingGroupsRequest,
    output: ListProfilingGroupsResponse,
    errors: [InternalServerException, ThrottlingException],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        pageSize: "maxResults",
    },
}));
/**
 * Add up to 2 anomaly notifications channels for a profiling group.
 */
export const addNotificationChannels = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AddNotificationChannelsRequest,
    output: AddNotificationChannelsResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns the time series of values for a requested list
 * of frame metrics from a time period.
 */
export const batchGetFrameMetricData = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchGetFrameMetricDataRequest,
    output: BatchGetFrameMetricDataResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Used by profiler agents to report their current state and to receive remote
 * configuration updates. For example, `ConfigureAgent` can be used
 * to tell an agent whether to profile or not and for how long to return profiling data.
 */
export const configureAgent = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ConfigureAgentRequest,
    output: ConfigureAgentResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Get the current configuration for anomaly notifications for a profiling group.
 */
export const getNotificationConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetNotificationConfigurationRequest,
    output: GetNotificationConfigurationResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns the JSON-formatted resource-based policy on a profiling group.
 */
export const getPolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPolicyRequest,
    output: GetPolicyResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
    ],
}));
/**
 * Gets the aggregated profile of a profiling group for a specified time range.
 * Amazon CodeGuru Profiler collects posted agent profiles for a profiling group
 * into aggregated profiles.
 *
 * Because aggregated profiles expire over time `GetProfile` is not idempotent.
 *
 * Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: `startTime`,
 * `endTime`, `period`. The maximum time range allowed is 7 days. If you specify all 3 parameters,
 * an exception is thrown. If you specify only `period`, the latest aggregated profile is returned.
 *
 * Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to
 * UTC. The aggregation period of an aggregated profile determines how long it is retained. For more
 * information, see
 * `AggregatedProfileTime`
 * . The aggregated profile's aggregation period determines how long
 * it is retained by CodeGuru Profiler.
 *
 * - If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days.
 *
 * - If the aggregation period is 1 hour, the aggregated profile is retained for 60 days.
 *
 * - If the aggregation period is 1 day, the aggregated profile is retained for 3 years.
 *
 * There are two use cases for calling `GetProfile`.
 *
 * - If you want to return an aggregated profile that already exists, use
 *
 * `ListProfileTimes`
 * to
 * view the time ranges of existing aggregated profiles. Use them in a `GetProfile` request to return a specific,
 * existing aggregated profile.
 *
 * - If you want to return an aggregated profile for a time range that doesn't align with an existing aggregated profile,
 * then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time
 * range and return them as one aggregated profile.
 *
 * If aggregated profiles do not exist for the full time range requested, then
 * aggregated profiles for a smaller time range are returned. For example, if the
 * requested time range is from 00:00 to 00:20, and the existing aggregated profiles are
 * from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned.
 */
export const getProfile = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetProfileRequest,
    output: GetProfileResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of
 *
 * `Recommendation`
 *
 * objects that contain recommendations for a profiling group for a given time period. A list of
 *
 * `Anomaly`
 *
 * objects that contains details about anomalies detected in the profiling group for the same time period is also
 * returned.
 */
export const getRecommendations = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetRecommendationsRequest,
    output: GetRecommendationsResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * List the available reports for a given profiling group and time range.
 */
export const listFindingsReports = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListFindingsReportsRequest,
    output: ListFindingsReportsResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        pageSize: "maxResults",
    },
}));
/**
 * Lists the start times of the available aggregated profiles of a profiling group
 * for an aggregation period within the specified time range.
 */
export const listProfileTimes = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListProfileTimesRequest,
    output: ListProfileTimesResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "profileTimes",
        pageSize: "maxResults",
    },
}));
/**
 * Submits profiling data to an aggregated profile of a profiling group. To get an
 * aggregated profile that is created with this profiling data, use
 *
 * `GetProfile`
 * .
 */
export const postAgentProfile = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PostAgentProfileRequest,
    output: PostAgentProfileResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Adds permissions to a profiling group's resource-based policy
 * that are provided using an action group. If a profiling group doesn't have
 * a resource-based policy, one is created for it using the permissions in the action group and
 * the roles and users in the `principals` parameter.
 *
 * The one supported action group that can be added is `agentPermission`
 * which grants `ConfigureAgent` and `PostAgent` permissions. For
 * more information, see Resource-based
 * policies in CodeGuru Profiler in the Amazon CodeGuru Profiler User
 * Guide,
 * `ConfigureAgent`
 * , and
 * `PostAgentProfile`
 * .
 *
 * The first time you call `PutPermission` on a profiling group, do not specify a `revisionId` because
 * it doesn't have a resource-based policy. Subsequent calls must provide a `revisionId` to specify
 * which revision of the resource-based policy to add the permissions to.
 *
 * The response contains the profiling group's JSON-formatted resource policy.
 */
export const putPermission = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutPermissionRequest,
    output: PutPermissionResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Remove one anomaly notifications channel for a profiling group.
 */
export const removeNotificationChannel = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RemoveNotificationChannelRequest,
    output: RemoveNotificationChannelResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Removes permissions from a profiling group's resource-based policy that are provided
 * using an action group. The one supported action group that can be removed is
 * `agentPermission` which grants `ConfigureAgent` and
 * `PostAgent` permissions. For more information, see Resource-based policies in CodeGuru Profiler in the Amazon
 * CodeGuru Profiler User Guide,
 * `ConfigureAgent`
 * , and
 * `PostAgentProfile`
 * .
 */
export const removePermission = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RemovePermissionRequest,
    output: RemovePermissionResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is
 * useful or not.
 */
export const submitFeedback = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SubmitFeedbackRequest,
    output: SubmitFeedbackResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
//# sourceMappingURL=codeguruprofiler.js.map