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: "identitystore",
    serviceShapeName: "AWSIdentityStore",
});
const auth = T.AwsAuthSigv4({ name: "identitystore" });
const ver = T.ServiceVersion("2020-06-15");
const proto = T.AwsProtocolsAwsJson1_1();
const rules = T.EndpointResolver((p, _) => {
    const { Region, UseDualStack = false, UseFIPS = false, Endpoint } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://identitystore-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        if (_.getAttr(PartitionResult, "name") === "aws-us-gov") {
                            return e(`https://identitystore.${Region}.amazonaws.com`);
                        }
                        return e(`https://identitystore-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://identitystore.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://identitystore.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const ExternalId = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Issuer: SensitiveString, Id: SensitiveString })).annotate({ identifier: "ExternalId" });
export const UniqueAttribute = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ AttributePath: S.String, AttributeValue: S.Any })).annotate({
    identifier: "UniqueAttribute",
});
export const AlternateIdentifier = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ ExternalId: ExternalId }),
    S.Struct({ UniqueAttribute: UniqueAttribute }),
]);
export const GetGroupIdRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    AlternateIdentifier: AlternateIdentifier,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetGroupIdRequest",
});
export const GetGroupIdResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupId: S.String, IdentityStoreId: S.String })).annotate({
    identifier: "GetGroupIdResponse",
});
export const ResourceType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceNotFoundExceptionReason = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const ValidationExceptionReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const MemberId = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ UserId: S.String }),
]);
export const GetGroupMembershipIdRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    GroupId: S.String,
    MemberId: MemberId,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetGroupMembershipIdRequest",
});
export const GetGroupMembershipIdResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MembershipId: S.String, IdentityStoreId: S.String })).annotate({
    identifier: "GetGroupMembershipIdResponse",
});
export const GetUserIdRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    AlternateIdentifier: AlternateIdentifier,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetUserIdRequest",
});
export const GetUserIdResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, UserId: S.String })).annotate({
    identifier: "GetUserIdResponse",
});
export const GroupIds = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const IsMemberInGroupsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    MemberId: MemberId,
    GroupIds: GroupIds,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "IsMemberInGroupsRequest",
});
export const GroupMembershipExistenceResult = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupId: S.optional(S.String),
    MemberId: S.optional(MemberId),
    MembershipExists: S.optional(S.Boolean),
})).annotate({
    identifier: "GroupMembershipExistenceResult",
});
export const GroupMembershipExistenceResults = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GroupMembershipExistenceResult);
export const IsMemberInGroupsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Results: GroupMembershipExistenceResults })).annotate({
    identifier: "IsMemberInGroupsResponse",
});
export const ListGroupMembershipsForMemberRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    MemberId: MemberId,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupMembershipsForMemberRequest",
});
export const GroupMembership = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    MembershipId: S.optional(S.String),
    GroupId: S.optional(S.String),
    MemberId: S.optional(MemberId),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedBy: S.optional(S.String),
})).annotate({
    identifier: "GroupMembership",
});
export const GroupMemberships = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GroupMembership);
export const ListGroupMembershipsForMemberResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupMemberships: GroupMemberships,
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListGroupMembershipsForMemberResponse",
});
export const CreateGroupMembershipRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    GroupId: S.String,
    MemberId: MemberId,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateGroupMembershipRequest",
});
export const CreateGroupMembershipResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ MembershipId: S.String, IdentityStoreId: S.String })).annotate({
    identifier: "CreateGroupMembershipResponse",
});
export const ConflictExceptionReason = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DescribeGroupMembershipRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, MembershipId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeGroupMembershipRequest",
});
export const DescribeGroupMembershipResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    MembershipId: S.String,
    GroupId: S.String,
    MemberId: MemberId,
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedBy: S.optional(S.String),
})).annotate({
    identifier: "DescribeGroupMembershipResponse",
});
export const DeleteGroupMembershipRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, MembershipId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteGroupMembershipRequest",
});
export const DeleteGroupMembershipResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteGroupMembershipResponse",
});
export const ListGroupMembershipsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    GroupId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupMembershipsRequest",
});
export const ListGroupMembershipsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupMemberships: GroupMemberships,
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListGroupMembershipsResponse",
});
export const CreateGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    DisplayName: S.optional(SensitiveString),
    Description: S.optional(SensitiveString),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateGroupRequest",
});
export const CreateGroupResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupId: S.String, IdentityStoreId: S.String })).annotate({
    identifier: "CreateGroupResponse",
});
export const DescribeGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, GroupId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeGroupRequest",
});
export const ExternalIds = /*@__PURE__*/ /*#__PURE__*/ S.Array(ExternalId);
export const DescribeGroupResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupId: S.String,
    DisplayName: S.optional(SensitiveString),
    ExternalIds: S.optional(ExternalIds),
    Description: S.optional(SensitiveString),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedBy: S.optional(S.String),
    IdentityStoreId: S.String,
})).annotate({
    identifier: "DescribeGroupResponse",
});
export const AttributeOperation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ AttributePath: S.String, AttributeValue: S.optional(S.Any) })).annotate({
    identifier: "AttributeOperation",
});
export const AttributeOperations = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AttributeOperation);
export const UpdateGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    GroupId: S.String,
    Operations: AttributeOperations,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateGroupRequest",
});
export const UpdateGroupResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateGroupResponse",
});
export const DeleteGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, GroupId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteGroupRequest",
});
export const DeleteGroupResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteGroupResponse",
});
export const Filter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ AttributePath: S.String, AttributeValue: SensitiveString })).annotate({ identifier: "Filter" });
export const Filters = /*@__PURE__*/ /*#__PURE__*/ S.Array(Filter);
export const ListGroupsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(Filters),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupsRequest",
});
export const Group = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupId: S.String,
    DisplayName: S.optional(SensitiveString),
    ExternalIds: S.optional(ExternalIds),
    Description: S.optional(SensitiveString),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedBy: S.optional(S.String),
    IdentityStoreId: S.String,
})).annotate({ identifier: "Group" });
export const Groups = /*@__PURE__*/ /*#__PURE__*/ S.Array(Group);
export const ListGroupsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Groups: Groups, NextToken: S.optional(S.String) })).annotate({
    identifier: "ListGroupsResponse",
});
export const Name = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Formatted: S.optional(SensitiveString),
    FamilyName: S.optional(SensitiveString),
    GivenName: S.optional(SensitiveString),
    MiddleName: S.optional(SensitiveString),
    HonorificPrefix: S.optional(SensitiveString),
    HonorificSuffix: S.optional(SensitiveString),
})).annotate({ identifier: "Name" });
export const Email = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Value: S.optional(SensitiveString),
    Type: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "Email" });
export const Emails = /*@__PURE__*/ /*#__PURE__*/ S.Array(Email);
export const Address = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    StreetAddress: S.optional(SensitiveString),
    Locality: S.optional(SensitiveString),
    Region: S.optional(SensitiveString),
    PostalCode: S.optional(SensitiveString),
    Country: S.optional(SensitiveString),
    Formatted: S.optional(SensitiveString),
    Type: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "Address" });
export const Addresses = /*@__PURE__*/ /*#__PURE__*/ S.Array(Address);
export const PhoneNumber = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Value: S.optional(SensitiveString),
    Type: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "PhoneNumber" });
export const PhoneNumbers = /*@__PURE__*/ /*#__PURE__*/ S.Array(PhoneNumber);
export const Photo = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Value: SensitiveString,
    Type: S.optional(SensitiveString),
    Display: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "Photo" });
export const Photos = /*@__PURE__*/ /*#__PURE__*/ S.Array(Photo);
export const Role = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Value: S.optional(SensitiveString),
    Type: S.optional(SensitiveString),
    Primary: S.optional(S.Boolean),
})).annotate({ identifier: "Role" });
export const Roles = /*@__PURE__*/ /*#__PURE__*/ S.Array(Role);
export const Extensions = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.Any.pipe(S.optional));
export const CreateUserRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    UserName: S.optional(SensitiveString),
    Name: S.optional(Name),
    DisplayName: S.optional(SensitiveString),
    NickName: S.optional(SensitiveString),
    ProfileUrl: S.optional(SensitiveString),
    Emails: S.optional(Emails),
    Addresses: S.optional(Addresses),
    PhoneNumbers: S.optional(PhoneNumbers),
    UserType: S.optional(SensitiveString),
    Title: S.optional(SensitiveString),
    PreferredLanguage: S.optional(SensitiveString),
    Locale: S.optional(SensitiveString),
    Timezone: S.optional(SensitiveString),
    Photos: S.optional(Photos),
    Website: S.optional(SensitiveString),
    Birthdate: S.optional(SensitiveString),
    Roles: S.optional(Roles),
    Extensions: S.optional(Extensions),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateUserRequest",
});
export const CreateUserResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, UserId: S.String })).annotate({
    identifier: "CreateUserResponse",
});
export const ExtensionNames = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const DescribeUserRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    UserId: S.String,
    Extensions: S.optional(ExtensionNames),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeUserRequest",
});
export const UserStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const DescribeUserResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    UserId: S.String,
    UserName: S.optional(SensitiveString),
    ExternalIds: S.optional(ExternalIds),
    Name: S.optional(Name),
    DisplayName: S.optional(SensitiveString),
    NickName: S.optional(SensitiveString),
    ProfileUrl: S.optional(SensitiveString),
    Emails: S.optional(Emails),
    Addresses: S.optional(Addresses),
    PhoneNumbers: S.optional(PhoneNumbers),
    UserType: S.optional(SensitiveString),
    Title: S.optional(SensitiveString),
    PreferredLanguage: S.optional(SensitiveString),
    Locale: S.optional(SensitiveString),
    Timezone: S.optional(SensitiveString),
    UserStatus: S.optional(UserStatus),
    Photos: S.optional(Photos),
    Website: S.optional(SensitiveString),
    Birthdate: S.optional(SensitiveString),
    Roles: S.optional(Roles),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedBy: S.optional(S.String),
    Extensions: S.optional(Extensions),
})).annotate({
    identifier: "DescribeUserResponse",
});
export const UpdateUserRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    UserId: S.String,
    Operations: AttributeOperations,
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateUserRequest",
});
export const UpdateUserResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateUserResponse",
});
export const DeleteUserRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ IdentityStoreId: S.String, UserId: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteUserRequest",
});
export const DeleteUserResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteUserResponse",
});
export const ListUsersRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    Extensions: S.optional(ExtensionNames),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
    Filters: S.optional(Filters),
}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListUsersRequest",
});
export const User = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    IdentityStoreId: S.String,
    UserId: S.String,
    UserName: S.optional(SensitiveString),
    ExternalIds: S.optional(ExternalIds),
    Name: S.optional(Name),
    DisplayName: S.optional(SensitiveString),
    NickName: S.optional(SensitiveString),
    ProfileUrl: S.optional(SensitiveString),
    Emails: S.optional(Emails),
    Addresses: S.optional(Addresses),
    PhoneNumbers: S.optional(PhoneNumbers),
    UserType: S.optional(SensitiveString),
    Title: S.optional(SensitiveString),
    PreferredLanguage: S.optional(SensitiveString),
    Locale: S.optional(SensitiveString),
    Timezone: S.optional(SensitiveString),
    UserStatus: S.optional(UserStatus),
    Photos: S.optional(Photos),
    Website: S.optional(SensitiveString),
    Birthdate: S.optional(SensitiveString),
    Roles: S.optional(Roles),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    CreatedBy: S.optional(S.String),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
    UpdatedBy: S.optional(S.String),
    Extensions: S.optional(Extensions),
})).annotate({ identifier: "User" });
export const Users = /*@__PURE__*/ /*#__PURE__*/ S.Array(User);
export const ListUsersResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Users: Users, NextToken: S.optional(S.String) })).annotate({
    identifier: "ListUsersResponse",
});
//# Errors
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", {
    ResourceType: S.optional(ResourceType),
    ResourceId: S.optional(S.String),
    Reason: S.optional(ResourceNotFoundExceptionReason),
    Message: S.optional(S.String),
    RequestId: S.optional(S.String),
}).pipe(C.withBadRequestError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    Message: S.optional(S.String),
    RequestId: S.optional(S.String),
    Reason: S.optional(ValidationExceptionReason),
}).pipe(C.withBadRequestError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", {
    Message: S.optional(S.String),
    RequestId: S.optional(S.String),
    Reason: S.optional(ConflictExceptionReason),
}).pipe(C.withConflictError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", { Message: S.optional(S.String), RequestId: S.optional(S.String) }).pipe(C.withQuotaError) {
}
/**
 * Retrieves `GroupId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const getGroupId = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGroupIdRequest,
    output: GetGroupIdResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Retrieves the `MembershipId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const getGroupMembershipId = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGroupMembershipIdRequest,
    output: GetGroupMembershipIdResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Retrieves the `UserId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const getUserId = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetUserIdRequest,
    output: GetUserIdResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Checks the user's membership in all requested groups and returns if the member exists in all queried groups.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const isMemberInGroups = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: IsMemberInGroupsRequest,
    output: IsMemberInGroupsResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * For the specified member in the specified identity store, returns the list of all ` GroupMembership` objects and returns results in paginated form.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const listGroupMembershipsForMember = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupMembershipsForMemberRequest,
    output: ListGroupMembershipsForMemberResponse,
    errors: [ResourceNotFoundException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "GroupMemberships",
        pageSize: "MaxResults",
    },
}));
/**
 * Creates a relationship between a member and a group. The following identifiers must be specified: `GroupId`, `IdentityStoreId`, and `MemberId`.
 */
export const createGroupMembership = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateGroupMembershipRequest,
    output: CreateGroupMembershipResponse,
    errors: [
        ConflictException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Retrieves membership metadata and attributes from `MembershipId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const describeGroupMembership = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeGroupMembershipRequest,
    output: DescribeGroupMembershipResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Delete a membership within a group given `MembershipId`.
 */
export const deleteGroupMembership = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteGroupMembershipRequest,
    output: DeleteGroupMembershipResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * For the specified group in the specified identity store, returns the list of all ` GroupMembership` objects and returns results in paginated form.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const listGroupMemberships = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupMembershipsRequest,
    output: ListGroupMembershipsResponse,
    errors: [ResourceNotFoundException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "GroupMemberships",
        pageSize: "MaxResults",
    },
}));
/**
 * Creates a group within the specified identity store.
 */
export const createGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateGroupRequest,
    output: CreateGroupResponse,
    errors: [
        ConflictException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Retrieves the group metadata and attributes from `GroupId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const describeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeGroupRequest,
    output: DescribeGroupResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Updates the specified group metadata and attributes in the specified identity store.
 */
export const updateGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateGroupRequest,
    output: UpdateGroupResponse,
    errors: [
        ConflictException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Delete a group within an identity store given `GroupId`.
 */
export const deleteGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteGroupRequest,
    output: DeleteGroupResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * Lists all groups in the identity store. Returns a paginated list of complete `Group` objects. Filtering for a `Group` by the `DisplayName` attribute is deprecated. Instead, use the `GetGroupId` API action.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const listGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupsRequest,
    output: ListGroupsResponse,
    errors: [ResourceNotFoundException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Groups",
        pageSize: "MaxResults",
    },
}));
/**
 * Creates a user within the specified identity store.
 */
export const createUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateUserRequest,
    output: CreateUserResponse,
    errors: [
        ConflictException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Retrieves the user metadata and attributes from the `UserId` in an identity store.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const describeUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeUserRequest,
    output: DescribeUserResponse,
    errors: [ResourceNotFoundException, ValidationException],
}));
/**
 * Updates the specified user metadata and attributes in the specified identity store.
 */
export const updateUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateUserRequest,
    output: UpdateUserResponse,
    errors: [
        ConflictException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Deletes a user within an identity store given `UserId`.
 */
export const deleteUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteUserRequest,
    output: DeleteUserResponse,
    errors: [ConflictException, ResourceNotFoundException, ValidationException],
}));
/**
 * Lists all users in the identity store. Returns a paginated list of complete `User` objects. Filtering for a `User` by the `UserName` attribute is deprecated. Instead, use the `GetUserId` API action.
 *
 * If you have access to a member account, you can use this API operation from the member account. For more information, see Limiting access to the identity store from member accounts in the * IAM Identity Center User Guide*.
 */
export const listUsers = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListUsersRequest,
    output: ListUsersResponse,
    errors: [ResourceNotFoundException, ValidationException],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "Users",
        pageSize: "MaxResults",
    },
}));
//# sourceMappingURL=identitystore.js.map