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: "MPA",
    serviceShapeName: "AWSFluffyCoreService",
});
const auth = T.AwsAuthSigv4({ name: "mpa" });
const ver = T.ServiceVersion("2022-07-26");
const proto = T.AwsProtocolsRestJson1();
const rules = T.EndpointResolver((p, _) => {
    const { UseFIPS = false, Endpoint, Region } = 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");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true) {
                    return e(`https://mpa-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                }
                return e(`https://mpa.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const GetPolicyVersionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PolicyVersionArn: S.String.pipe(T.HttpLabel("PolicyVersionArn")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/policy-versions/{PolicyVersionArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetPolicyVersionRequest",
});
export const PolicyType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const PolicyStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const PolicyVersion = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Arn: S.String,
    PolicyArn: S.String,
    VersionId: S.Number,
    PolicyType: PolicyType,
    IsDefault: S.Boolean,
    Name: S.String,
    Status: PolicyStatus,
    CreationTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    LastUpdatedTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    Document: SensitiveString,
})).annotate({ identifier: "PolicyVersion" });
export const GetPolicyVersionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ PolicyVersion: PolicyVersion })).annotate({
    identifier: "GetPolicyVersionResponse",
});
export const GetResourcePolicyRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String,
    PolicyName: S.String,
    PolicyType: PolicyType,
}).pipe(T.all(T.Http({ method: "POST", uri: "/GetResourcePolicy" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetResourcePolicyRequest",
});
export const GetResourcePolicyResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String,
    PolicyType: PolicyType,
    PolicyVersionArn: S.optional(S.String),
    PolicyName: S.String,
    PolicyDocument: SensitiveString,
})).annotate({
    identifier: "GetResourcePolicyResponse",
});
export const ListPoliciesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/policies/?List" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListPoliciesRequest",
});
export const Policy = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Arn: S.String,
    DefaultVersion: S.Number,
    PolicyType: PolicyType,
    Name: S.String,
})).annotate({ identifier: "Policy" });
export const Policies = /*@__PURE__*/ /*#__PURE__*/ S.Array(Policy);
export const ListPoliciesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ NextToken: S.optional(S.String), Policies: S.optional(Policies) })).annotate({
    identifier: "ListPoliciesResponse",
});
export const ListPolicyVersionsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
    PolicyArn: S.String.pipe(T.HttpLabel("PolicyArn")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/policies/{PolicyArn}/?List" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListPolicyVersionsRequest",
});
export const PolicyVersionSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Arn: S.String,
    PolicyArn: S.String,
    VersionId: S.Number,
    PolicyType: PolicyType,
    IsDefault: S.Boolean,
    Name: S.String,
    Status: PolicyStatus,
    CreationTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    LastUpdatedTime: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({
    identifier: "PolicyVersionSummary",
});
export const PolicyVersions = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PolicyVersionSummary);
export const ListPolicyVersionsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    PolicyVersions: S.optional(PolicyVersions),
})).annotate({
    identifier: "ListPolicyVersionsResponse",
});
export const ListResourcePoliciesRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String.pipe(T.HttpLabel("ResourceArn")),
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/resource-policies/{ResourceArn}/?List",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListResourcePoliciesRequest",
});
export const ListResourcePoliciesResponseResourcePolicy = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PolicyArn: S.optional(S.String),
    PolicyType: S.optional(PolicyType),
    PolicyName: S.optional(S.String),
})).annotate({
    identifier: "ListResourcePoliciesResponseResourcePolicy",
});
export const ListResourcePoliciesResponseResourcePolicies = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ListResourcePoliciesResponseResourcePolicy);
export const ListResourcePoliciesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    ResourcePolicies: S.optional(ListResourcePoliciesResponseResourcePolicies),
})).annotate({
    identifier: "ListResourcePoliciesResponse",
});
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 Tags = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, SensitiveString.pipe(S.optional));
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Tags: S.optional(Tags) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String.pipe(T.HttpLabel("ResourceArn")),
    Tags: Tags,
}).pipe(T.all(T.Http({ method: "PUT", 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 TagKeyList = /*@__PURE__*/ /*#__PURE__*/ S.Array(SensitiveString);
export const UntagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.String.pipe(T.HttpLabel("ResourceArn")),
    TagKeys: TagKeyList,
}).pipe(T.all(T.Http({ method: "POST", 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 MofNApprovalStrategy = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MinApprovalsRequired: S.Number })).annotate({
    identifier: "MofNApprovalStrategy",
});
export const ApprovalStrategy = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ MofN: MofNApprovalStrategy }),
]);
export const ApprovalTeamRequestApprover = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PrimaryIdentityId: S.String,
    PrimaryIdentitySourceArn: S.String,
})).annotate({
    identifier: "ApprovalTeamRequestApprover",
});
export const ApprovalTeamRequestApprovers = /*@__PURE__*/ /*#__PURE__*/ S.Array(ApprovalTeamRequestApprover);
export const PolicyReference = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ PolicyArn: S.String })).annotate({
    identifier: "PolicyReference",
});
export const PoliciesReferences = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PolicyReference);
export const CreateApprovalTeamRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ClientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    ApprovalStrategy: ApprovalStrategy,
    Approvers: ApprovalTeamRequestApprovers,
    Description: SensitiveString,
    Policies: PoliciesReferences,
    Name: S.String,
    Tags: S.optional(Tags),
}).pipe(T.all(T.Http({ method: "POST", uri: "/approval-teams" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateApprovalTeamRequest",
});
export const CreateApprovalTeamResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    Arn: S.optional(S.String),
    Name: S.optional(S.String),
    VersionId: S.optional(S.String),
})).annotate({
    identifier: "CreateApprovalTeamResponse",
});
export const GetApprovalTeamRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.String.pipe(T.HttpLabel("Arn")) }).pipe(T.all(T.Http({ method: "GET", uri: "/approval-teams/{Arn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetApprovalTeamRequest",
});
export const ApprovalStrategyResponse = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ MofN: MofNApprovalStrategy }),
]);
export const IdentityStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ApproverLastActivity = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MfaType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MfaSyncStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MfaMethod = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Type: MfaType, SyncStatus: MfaSyncStatus })).annotate({ identifier: "MfaMethod" });
export const MfaMethods = /*@__PURE__*/ /*#__PURE__*/ S.Array(MfaMethod);
export const GetApprovalTeamResponseApprover = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApproverId: S.optional(S.String),
    ResponseTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    PrimaryIdentityId: S.optional(S.String),
    PrimaryIdentitySourceArn: S.optional(S.String),
    PrimaryIdentityStatus: S.optional(IdentityStatus),
    LastActivity: S.optional(ApproverLastActivity),
    LastActivityTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    PendingBaselineSessionArn: S.optional(S.String),
    MfaMethods: S.optional(MfaMethods),
})).annotate({
    identifier: "GetApprovalTeamResponseApprover",
});
export const GetApprovalTeamResponseApprovers = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GetApprovalTeamResponseApprover);
export const ApprovalTeamStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ApprovalTeamStatusCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const PendingUpdate = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    VersionId: S.optional(S.String),
    Description: S.optional(S.String),
    ApprovalStrategy: S.optional(ApprovalStrategyResponse),
    NumberOfApprovers: S.optional(S.Number),
    Status: S.optional(ApprovalTeamStatus),
    StatusCode: S.optional(ApprovalTeamStatusCode),
    StatusMessage: S.optional(S.String),
    Approvers: S.optional(GetApprovalTeamResponseApprovers),
    UpdateInitiationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({ identifier: "PendingUpdate" });
export const GetApprovalTeamResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ApprovalStrategy: S.optional(ApprovalStrategyResponse),
    NumberOfApprovers: S.optional(S.Number),
    Approvers: S.optional(GetApprovalTeamResponseApprovers),
    Arn: S.optional(S.String),
    Description: S.optional(SensitiveString),
    Name: S.optional(S.String),
    Status: S.optional(ApprovalTeamStatus),
    StatusCode: S.optional(ApprovalTeamStatusCode),
    StatusMessage: S.optional(S.String),
    UpdateSessionArn: S.optional(S.String),
    VersionId: S.optional(S.String),
    Policies: S.optional(PoliciesReferences),
    LastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    PendingUpdate: S.optional(PendingUpdate),
})).annotate({
    identifier: "GetApprovalTeamResponse",
});
export const UpdateAction = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const UpdateActions = /*@__PURE__*/ /*#__PURE__*/ S.Array(UpdateAction);
export const UpdateApprovalTeamRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApprovalStrategy: S.optional(ApprovalStrategy),
    Approvers: S.optional(ApprovalTeamRequestApprovers),
    Description: S.optional(SensitiveString),
    Arn: S.String.pipe(T.HttpLabel("Arn")),
    UpdateActions: S.optional(UpdateActions),
}).pipe(T.all(T.Http({ method: "PATCH", uri: "/approval-teams/{Arn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateApprovalTeamRequest",
});
export const UpdateApprovalTeamResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ VersionId: S.optional(S.String) })).annotate({
    identifier: "UpdateApprovalTeamResponse",
});
export const DeleteInactiveApprovalTeamVersionRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Arn: S.String.pipe(T.HttpLabel("Arn")),
    VersionId: S.String.pipe(T.HttpLabel("VersionId")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/approval-teams/{Arn}/{VersionId}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteInactiveApprovalTeamVersionRequest",
});
export const DeleteInactiveApprovalTeamVersionResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteInactiveApprovalTeamVersionResponse",
});
export const ListApprovalTeamsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/approval-teams/?List" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListApprovalTeamsRequest",
});
export const ListApprovalTeamsResponseApprovalTeam = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ApprovalStrategy: S.optional(ApprovalStrategyResponse),
    NumberOfApprovers: S.optional(S.Number),
    Arn: S.optional(S.String),
    Name: S.optional(S.String),
    Description: S.optional(SensitiveString),
    Status: S.optional(ApprovalTeamStatus),
    StatusCode: S.optional(ApprovalTeamStatusCode),
    StatusMessage: S.optional(S.String),
})).annotate({
    identifier: "ListApprovalTeamsResponseApprovalTeam",
});
export const ListApprovalTeamsResponseApprovalTeams = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ListApprovalTeamsResponseApprovalTeam);
export const ListApprovalTeamsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    ApprovalTeams: S.optional(ListApprovalTeamsResponseApprovalTeams),
})).annotate({
    identifier: "ListApprovalTeamsResponse",
});
export const StartActiveApprovalTeamDeletionRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    PendingWindowDays: S.optional(S.Number),
    Arn: S.String.pipe(T.HttpLabel("Arn")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/approval-teams/{Arn}?Delete" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartActiveApprovalTeamDeletionRequest",
});
export const StartActiveApprovalTeamDeletionResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    DeletionCompletionTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    DeletionStartTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "StartActiveApprovalTeamDeletionResponse",
});
export const StartApprovalTeamBaselineApproverIds = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const StartApprovalTeamBaselineRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Arn: S.String.pipe(T.HttpLabel("Arn")),
    ApproverIds: S.optional(StartApprovalTeamBaselineApproverIds),
}).pipe(T.all(T.Http({ method: "POST", uri: "/approval-teams/{Arn}/baseline" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartApprovalTeamBaselineRequest",
});
export const StartApprovalTeamBaselineResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ BaselineSessionArn: S.optional(S.String) })).annotate({
    identifier: "StartApprovalTeamBaselineResponse",
});
export const IamIdentityCenter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ InstanceArn: S.String, Region: S.String })).annotate({
    identifier: "IamIdentityCenter",
});
export const IdentitySourceParameters = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IamIdentityCenter: S.optional(IamIdentityCenter) })).annotate({
    identifier: "IdentitySourceParameters",
});
export const CreateIdentitySourceRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceParameters: IdentitySourceParameters,
    ClientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    Tags: S.optional(Tags),
}).pipe(T.all(T.Http({ method: "POST", uri: "/identity-sources" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateIdentitySourceRequest",
});
export const IdentitySourceType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CreateIdentitySourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceType: S.optional(IdentitySourceType),
    IdentitySourceArn: S.optional(S.String),
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "CreateIdentitySourceResponse",
});
export const GetIdentitySourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceArn: S.String.pipe(T.HttpLabel("IdentitySourceArn")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/identity-sources/{IdentitySourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetIdentitySourceRequest",
});
export const IamIdentityCenterForGet = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    InstanceArn: S.optional(S.String),
    ApprovalPortalUrl: S.optional(S.String),
    Region: S.optional(S.String),
})).annotate({
    identifier: "IamIdentityCenterForGet",
});
export const IdentitySourceParametersForGet = 
/*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ IamIdentityCenter: IamIdentityCenterForGet }),
]);
export const IdentitySourceStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const IdentitySourceStatusCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GetIdentitySourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceType: S.optional(IdentitySourceType),
    IdentitySourceParameters: S.optional(IdentitySourceParametersForGet),
    IdentitySourceArn: S.optional(S.String),
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    Status: S.optional(IdentitySourceStatus),
    StatusCode: S.optional(IdentitySourceStatusCode),
    StatusMessage: S.optional(S.String),
})).annotate({
    identifier: "GetIdentitySourceResponse",
});
export const DeleteIdentitySourceRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceArn: S.String.pipe(T.HttpLabel("IdentitySourceArn")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/identity-sources/{IdentitySourceArn}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteIdentitySourceRequest",
});
export const DeleteIdentitySourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteIdentitySourceResponse",
});
export const ListIdentitySourcesRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("MaxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("NextToken")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/identity-sources/?List" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListIdentitySourcesRequest",
});
export const IamIdentityCenterForList = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    InstanceArn: S.optional(S.String),
    ApprovalPortalUrl: S.optional(S.String),
    Region: S.optional(S.String),
})).annotate({
    identifier: "IamIdentityCenterForList",
});
export const IdentitySourceParametersForList = 
/*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ IamIdentityCenter: IamIdentityCenterForList }),
]);
export const IdentitySourceForList = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentitySourceType: S.optional(IdentitySourceType),
    IdentitySourceParameters: S.optional(IdentitySourceParametersForList),
    IdentitySourceArn: S.optional(S.String),
    CreationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    Status: S.optional(IdentitySourceStatus),
    StatusCode: S.optional(IdentitySourceStatusCode),
    StatusMessage: S.optional(S.String),
})).annotate({
    identifier: "IdentitySourceForList",
});
export const IdentitySources = /*@__PURE__*/ /*#__PURE__*/ S.Array(IdentitySourceForList);
export const ListIdentitySourcesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    IdentitySources: S.optional(IdentitySources),
})).annotate({
    identifier: "ListIdentitySourcesResponse",
});
export const GetSessionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ SessionArn: S.String.pipe(T.HttpLabel("SessionArn")) }).pipe(T.all(T.Http({ method: "GET", uri: "/sessions/{SessionArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetSessionRequest",
});
export const SessionMetadata = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, SensitiveString.pipe(S.optional));
export const SessionStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SessionStatusCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SessionExecutionStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ActionCompletionStrategy = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SessionResponse = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GetSessionResponseApproverResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApproverId: S.optional(S.String),
    IdentitySourceArn: S.optional(S.String),
    IdentityId: S.optional(S.String),
    Response: S.optional(SessionResponse),
    ResponseTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "GetSessionResponseApproverResponse",
});
export const GetSessionResponseApproverResponses = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GetSessionResponseApproverResponse);
export const AdditionalSecurityRequirement = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const AdditionalSecurityRequirements = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AdditionalSecurityRequirement);
export const GetSessionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    SessionArn: S.optional(S.String),
    ApprovalTeamArn: S.optional(S.String),
    ApprovalTeamName: S.optional(S.String),
    ProtectedResourceArn: S.optional(S.String),
    ApprovalStrategy: S.optional(ApprovalStrategyResponse),
    NumberOfApprovers: S.optional(S.Number),
    InitiationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ExpirationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    CompletionTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    Description: S.optional(SensitiveString),
    Metadata: S.optional(SessionMetadata),
    Status: S.optional(SessionStatus),
    StatusCode: S.optional(SessionStatusCode),
    StatusMessage: S.optional(S.String),
    ExecutionStatus: S.optional(SessionExecutionStatus),
    ActionName: S.optional(S.String),
    RequesterServicePrincipal: S.optional(S.String),
    RequesterPrincipalArn: S.optional(S.String),
    RequesterAccountId: S.optional(S.String),
    RequesterRegion: S.optional(S.String),
    RequesterComment: S.optional(SensitiveString),
    ActionCompletionStrategy: S.optional(ActionCompletionStrategy),
    ApproverResponses: S.optional(GetSessionResponseApproverResponses),
    AdditionalSecurityRequirements: S.optional(AdditionalSecurityRequirements),
})).annotate({
    identifier: "GetSessionResponse",
});
export const CancelSessionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ SessionArn: S.String.pipe(T.HttpLabel("SessionArn")) }).pipe(T.all(T.Http({ method: "PUT", uri: "/sessions/{SessionArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CancelSessionRequest",
});
export const CancelSessionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "CancelSessionResponse",
});
export const FilterField = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Operator = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Filter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    FieldName: S.optional(FilterField),
    Operator: S.optional(Operator),
    Value: S.optional(S.String),
})).annotate({ identifier: "Filter" });
export const Filters = /*@__PURE__*/ /*#__PURE__*/ S.Array(Filter);
export const ListSessionsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ApprovalTeamArn: S.String.pipe(T.HttpLabel("ApprovalTeamArn")),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(Filters),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/approval-teams/{ApprovalTeamArn}/sessions/?List",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListSessionsRequest",
});
export const ListSessionsResponseSession = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    SessionArn: S.optional(S.String),
    ApprovalTeamName: S.optional(S.String),
    ApprovalTeamArn: S.optional(S.String),
    InitiationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    ExpirationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    CompletionTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    Description: S.optional(SensitiveString),
    ActionName: S.optional(S.String),
    ProtectedResourceArn: S.optional(S.String),
    RequesterServicePrincipal: S.optional(S.String),
    RequesterPrincipalArn: S.optional(S.String),
    RequesterRegion: S.optional(S.String),
    RequesterAccountId: S.optional(S.String),
    Status: S.optional(SessionStatus),
    StatusCode: S.optional(SessionStatusCode),
    StatusMessage: S.optional(S.String),
    ActionCompletionStrategy: S.optional(ActionCompletionStrategy),
    AdditionalSecurityRequirements: S.optional(AdditionalSecurityRequirements),
})).annotate({
    identifier: "ListSessionsResponseSession",
});
export const ListSessionsResponseSessions = /*@__PURE__*/ /*#__PURE__*/ S.Array(ListSessionsResponseSession);
export const ListSessionsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    NextToken: S.optional(S.String),
    Sessions: S.optional(ListSessionsResponseSessions),
})).annotate({
    identifier: "ListSessionsResponse",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { Message: S.String }).pipe(C.withAuthError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { Message: S.String }, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { Message: S.String }).pipe(C.withBadRequestError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { Message: S.String }).pipe(C.withThrottlingError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { Message: S.String }).pipe(C.withBadRequestError) {
}
export class InvalidParameterException extends S.TaggedErrorClass()("InvalidParameterException", { Message: S.String }).pipe(C.withBadRequestError) {
}
export class TooManyTagsException extends S.TaggedErrorClass()("TooManyTagsException", { Message: S.String, ResourceName: S.optional(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 }).pipe(C.withQuotaError) {
}
/**
 * Returns details for the version of a policy. Policies define the permissions for team resources.
 */
export const getPolicyVersion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetPolicyVersionRequest,
    output: GetPolicyVersionResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns details about a policy for a resource.
 */
export const getResourcePolicy = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetResourcePolicyRequest,
    output: GetResourcePolicyResponse,
    errors: [
        AccessDeniedException,
        InvalidParameterException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of policies. Policies define the permissions for team resources.
 */
export const listPolicies = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListPoliciesRequest,
    output: ListPoliciesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Policies",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of the versions for policies. Policies define the permissions for team resources.
 */
export const listPolicyVersions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListPolicyVersionsRequest,
    output: ListPolicyVersionsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "PolicyVersions",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of policies for a resource.
 */
export const listResourcePolicies = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListResourcePoliciesRequest,
    output: ListResourcePoliciesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ResourcePolicies",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of the tags for a resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates or updates a resource tag. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        TooManyTagsException,
        ValidationException,
    ],
}));
/**
 * Removes a resource tag. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a new approval team. For more information, see Approval team in the *Multi-party approval User Guide*.
 */
export const createApprovalTeam = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateApprovalTeamRequest,
    output: CreateApprovalTeamResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns details for an approval team.
 */
export const getApprovalTeam = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetApprovalTeamRequest,
    output: GetApprovalTeamResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates an approval team. You can request to update the team description, approval threshold, and approvers in the team.
 *
 * **Updates require team approval**
 *
 * Updates to an active team must be approved by the team.
 */
export const updateApprovalTeam = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateApprovalTeamRequest,
    output: UpdateApprovalTeamResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an inactive approval team. For more information, see Team health in the *Multi-party approval User Guide*.
 *
 * You can also use this operation to delete a team draft. For more information, see Interacting with drafts in the *Multi-party approval User Guide*.
 */
export const deleteInactiveApprovalTeamVersion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteInactiveApprovalTeamVersionRequest,
    output: DeleteInactiveApprovalTeamVersionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of approval teams.
 */
export const listApprovalTeams = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListApprovalTeamsRequest,
    output: ListApprovalTeamsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ApprovalTeams",
        pageSize: "MaxResults",
    },
}));
/**
 * Starts the deletion process for an active approval team.
 *
 * **Deletions require team approval**
 *
 * Requests to delete an active team must be approved by the team.
 */
export const startActiveApprovalTeamDeletion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartActiveApprovalTeamDeletionRequest,
    output: StartActiveApprovalTeamDeletionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Starts a baseline session for specified approvers on an `ACTIVE` approval team.
 */
export const startApprovalTeamBaseline = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartApprovalTeamBaselineRequest,
    output: StartApprovalTeamBaselineResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a new identity source. For more information, see Identity Source in the *Multi-party approval User Guide*.
 */
export const createIdentitySource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateIdentitySourceRequest,
    output: CreateIdentitySourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns details for an identity source. For more information, see Identity Source in the *Multi-party approval User Guide*.
 */
export const getIdentitySource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetIdentitySourceRequest,
    output: GetIdentitySourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an identity source. For more information, see Identity Source in the *Multi-party approval User Guide*.
 */
export const deleteIdentitySource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteIdentitySourceRequest,
    output: DeleteIdentitySourceResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of identity sources. For more information, see Identity Source in the *Multi-party approval User Guide*.
 */
export const listIdentitySources = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListIdentitySourcesRequest,
    output: ListIdentitySourcesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "IdentitySources",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns details for an approval session. For more information, see Session in the *Multi-party approval User Guide*.
 */
export const getSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetSessionRequest,
    output: GetSessionResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Cancels an approval session. For more information, see Session in the *Multi-party approval User Guide*.
 */
export const cancelSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CancelSessionRequest,
    output: CancelSessionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of approval sessions. For more information, see Session in the *Multi-party approval User Guide*.
 */
export const listSessions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListSessionsRequest,
    output: ListSessionsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Sessions",
        pageSize: "MaxResults",
    },
}));
//# sourceMappingURL=mpa.js.map