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: "AppFabric",
    serviceShapeName: "FabricFrontEndService",
});
const auth = T.AwsAuthSigv4({ name: "appfabric" });
const ver = T.ServiceVersion("2023-05-19");
const proto = T.AwsProtocolsRestJson1();
const rules = T.EndpointResolver((p, _) => {
    const { Region, UseDualStack = false, UseFIPS = false, Endpoint } = p;
    const e = (u, p = {}, h = {}) => ({
        type: "endpoint",
        endpoint: { url: u, properties: p, headers: h },
    });
    const err = (m) => ({
        type: "error",
        message: m,
    });
    if (Endpoint != null) {
        if (UseFIPS === true) {
            return err("Invalid Configuration: FIPS and custom endpoint are not supported");
        }
        if (UseDualStack === true) {
            return err("Invalid Configuration: Dualstack and custom endpoint are not supported");
        }
        return e(Endpoint);
    }
    if (Region != null) {
        {
            const PartitionResult = _.partition(Region);
            if (PartitionResult != null && PartitionResult !== false) {
                if (UseFIPS === true && UseDualStack === true) {
                    if (true === _.getAttr(PartitionResult, "supportsFIPS") &&
                        true === _.getAttr(PartitionResult, "supportsDualStack")) {
                        return e(`https://appfabric-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://appfabric-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://appfabric.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://appfabric.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const TaskIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const BatchGetUserAccessTasksRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appBundleIdentifier: S.String, taskIdList: TaskIdList }).pipe(T.all(T.Http({ method: "POST", uri: "/useraccess/batchget" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchGetUserAccessTasksRequest",
});
export const ResultStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const TaskError = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    errorCode: S.optional(S.String),
    errorMessage: S.optional(S.String),
})).annotate({ identifier: "TaskError" });
export const UserAccessResultItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    app: S.optional(S.String),
    tenantId: S.optional(S.String),
    tenantDisplayName: S.optional(S.String),
    taskId: S.optional(S.String),
    resultStatus: S.optional(ResultStatus),
    email: S.optional(SensitiveString),
    userId: S.optional(SensitiveString),
    userFullName: S.optional(SensitiveString),
    userFirstName: S.optional(SensitiveString),
    userLastName: S.optional(SensitiveString),
    userStatus: S.optional(S.String),
    taskError: S.optional(TaskError),
})).annotate({
    identifier: "UserAccessResultItem",
});
export const UserAccessResultsList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(UserAccessResultItem);
export const BatchGetUserAccessTasksResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ userAccessResultsList: S.optional(UserAccessResultsList) })).annotate({
    identifier: "BatchGetUserAccessTasksResponse",
});
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 AuthRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ redirectUri: S.String, code: SensitiveString })).annotate({ identifier: "AuthRequest" });
export const ConnectAppAuthorizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    appAuthorizationIdentifier: S.String.pipe(T.HttpLabel("appAuthorizationIdentifier")),
    authRequest: S.optional(AuthRequest),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}/connect",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ConnectAppAuthorizationRequest",
});
export const Tenant = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tenantIdentifier: S.String, tenantDisplayName: S.String })).annotate({ identifier: "Tenant" });
export const AppAuthorizationStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AppAuthorizationSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appAuthorizationArn: S.String,
    appBundleArn: S.String,
    app: S.String,
    tenant: Tenant,
    status: AppAuthorizationStatus,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({
    identifier: "AppAuthorizationSummary",
});
export const ConnectAppAuthorizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appAuthorizationSummary: AppAuthorizationSummary })).annotate({
    identifier: "ConnectAppAuthorizationResponse",
});
export const Oauth2Credential = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ clientId: S.String, clientSecret: SensitiveString })).annotate({
    identifier: "Oauth2Credential",
});
export const ApiKeyCredential = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ apiKey: SensitiveString })).annotate({
    identifier: "ApiKeyCredential",
});
export const Credential = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ oauth2Credential: Oauth2Credential }),
    S.Struct({ apiKeyCredential: ApiKeyCredential }),
]);
export const AuthType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Tag = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ key: S.String, value: S.String })).annotate({ identifier: "Tag" });
export const TagList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Tag);
export const CreateAppAuthorizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    app: S.String,
    credential: Credential,
    tenant: Tenant,
    authType: AuthType,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(TagList),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateAppAuthorizationRequest",
});
export const Persona = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AppAuthorization = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appAuthorizationArn: S.String,
    appBundleArn: S.String,
    app: S.String,
    tenant: Tenant,
    authType: AuthType,
    status: AppAuthorizationStatus,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    persona: S.optional(Persona),
    authUrl: S.optional(S.String),
})).annotate({
    identifier: "AppAuthorization",
});
export const CreateAppAuthorizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appAuthorization: AppAuthorization })).annotate({
    identifier: "CreateAppAuthorizationResponse",
});
export const CreateAppBundleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    customerManagedKeyIdentifier: S.optional(S.String),
    tags: S.optional(TagList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/appbundles" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateAppBundleRequest",
});
export const AppBundle = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ arn: S.String, customerManagedKeyArn: S.optional(S.String) })).annotate({ identifier: "AppBundle" });
export const CreateAppBundleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appBundle: AppBundle })).annotate({
    identifier: "CreateAppBundleResponse",
});
export const IngestionType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CreateIngestionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    app: S.String,
    tenantId: S.String,
    ingestionType: IngestionType,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(TagList),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/ingestions",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateIngestionRequest",
});
export const IngestionState = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Ingestion = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    arn: S.String,
    appBundleArn: S.String,
    app: S.String,
    tenantId: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    state: IngestionState,
    ingestionType: IngestionType,
})).annotate({ identifier: "Ingestion" });
export const CreateIngestionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestion: Ingestion })).annotate({
    identifier: "CreateIngestionResponse",
});
export const Schema = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Format = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AuditLogProcessingConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ schema: Schema, format: Format })).annotate({
    identifier: "AuditLogProcessingConfiguration",
});
export const ProcessingConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ auditLog: AuditLogProcessingConfiguration }),
]);
export const S3Bucket = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ bucketName: S.String, prefix: S.optional(S.String) })).annotate({ identifier: "S3Bucket" });
export const FirehoseStream = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ streamName: S.String })).annotate({ identifier: "FirehoseStream" });
export const Destination = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ s3Bucket: S3Bucket }),
    S.Struct({ firehoseStream: FirehoseStream }),
]);
export const AuditLogDestinationConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ destination: Destination })).annotate({
    identifier: "AuditLogDestinationConfiguration",
});
export const DestinationConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ auditLog: AuditLogDestinationConfiguration }),
]);
export const CreateIngestionDestinationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    processingConfiguration: ProcessingConfiguration,
    destinationConfiguration: DestinationConfiguration,
    clientToken: S.optional(S.String).pipe(T.IdempotencyToken()),
    tags: S.optional(TagList),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateIngestionDestinationRequest",
});
export const IngestionDestinationStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const IngestionDestination = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    arn: S.String,
    ingestionArn: S.String,
    processingConfiguration: ProcessingConfiguration,
    destinationConfiguration: DestinationConfiguration,
    status: S.optional(IngestionDestinationStatus),
    statusReason: S.optional(S.String),
    createdAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "IngestionDestination",
});
export const CreateIngestionDestinationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestionDestination: IngestionDestination })).annotate({
    identifier: "CreateIngestionDestinationResponse",
});
export const DeleteAppAuthorizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    appAuthorizationIdentifier: S.String.pipe(T.HttpLabel("appAuthorizationIdentifier")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteAppAuthorizationRequest",
});
export const DeleteAppAuthorizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteAppAuthorizationResponse",
});
export const DeleteAppBundleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/appbundles/{appBundleIdentifier}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteAppBundleRequest",
});
export const DeleteAppBundleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteAppBundleResponse",
});
export const DeleteIngestionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteIngestionRequest",
});
export const DeleteIngestionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteIngestionResponse",
});
export const DeleteIngestionDestinationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    ingestionDestinationIdentifier: S.String.pipe(T.HttpLabel("ingestionDestinationIdentifier")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteIngestionDestinationRequest",
});
export const DeleteIngestionDestinationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteIngestionDestinationResponse",
});
export const GetAppAuthorizationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    appAuthorizationIdentifier: S.String.pipe(T.HttpLabel("appAuthorizationIdentifier")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAppAuthorizationRequest",
});
export const GetAppAuthorizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appAuthorization: AppAuthorization })).annotate({
    identifier: "GetAppAuthorizationResponse",
});
export const GetAppBundleRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/appbundles/{appBundleIdentifier}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAppBundleRequest",
});
export const GetAppBundleResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appBundle: AppBundle })).annotate({
    identifier: "GetAppBundleResponse",
});
export const GetIngestionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetIngestionRequest",
});
export const GetIngestionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestion: Ingestion })).annotate({
    identifier: "GetIngestionResponse",
});
export const GetIngestionDestinationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    ingestionDestinationIdentifier: S.String.pipe(T.HttpLabel("ingestionDestinationIdentifier")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetIngestionDestinationRequest",
});
export const GetIngestionDestinationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestionDestination: IngestionDestination })).annotate({
    identifier: "GetIngestionDestinationResponse",
});
export const ListAppAuthorizationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAppAuthorizationsRequest",
});
export const AppAuthorizationSummaryList = /*@__PURE__*/ /*#__PURE__*/ S.Array(AppAuthorizationSummary);
export const ListAppAuthorizationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appAuthorizationSummaryList: AppAuthorizationSummaryList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAppAuthorizationsResponse",
});
export const ListAppBundlesRequest = /*@__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: "GET", uri: "/appbundles" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAppBundlesRequest",
});
export const AppBundleSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ arn: S.String })).annotate({
    identifier: "AppBundleSummary",
});
export const AppBundleSummaryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(AppBundleSummary);
export const ListAppBundlesResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleSummaryList: AppBundleSummaryList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAppBundlesResponse",
});
export const ListIngestionDestinationsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListIngestionDestinationsRequest",
});
export const IngestionDestinationSummary = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ arn: S.String })).annotate({
    identifier: "IngestionDestinationSummary",
});
export const IngestionDestinationList = /*@__PURE__*/ /*#__PURE__*/ S.Array(IngestionDestinationSummary);
export const ListIngestionDestinationsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ingestionDestinations: IngestionDestinationList,
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListIngestionDestinationsResponse",
});
export const ListIngestionsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/appbundles/{appBundleIdentifier}/ingestions",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListIngestionsRequest",
});
export const IngestionSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    arn: S.String,
    app: S.String,
    tenantId: S.String,
    state: IngestionState,
})).annotate({
    identifier: "IngestionSummary",
});
export const IngestionList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(IngestionSummary);
export const ListIngestionsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestions: IngestionList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListIngestionsResponse",
});
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 ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tags: S.optional(TagList) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const StartIngestionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/start",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartIngestionRequest",
});
export const StartIngestionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "StartIngestionResponse",
});
export const StartUserAccessTasksRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appBundleIdentifier: S.String, email: SensitiveString }).pipe(T.all(T.Http({ method: "POST", uri: "/useraccess/start" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartUserAccessTasksRequest",
});
export const UserAccessTaskItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    app: S.String,
    tenantId: S.String,
    taskId: S.optional(S.String),
    error: S.optional(TaskError),
})).annotate({
    identifier: "UserAccessTaskItem",
});
export const UserAccessTasksList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(UserAccessTaskItem);
export const StartUserAccessTasksResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ userAccessTasksList: S.optional(UserAccessTasksList) })).annotate({
    identifier: "StartUserAccessTasksResponse",
});
export const StopIngestionRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
}).pipe(T.all(T.Http({
    method: "POST",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/stop",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "StopIngestionRequest",
});
export const StopIngestionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "StopIngestionResponse",
});
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tags: TagList,
}).pipe(T.all(T.Http({ method: "POST", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceRequest",
});
export const TagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "TagResourceResponse",
});
export const TagKeyList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.String.pipe(T.HttpLabel("resourceArn")),
    tagKeys: TagKeyList.pipe(T.HttpQuery("tagKeys")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/tags/{resourceArn}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceRequest",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceResponse",
});
export const UpdateAppAuthorizationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    appAuthorizationIdentifier: S.String.pipe(T.HttpLabel("appAuthorizationIdentifier")),
    credential: S.optional(Credential),
    tenant: S.optional(Tenant),
}).pipe(T.all(T.Http({
    method: "PATCH",
    uri: "/appbundles/{appBundleIdentifier}/appauthorizations/{appAuthorizationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateAppAuthorizationRequest",
});
export const UpdateAppAuthorizationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ appAuthorization: AppAuthorization })).annotate({
    identifier: "UpdateAppAuthorizationResponse",
});
export const UpdateIngestionDestinationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appBundleIdentifier: S.String.pipe(T.HttpLabel("appBundleIdentifier")),
    ingestionIdentifier: S.String.pipe(T.HttpLabel("ingestionIdentifier")),
    ingestionDestinationIdentifier: S.String.pipe(T.HttpLabel("ingestionDestinationIdentifier")),
    destinationConfiguration: DestinationConfiguration,
}).pipe(T.all(T.Http({
    method: "PATCH",
    uri: "/appbundles/{appBundleIdentifier}/ingestions/{ingestionIdentifier}/ingestiondestinations/{ingestionDestinationIdentifier}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateIngestionDestinationRequest",
});
export const UpdateIngestionDestinationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ingestionDestination: IngestionDestination })).annotate({
    identifier: "UpdateIngestionDestinationResponse",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { message: S.String }).pipe(C.withAuthError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", {
    message: S.String,
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable()).pipe(C.withServerError, C.withRetryableError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withBadRequestError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", {
    message: S.String,
    serviceCode: S.optional(S.String),
    quotaCode: S.optional(S.String),
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable({ throttling: true })).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", {
    message: S.String,
    reason: ValidationExceptionReason,
    fieldList: S.optional(ValidationExceptionFieldList),
}).pipe(C.withBadRequestError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withConflictError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", {
    message: S.String,
    resourceId: S.String,
    resourceType: S.String,
    serviceCode: S.String,
    quotaCode: S.String,
}).pipe(C.withQuotaError) {
}
/**
 * Gets user access details in a batch request.
 *
 * This action polls data from the tasks that are kicked off by the
 * `StartUserAccessTasks` action.
 */
export const batchGetUserAccessTasks = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchGetUserAccessTasksRequest,
    output: BatchGetUserAccessTasksResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Establishes a connection between Amazon Web Services AppFabric and an application, which allows AppFabric to
 * call the APIs of the application.
 */
export const connectAppAuthorization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ConnectAppAuthorizationRequest,
    output: ConnectAppAuthorizationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates an app authorization within an app bundle, which allows AppFabric to connect to an
 * application.
 */
export const createAppAuthorization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAppAuthorizationRequest,
    output: CreateAppAuthorizationResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates an app bundle to collect data from an application using AppFabric.
 */
export const createAppBundle = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAppBundleRequest,
    output: CreateAppBundleResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a data ingestion for an application.
 */
export const createIngestion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateIngestionRequest,
    output: CreateIngestionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates an ingestion destination, which specifies how an application's ingested data is
 * processed by Amazon Web Services AppFabric and where it's delivered.
 */
export const createIngestionDestination = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateIngestionDestinationRequest,
    output: CreateIngestionDestinationResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an app authorization. You must delete the associated ingestion before you can
 * delete an app authorization.
 */
export const deleteAppAuthorization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAppAuthorizationRequest,
    output: DeleteAppAuthorizationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an app bundle. You must delete all associated app authorizations before you can
 * delete an app bundle.
 */
export const deleteAppBundle = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAppBundleRequest,
    output: DeleteAppBundleResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an ingestion. You must stop (disable) the ingestion and you must delete all
 * associated ingestion destinations before you can delete an app ingestion.
 */
export const deleteIngestion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteIngestionRequest,
    output: DeleteIngestionResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Deletes an ingestion destination.
 *
 * This deletes the association between an ingestion and it's destination. It doesn't
 * delete previously ingested data or the storage destination, such as the Amazon S3
 * bucket where the data is delivered. If the ingestion destination is deleted while the
 * associated ingestion is enabled, the ingestion will fail and is eventually disabled.
 */
export const deleteIngestionDestination = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteIngestionDestinationRequest,
    output: DeleteIngestionDestinationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns information about an app authorization.
 */
export const getAppAuthorization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAppAuthorizationRequest,
    output: GetAppAuthorizationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns information about an app bundle.
 */
export const getAppBundle = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAppBundleRequest,
    output: GetAppBundleResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns information about an ingestion.
 */
export const getIngestion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetIngestionRequest,
    output: GetIngestionResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns information about an ingestion destination.
 */
export const getIngestionDestination = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetIngestionDestinationRequest,
    output: GetIngestionDestinationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Returns a list of all app authorizations configured for an app bundle.
 */
export const listAppAuthorizations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAppAuthorizationsRequest,
    output: ListAppAuthorizationsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "appAuthorizationSummaryList",
        pageSize: "maxResults",
    },
}));
/**
 * Returns a list of app bundles.
 */
export const listAppBundles = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAppBundlesRequest,
    output: ListAppBundlesResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "appBundleSummaryList",
        pageSize: "maxResults",
    },
}));
/**
 * Returns a list of all ingestion destinations configured for an ingestion.
 */
export const listIngestionDestinations = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListIngestionDestinationsRequest,
    output: ListIngestionDestinationsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "ingestionDestinations",
        pageSize: "maxResults",
    },
}));
/**
 * Returns a list of all ingestions configured for an app bundle.
 */
export const listIngestions = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListIngestionsRequest,
    output: ListIngestionsResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "ingestions",
        pageSize: "maxResults",
    },
}));
/**
 * Returns a list of tags for a resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Starts (enables) an ingestion, which collects data from an application.
 */
export const startIngestion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartIngestionRequest,
    output: StartIngestionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Starts the tasks to search user access status for a specific email address.
 *
 * The tasks are stopped when the user access status data is found. The tasks are
 * terminated when the API calls to the application time out.
 */
export const startUserAccessTasks = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartUserAccessTasksRequest,
    output: StartUserAccessTasksResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Stops (disables) an ingestion.
 */
export const stopIngestion = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StopIngestionRequest,
    output: StopIngestionResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Assigns one or more tags (key-value pairs) to the specified resource.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Removes a tag or tags from a resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates an app authorization within an app bundle, which allows AppFabric to connect to an
 * application.
 *
 * If the app authorization was in a `connected` state, updating the app
 * authorization will set it back to a `PendingConnect` state.
 */
export const updateAppAuthorization = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAppAuthorizationRequest,
    output: UpdateAppAuthorizationResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates an ingestion destination, which specifies how an application's ingested data is
 * processed by Amazon Web Services AppFabric and where it's delivered.
 */
export const updateIngestionDestination = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateIngestionDestinationRequest,
    output: UpdateIngestionDestinationResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
//# sourceMappingURL=appfabric.js.map