import * as HttpClient from "effect/unstable/http/HttpClient";
import * as redacted from "effect/Redacted";
import * as S from "effect/Schema";
import * as stream from "effect/Stream";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
import { SensitiveString } from "../sensitive.js";
const svc = T.AwsApiService({
    sdkId: "PCS",
    serviceShapeName: "AWSParallelComputingService",
});
const auth = T.AwsAuthSigv4({ name: "pcs" });
const ver = T.ServiceVersion("2023-02-10");
const proto = T.AwsProtocolsAwsJson1_0();
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://pcs-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://pcs-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://pcs.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://pcs.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const ListTagsForResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resourceArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagsForResourceRequest",
});
export const ResponseTagMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tags: S.optional(ResponseTagMap) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const RequestTagMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resourceArn: S.String, tags: RequestTagMap }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), 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.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceRequest",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceResponse",
});
export const SchedulerType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SchedulerRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: SchedulerType, version: S.String })).annotate({
    identifier: "SchedulerRequest",
});
export const Size = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SubnetIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const SecurityGroupIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const NetworkType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const NetworkingRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    subnetIds: S.optional(SubnetIdList),
    securityGroupIds: S.optional(SecurityGroupIdList),
    networkType: S.optional(NetworkType),
})).annotate({
    identifier: "NetworkingRequest",
});
export const SlurmCustomSetting = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ parameterName: S.String, parameterValue: S.String })).annotate({
    identifier: "SlurmCustomSetting",
});
export const SlurmCustomSettings = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(SlurmCustomSetting);
export const SlurmdbdCustomSetting = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ parameterName: S.String, parameterValue: S.String })).annotate({
    identifier: "SlurmdbdCustomSetting",
});
export const SlurmdbdCustomSettings = /*@__PURE__*/ /*#__PURE__*/ S.Array(SlurmdbdCustomSetting);
export const CgroupCustomSetting = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ parameterName: S.String, parameterValue: S.String })).annotate({
    identifier: "CgroupCustomSetting",
});
export const CgroupCustomSettings = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(CgroupCustomSetting);
export const AccountingMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AccountingRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    defaultPurgeTimeInDays: S.optional(S.Number),
    mode: AccountingMode,
})).annotate({
    identifier: "AccountingRequest",
});
export const SlurmRestMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SlurmRestRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ mode: SlurmRestMode })).annotate({
    identifier: "SlurmRestRequest",
});
export const ClusterSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    scaleDownIdleTimeInSeconds: S.optional(S.Number),
    slurmCustomSettings: S.optional(SlurmCustomSettings),
    slurmdbdCustomSettings: S.optional(SlurmdbdCustomSettings),
    cgroupCustomSettings: S.optional(CgroupCustomSettings),
    accounting: S.optional(AccountingRequest),
    slurmRest: S.optional(SlurmRestRequest),
})).annotate({
    identifier: "ClusterSlurmConfigurationRequest",
});
export const CreateClusterRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterName: S.String,
    scheduler: SchedulerRequest,
    size: Size,
    networking: NetworkingRequest,
    slurmConfiguration: S.optional(ClusterSlurmConfigurationRequest),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(RequestTagMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateClusterRequest",
});
export const ClusterStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Scheduler = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ type: SchedulerType, version: S.String })).annotate({ identifier: "Scheduler" });
export const SlurmAuthKey = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ secretArn: S.String, secretVersion: S.String })).annotate({ identifier: "SlurmAuthKey" });
export const JwtKey = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ secretArn: S.String, secretVersion: S.String })).annotate({ identifier: "JwtKey" });
export const JwtAuth = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ jwtKey: S.optional(JwtKey) })).annotate({ identifier: "JwtAuth" });
export const Accounting = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    defaultPurgeTimeInDays: S.optional(S.Number),
    mode: AccountingMode,
})).annotate({ identifier: "Accounting" });
export const SlurmRest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ mode: SlurmRestMode })).annotate({ identifier: "SlurmRest" });
export const ClusterSlurmConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    scaleDownIdleTimeInSeconds: S.optional(S.Number),
    slurmCustomSettings: S.optional(SlurmCustomSettings),
    slurmdbdCustomSettings: S.optional(SlurmdbdCustomSettings),
    cgroupCustomSettings: S.optional(CgroupCustomSettings),
    authKey: S.optional(SlurmAuthKey),
    jwtAuth: S.optional(JwtAuth),
    accounting: S.optional(Accounting),
    slurmRest: S.optional(SlurmRest),
})).annotate({
    identifier: "ClusterSlurmConfiguration",
});
export const Networking = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    subnetIds: S.optional(SubnetIdList),
    securityGroupIds: S.optional(SecurityGroupIdList),
    networkType: S.optional(NetworkType),
})).annotate({ identifier: "Networking" });
export const EndpointType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Endpoint = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    type: EndpointType,
    privateIpAddress: S.String,
    publicIpAddress: S.optional(S.String),
    ipv6Address: S.optional(S.String),
    port: S.String,
})).annotate({ identifier: "Endpoint" });
export const Endpoints = /*@__PURE__*/ /*#__PURE__*/ S.Array(Endpoint);
export const ErrorInfo = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ code: S.optional(S.String), message: S.optional(S.String) })).annotate({ identifier: "ErrorInfo" });
export const ErrorInfoList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ErrorInfo);
export const Cluster = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    status: ClusterStatus,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    scheduler: Scheduler,
    size: Size,
    slurmConfiguration: S.optional(ClusterSlurmConfiguration),
    networking: Networking,
    endpoints: S.optional(Endpoints),
    errorInfo: S.optional(ErrorInfoList),
})).annotate({ identifier: "Cluster" });
export const CreateClusterResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ cluster: S.optional(Cluster) })).annotate({
    identifier: "CreateClusterResponse",
});
export const ValidationExceptionReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ValidationExceptionField = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ name: S.String, message: S.String })).annotate({
    identifier: "ValidationExceptionField",
});
export const ValidationExceptionFieldList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ValidationExceptionField);
export const UpdateAccountingRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    defaultPurgeTimeInDays: S.optional(S.Number),
    mode: S.optional(AccountingMode),
})).annotate({
    identifier: "UpdateAccountingRequest",
});
export const UpdateSlurmRestRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ mode: S.optional(SlurmRestMode) })).annotate({
    identifier: "UpdateSlurmRestRequest",
});
export const UpdateClusterSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    scaleDownIdleTimeInSeconds: S.optional(S.Number),
    slurmCustomSettings: S.optional(SlurmCustomSettings),
    slurmdbdCustomSettings: S.optional(SlurmdbdCustomSettings),
    cgroupCustomSettings: S.optional(CgroupCustomSettings),
    accounting: S.optional(UpdateAccountingRequest),
    slurmRest: S.optional(UpdateSlurmRestRequest),
})).annotate({
    identifier: "UpdateClusterSlurmConfigurationRequest",
});
export const UpdateClusterRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    slurmConfiguration: S.optional(UpdateClusterSlurmConfigurationRequest),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateClusterRequest",
});
export const UpdateClusterResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ cluster: S.optional(Cluster) })).annotate({
    identifier: "UpdateClusterResponse",
});
export const DeleteClusterRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteClusterRequest",
});
export const DeleteClusterResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteClusterResponse",
});
export const GetClusterRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ clusterIdentifier: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetClusterRequest",
});
export const GetClusterResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ cluster: S.optional(Cluster) })).annotate({
    identifier: "GetClusterResponse",
});
export const RegisterComputeNodeGroupInstanceRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ clusterIdentifier: S.String, bootstrapId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "RegisterComputeNodeGroupInstanceRequest",
});
export const RegisterComputeNodeGroupInstanceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nodeID: S.String,
    sharedSecret: SensitiveString,
    endpoints: Endpoints,
})).annotate({
    identifier: "RegisterComputeNodeGroupInstanceResponse",
});
export const ListClustersRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListClustersRequest",
});
export const ClusterSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: ClusterStatus,
})).annotate({ identifier: "ClusterSummary" });
export const ClusterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ClusterSummary);
export const ListClustersResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ clusters: ClusterList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListClustersResponse",
});
export const StringList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const PurchaseOption = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CustomLaunchTemplate = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ id: S.String, version: S.String })).annotate({
    identifier: "CustomLaunchTemplate",
});
export const ScalingConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ minInstanceCount: S.Number, maxInstanceCount: S.Number })).annotate({
    identifier: "ScalingConfigurationRequest",
});
export const InstanceConfig = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ instanceType: S.optional(S.String) })).annotate({ identifier: "InstanceConfig" });
export const InstanceList = /*@__PURE__*/ /*#__PURE__*/ S.Array(InstanceConfig);
export const SpotAllocationStrategy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SpotOptions = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ allocationStrategy: S.optional(SpotAllocationStrategy) })).annotate({ identifier: "SpotOptions" });
export const ComputeNodeGroupSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "ComputeNodeGroupSlurmConfigurationRequest",
});
export const CreateComputeNodeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    computeNodeGroupName: S.String,
    amiId: S.optional(S.String),
    subnetIds: StringList,
    purchaseOption: S.optional(PurchaseOption),
    customLaunchTemplate: CustomLaunchTemplate,
    iamInstanceProfileArn: S.String,
    scalingConfiguration: ScalingConfigurationRequest,
    instanceConfigs: InstanceList,
    spotOptions: S.optional(SpotOptions),
    slurmConfiguration: S.optional(ComputeNodeGroupSlurmConfigurationRequest),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(RequestTagMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateComputeNodeGroupRequest",
});
export const ComputeNodeGroupStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ScalingConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ minInstanceCount: S.Number, maxInstanceCount: S.Number })).annotate({
    identifier: "ScalingConfiguration",
});
export const ComputeNodeGroupSlurmConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "ComputeNodeGroupSlurmConfiguration",
});
export const ComputeNodeGroup = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    clusterId: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: ComputeNodeGroupStatus,
    amiId: S.optional(S.String),
    subnetIds: SubnetIdList,
    purchaseOption: S.optional(PurchaseOption),
    customLaunchTemplate: CustomLaunchTemplate,
    iamInstanceProfileArn: S.String,
    scalingConfiguration: ScalingConfiguration,
    instanceConfigs: InstanceList,
    spotOptions: S.optional(SpotOptions),
    slurmConfiguration: S.optional(ComputeNodeGroupSlurmConfiguration),
    errorInfo: S.optional(ErrorInfoList),
})).annotate({
    identifier: "ComputeNodeGroup",
});
export const CreateComputeNodeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ computeNodeGroup: S.optional(ComputeNodeGroup) })).annotate({
    identifier: "CreateComputeNodeGroupResponse",
});
export const UpdateComputeNodeGroupSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "UpdateComputeNodeGroupSlurmConfigurationRequest",
});
export const UpdateComputeNodeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    computeNodeGroupIdentifier: S.String,
    amiId: S.optional(S.String),
    subnetIds: S.optional(StringList),
    customLaunchTemplate: S.optional(CustomLaunchTemplate),
    purchaseOption: S.optional(PurchaseOption),
    spotOptions: S.optional(SpotOptions),
    scalingConfiguration: S.optional(ScalingConfigurationRequest),
    iamInstanceProfileArn: S.optional(S.String),
    slurmConfiguration: S.optional(UpdateComputeNodeGroupSlurmConfigurationRequest),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateComputeNodeGroupRequest",
});
export const UpdateComputeNodeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ computeNodeGroup: S.optional(ComputeNodeGroup) })).annotate({
    identifier: "UpdateComputeNodeGroupResponse",
});
export const DeleteComputeNodeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    computeNodeGroupIdentifier: S.String,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteComputeNodeGroupRequest",
});
export const DeleteComputeNodeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteComputeNodeGroupResponse",
});
export const GetComputeNodeGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    computeNodeGroupIdentifier: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetComputeNodeGroupRequest",
});
export const GetComputeNodeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ computeNodeGroup: S.optional(ComputeNodeGroup) })).annotate({
    identifier: "GetComputeNodeGroupResponse",
});
export const ListComputeNodeGroupsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    nextToken: S.optional(S.String),
    maxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListComputeNodeGroupsRequest",
});
export const ComputeNodeGroupSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    clusterId: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: ComputeNodeGroupStatus,
})).annotate({
    identifier: "ComputeNodeGroupSummary",
});
export const ComputeNodeGroupList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ComputeNodeGroupSummary);
export const ListComputeNodeGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    computeNodeGroups: ComputeNodeGroupList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListComputeNodeGroupsResponse",
});
export const ComputeNodeGroupConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ computeNodeGroupId: S.optional(S.String) })).annotate({
    identifier: "ComputeNodeGroupConfiguration",
});
export const ComputeNodeGroupConfigurationList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ComputeNodeGroupConfiguration);
export const QueueSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "QueueSlurmConfigurationRequest",
});
export const CreateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    queueName: S.String,
    computeNodeGroupConfigurations: S.optional(ComputeNodeGroupConfigurationList),
    slurmConfiguration: S.optional(QueueSlurmConfigurationRequest),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(RequestTagMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateQueueRequest",
});
export const QueueStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const QueueSlurmConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "QueueSlurmConfiguration",
});
export const Queue = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    clusterId: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: QueueStatus,
    computeNodeGroupConfigurations: ComputeNodeGroupConfigurationList,
    slurmConfiguration: S.optional(QueueSlurmConfiguration),
    errorInfo: S.optional(ErrorInfoList),
})).annotate({ identifier: "Queue" });
export const CreateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ queue: S.optional(Queue) })).annotate({
    identifier: "CreateQueueResponse",
});
export const UpdateQueueSlurmConfigurationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ slurmCustomSettings: S.optional(SlurmCustomSettings) })).annotate({
    identifier: "UpdateQueueSlurmConfigurationRequest",
});
export const UpdateQueueRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    queueIdentifier: S.String,
    computeNodeGroupConfigurations: S.optional(ComputeNodeGroupConfigurationList),
    slurmConfiguration: S.optional(UpdateQueueSlurmConfigurationRequest),
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateQueueRequest",
});
export const UpdateQueueResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ queue: S.optional(Queue) })).annotate({
    identifier: "UpdateQueueResponse",
});
export const DeleteQueueRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    queueIdentifier: S.String,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteQueueRequest",
});
export const DeleteQueueResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteQueueResponse",
});
export const GetQueueRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ clusterIdentifier: S.String, queueIdentifier: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetQueueRequest",
});
export const GetQueueResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ queue: S.optional(Queue) })).annotate({
    identifier: "GetQueueResponse",
});
export const ListQueuesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clusterIdentifier: S.String,
    nextToken: S.optional(S.String),
    maxResults: S.optional(S.Number),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListQueuesRequest",
});
export const QueueSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    id: S.String,
    arn: S.String,
    clusterId: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    modifiedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    status: QueueStatus,
})).annotate({ identifier: "QueueSummary" });
export const QueueList = /*@__PURE__*/ /*#__PURE__*/ S.Array(QueueSummary);
export const ListQueuesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ queues: QueueList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListQueuesResponse",
});
//# Errors
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withBadRequestError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", {
    message: S.String,
    serviceCode: S.String,
    resourceId: S.optional(S.String),
    resourceType: S.optional(S.String),
    quotaCode: S.optional(S.String),
}).pipe(C.withQuotaError) {
}
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { message: S.String }).pipe(C.withAuthError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withConflictError) {
}
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,
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable()).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    message: S.String,
    reason: ValidationExceptionReason,
    fieldList: S.optional(ValidationExceptionFieldList),
}).pipe(C.withBadRequestError) {
}
/**
 * Returns a list of all tags on an PCS resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [ResourceNotFoundException],
}));
/**
 * Adds or edits tags on an PCS resource. Each tag consists of a tag key and a tag value. The tag key and tag value are case-sensitive strings. The tag value can be an empty (null) string. To add a tag, specify a new tag key and a tag value. To edit a tag, specify an existing tag key and a new tag value.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [ResourceNotFoundException, ServiceQuotaExceededException],
}));
/**
 * Deletes tags from an PCS resource. To delete a tag, specify the tag key and the Amazon Resource Name (ARN) of the PCS resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [ResourceNotFoundException],
}));
/**
 * Creates a cluster in your account. PCS creates the cluster controller in a service-owned account. The cluster controller communicates with the cluster resources in your account. The subnets and security groups for the cluster must already exist before you use this API action.
 *
 * It takes time for PCS to create the cluster. The cluster is in a `Creating` state until it is ready to use. There can only be 1 cluster in a `Creating` state per Amazon Web Services Region per Amazon Web Services account. `CreateCluster` fails with a `ServiceQuotaExceededException` if there is already a cluster in a `Creating` state.
 */
export const createCluster = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateClusterRequest,
    output: CreateClusterResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates a cluster configuration. You can modify Slurm scheduler settings, accounting configuration, and security groups for an existing cluster.
 *
 * You can only update clusters that are in `ACTIVE`, `UPDATE_FAILED`, or `SUSPENDED` state. All associated resources (queues and compute node groups) must be in `ACTIVE` state before you can update the cluster.
 */
export const updateCluster = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateClusterRequest,
    output: UpdateClusterResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes a cluster and all its linked resources. You must delete all queues and compute node groups associated with the cluster before you can delete the cluster.
 */
export const deleteCluster = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteClusterRequest,
    output: DeleteClusterResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns detailed information about a running cluster in your account. This API action provides networking information, endpoint information for communication with the scheduler, and provisioning status.
 */
export const getCluster = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetClusterRequest,
    output: GetClusterResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * This API action isn't intended for you to use.
 *
 * PCS uses this API action to register the compute nodes it launches in your account.
 */
export const registerComputeNodeGroupInstance = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: RegisterComputeNodeGroupInstanceRequest,
    output: RegisterComputeNodeGroupInstanceResponse,
    errors: [AccessDeniedException, InternalServerException],
}));
/**
 * Returns a list of running clusters in your account.
 */
export const listClusters = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListClustersRequest,
    output: ListClustersResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "clusters",
        pageSize: "maxResults",
    },
}));
/**
 * Creates a managed set of compute nodes. You associate a compute node group with a cluster through 1 or more PCS queues or as part of the login fleet. A compute node group includes the definition of the compute properties and lifecycle management. PCS uses the information you provide to this API action to launch compute nodes in your account. You can only specify subnets in the same Amazon VPC as your cluster. You receive billing charges for the compute nodes that PCS launches in your account. You must already have a launch template before you call this API. For more information, see Launch an instance from a launch template in the *Amazon Elastic Compute Cloud User Guide for Linux Instances*.
 */
export const createComputeNodeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateComputeNodeGroupRequest,
    output: CreateComputeNodeGroupResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates a compute node group. You can update many of the fields related to your compute node group including the configurations for networking, compute nodes, and settings specific to your scheduler (such as Slurm).
 */
export const updateComputeNodeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateComputeNodeGroupRequest,
    output: UpdateComputeNodeGroupResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes a compute node group. You must delete all queues associated with the compute node group first.
 */
export const deleteComputeNodeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteComputeNodeGroupRequest,
    output: DeleteComputeNodeGroupResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns detailed information about a compute node group. This API action provides networking information, EC2 instance type, compute node group status, and scheduler (such as Slurm) configuration.
 */
export const getComputeNodeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetComputeNodeGroupRequest,
    output: GetComputeNodeGroupResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of all compute node groups associated with a cluster.
 */
export const listComputeNodeGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListComputeNodeGroupsRequest,
    output: ListComputeNodeGroupsResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "computeNodeGroups",
        pageSize: "maxResults",
    },
}));
/**
 * Creates a job queue. You must associate 1 or more compute node groups with the queue. You can associate 1 compute node group with multiple queues.
 */
export const createQueue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateQueueRequest,
    output: CreateQueueResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates the compute node group configuration of a queue. Use this API to change the compute node groups that the queue can send jobs to.
 */
export const updateQueue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateQueueRequest,
    output: UpdateQueueResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes a job queue. If the compute node group associated with this queue isn't associated with any other queues, PCS terminates all the compute nodes for this queue.
 */
export const deleteQueue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteQueueRequest,
    output: DeleteQueueResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns detailed information about a queue. The information includes the compute node groups that the queue uses to schedule jobs.
 */
export const getQueue = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetQueueRequest,
    output: GetQueueResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of all queues associated with a cluster.
 */
export const listQueues = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListQueuesRequest,
    output: ListQueuesResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "queues",
        pageSize: "maxResults",
    },
}));
//# sourceMappingURL=pcs.js.map