import * as HttpClient from "effect/unstable/http/HttpClient";
import * as S from "effect/Schema";
import * as stream from "effect/Stream";
import * as API from "../client/api.js";
import * as T from "../traits.js";
import * as C from "../category.js";
const svc = T.AwsApiService({
    sdkId: "QApps",
    serviceShapeName: "QAppsService",
});
const auth = T.AwsAuthSigv4({ name: "qapps" });
const ver = T.ServiceVersion("2023-11-27");
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://data.qapps-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://data.qapps-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://data.qapps.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://data.qapps.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const AssociateLibraryItemReviewInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.associateItemRating" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "AssociateLibraryItemReviewInput",
});
export const AssociateLibraryItemReviewResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "AssociateLibraryItemReviewResponse",
});
export const AssociateQAppWithUserInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.install" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "AssociateQAppWithUserInput",
});
export const AssociateQAppWithUserResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "AssociateQAppWithUserResponse",
});
export const BatchCreateCategoryInputCategory = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    title: S.String,
    color: S.optional(S.String),
})).annotate({
    identifier: "BatchCreateCategoryInputCategory",
});
export const BatchCreateCategoryInputCategoryList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(BatchCreateCategoryInputCategory);
export const BatchCreateCategoryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    categories: BatchCreateCategoryInputCategoryList,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.createCategories" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchCreateCategoryInput",
});
export const BatchCreateCategoryResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "BatchCreateCategoryResponse",
});
export const DeleteCategoryInputList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const BatchDeleteCategoryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    categories: DeleteCategoryInputList,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.deleteCategories" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchDeleteCategoryInput",
});
export const BatchDeleteCategoryResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "BatchDeleteCategoryResponse",
});
export const CategoryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ id: S.String, title: S.String, color: S.optional(S.String) })).annotate({ identifier: "CategoryInput" });
export const CategoryListInput = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(CategoryInput);
export const BatchUpdateCategoryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    categories: CategoryListInput,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.updateCategories" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "BatchUpdateCategoryInput",
});
export const BatchUpdateCategoryResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "BatchUpdateCategoryResponse",
});
export const CategoryIdList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const CreateLibraryItemInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
    appVersion: S.Number,
    categories: CategoryIdList,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.createItem" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateLibraryItemInput",
});
export const CreateLibraryItemOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    libraryItemId: S.String,
    status: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedBy: S.optional(S.String),
    ratingCount: S.Number,
    isVerified: S.optional(S.Boolean),
})).annotate({
    identifier: "CreateLibraryItemOutput",
});
export const DocumentScope = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const CreatePresignedUrlInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    cardId: S.String,
    appId: S.String,
    fileContentsSha256: S.String,
    fileName: S.String,
    scope: DocumentScope,
    sessionId: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.createPresignedUrl" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreatePresignedUrlInput",
});
export const PresignedUrlFields = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const CreatePresignedUrlOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    fileId: S.String,
    presignedUrl: S.String,
    presignedUrlFields: PresignedUrlFields,
    presignedUrlExpiration: T.DateFromString.pipe(T.TimestampFormat("date-time")),
})).annotate({
    identifier: "CreatePresignedUrlOutput",
});
export const CardType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const TextInputCardInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    id: S.String,
    type: CardType,
    placeholder: S.optional(S.String),
    defaultValue: S.optional(S.String),
})).annotate({
    identifier: "TextInputCardInput",
});
export const CardOutputSource = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AttributeFilters = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.suspend(() => AttributeFilter).annotate({
    identifier: "AttributeFilter",
}));
export const DocumentAttributeStringListValue = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const DocumentAttributeValue = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ stringValue: S.String }),
    S.Struct({ stringListValue: DocumentAttributeStringListValue }),
    S.Struct({ longValue: S.Number }),
    S.Struct({ dateValue: S.Date.pipe(T.TimestampFormat("epoch-seconds")) }),
]);
export const DocumentAttribute = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ name: S.String, value: DocumentAttributeValue })).annotate({
    identifier: "DocumentAttribute",
});
export const AttributeFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    andAllFilters: S.optional(S.suspend(() => AttributeFilters).annotate({
        identifier: "AttributeFilters",
    })),
    orAllFilters: S.optional(S.suspend(() => AttributeFilters).annotate({
        identifier: "AttributeFilters",
    })),
    notFilter: S.optional(S.suspend(() => AttributeFilter).annotate({
        identifier: "AttributeFilter",
    })),
    equalsTo: S.optional(DocumentAttribute),
    containsAll: S.optional(DocumentAttribute),
    containsAny: S.optional(DocumentAttribute),
    greaterThan: S.optional(DocumentAttribute),
    greaterThanOrEquals: S.optional(DocumentAttribute),
    lessThan: S.optional(DocumentAttribute),
    lessThanOrEquals: S.optional(DocumentAttribute),
})).annotate({
    identifier: "AttributeFilter",
});
export const QQueryCardInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    id: S.String,
    type: CardType,
    prompt: S.String,
    outputSource: S.optional(CardOutputSource),
    attributeFilter: S.optional(AttributeFilter),
})).annotate({
    identifier: "QQueryCardInput",
});
export const QPluginCardInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    id: S.String,
    type: CardType,
    prompt: S.String,
    pluginId: S.String,
    actionIdentifier: S.optional(S.String),
})).annotate({
    identifier: "QPluginCardInput",
});
export const FileUploadCardInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    id: S.String,
    type: CardType,
    filename: S.optional(S.String),
    fileId: S.optional(S.String),
    allowOverride: S.optional(S.Boolean),
})).annotate({
    identifier: "FileUploadCardInput",
});
export const FormInputCardMetadata = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ schema: S.Any })).annotate({
    identifier: "FormInputCardMetadata",
});
export const InputCardComputeMode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const FormInputCardInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    id: S.String,
    type: CardType,
    metadata: FormInputCardMetadata,
    computeMode: S.optional(InputCardComputeMode),
})).annotate({
    identifier: "FormInputCardInput",
});
export const CardInput = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ textInput: TextInputCardInput }),
    S.Struct({ qQuery: QQueryCardInput }),
    S.Struct({ qPlugin: QPluginCardInput }),
    S.Struct({ fileUpload: FileUploadCardInput }),
    S.Struct({ formInput: FormInputCardInput }),
]);
export const CardList = /*@__PURE__*/ /*#__PURE__*/ S.Array(CardInput);
export const AppDefinitionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ cards: CardList, initialPrompt: S.optional(S.String) })).annotate({
    identifier: "AppDefinitionInput",
});
export const TagMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const CreateQAppInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    title: S.String,
    description: S.optional(S.String),
    appDefinition: AppDefinitionInput,
    tags: S.optional(TagMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.create" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateQAppInput",
});
export const AppStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AppRequiredCapability = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AppRequiredCapabilities = /*@__PURE__*/ /*#__PURE__*/ S.Array(AppRequiredCapability);
export const CreateQAppOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appId: S.String,
    appArn: S.String,
    title: S.String,
    description: S.optional(S.String),
    initialPrompt: S.optional(S.String),
    appVersion: S.Number,
    status: AppStatus,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedBy: S.String,
    requiredCapabilities: S.optional(AppRequiredCapabilities),
})).annotate({
    identifier: "CreateQAppOutput",
});
export const DeleteLibraryItemInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.deleteItem" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteLibraryItemInput",
});
export const DeleteLibraryItemResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteLibraryItemResponse",
});
export const DeleteQAppInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.delete" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteQAppInput",
});
export const DeleteQAppResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DeleteQAppResponse",
});
export const DescribeQAppPermissionsInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String.pipe(T.HttpQuery("appId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/apps.describeQAppPermissions" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DescribeQAppPermissionsInput",
});
export const Action = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const UserType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const PrincipalOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    userId: S.optional(S.String),
    userType: S.optional(UserType),
    email: S.optional(S.String),
})).annotate({
    identifier: "PrincipalOutput",
});
export const PermissionOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ action: Action, principal: PrincipalOutput })).annotate({
    identifier: "PermissionOutput",
});
export const PermissionsOutputList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PermissionOutput);
export const DescribeQAppPermissionsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.optional(S.String),
    appId: S.optional(S.String),
    permissions: S.optional(PermissionsOutputList),
})).annotate({
    identifier: "DescribeQAppPermissionsOutput",
});
export const DisassociateLibraryItemReviewInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.disassociateItemRating" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DisassociateLibraryItemReviewInput",
});
export const DisassociateLibraryItemReviewResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DisassociateLibraryItemReviewResponse",
});
export const DisassociateQAppFromUserInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.uninstall" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DisassociateQAppFromUserInput",
});
export const DisassociateQAppFromUserResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "DisassociateQAppFromUserResponse",
});
export const ExportQAppSessionDataInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/runtime.exportQAppSessionData" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ExportQAppSessionDataInput",
});
export const ExportQAppSessionDataOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    csvFileLink: S.String,
    expiresAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    sessionArn: S.String,
})).annotate({
    identifier: "ExportQAppSessionDataOutput",
});
export const GetLibraryItemInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String.pipe(T.HttpQuery("libraryItemId")),
    appId: S.optional(S.String).pipe(T.HttpQuery("appId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/catalog.getItem" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetLibraryItemInput",
});
export const Category = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    color: S.optional(S.String),
    appCount: S.optional(S.Number),
})).annotate({ identifier: "Category" });
export const CategoryList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Category);
export const GetLibraryItemOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    libraryItemId: S.String,
    appId: S.String,
    appVersion: S.Number,
    categories: CategoryList,
    status: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedBy: S.optional(S.String),
    ratingCount: S.Number,
    isRatedByUser: S.optional(S.Boolean),
    userCount: S.optional(S.Number),
    isVerified: S.optional(S.Boolean),
})).annotate({
    identifier: "GetLibraryItemOutput",
});
export const GetQAppInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String.pipe(T.HttpQuery("appId")),
    appVersion: S.optional(S.Number).pipe(T.HttpQuery("appVersion")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/apps.get" }), svc, auth, proto, ver, rules))).annotate({ identifier: "GetQAppInput" });
export const DependencyList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const TextInputCard = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    dependencies: DependencyList,
    type: CardType,
    placeholder: S.optional(S.String),
    defaultValue: S.optional(S.String),
})).annotate({ identifier: "TextInputCard" });
export const MemoryReferenceList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const QQueryCard = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    dependencies: DependencyList,
    type: CardType,
    prompt: S.String,
    outputSource: CardOutputSource,
    attributeFilter: S.optional(AttributeFilter),
    memoryReferences: S.optional(MemoryReferenceList),
})).annotate({ identifier: "QQueryCard" });
export const PluginType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const QPluginCard = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    dependencies: DependencyList,
    type: CardType,
    prompt: S.String,
    pluginType: PluginType,
    pluginId: S.String,
    actionIdentifier: S.optional(S.String),
})).annotate({ identifier: "QPluginCard" });
export const FileUploadCard = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    dependencies: DependencyList,
    type: CardType,
    filename: S.optional(S.String),
    fileId: S.optional(S.String),
    allowOverride: S.optional(S.Boolean),
})).annotate({ identifier: "FileUploadCard" });
export const FormInputCard = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.String,
    title: S.String,
    dependencies: DependencyList,
    type: CardType,
    metadata: FormInputCardMetadata,
    computeMode: S.optional(InputCardComputeMode),
})).annotate({ identifier: "FormInputCard" });
export const Card = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ textInput: TextInputCard }),
    S.Struct({ qQuery: QQueryCard }),
    S.Struct({ qPlugin: QPluginCard }),
    S.Struct({ fileUpload: FileUploadCard }),
    S.Struct({ formInput: FormInputCard }),
]);
export const CardModelList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Card);
export const AppDefinition = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appDefinitionVersion: S.String,
    cards: CardModelList,
    canEdit: S.optional(S.Boolean),
})).annotate({ identifier: "AppDefinition" });
export const GetQAppOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appId: S.String,
    appArn: S.String,
    title: S.String,
    description: S.optional(S.String),
    initialPrompt: S.optional(S.String),
    appVersion: S.Number,
    status: AppStatus,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedBy: S.String,
    requiredCapabilities: S.optional(AppRequiredCapabilities),
    appDefinition: AppDefinition,
})).annotate({ identifier: "GetQAppOutput" });
export const GetQAppSessionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String.pipe(T.HttpQuery("sessionId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/runtime.getQAppSession" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetQAppSessionInput",
});
export const ExecutionStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Submission = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    value: S.optional(S.Any),
    submissionId: S.optional(S.String),
    timestamp: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({ identifier: "Submission" });
export const SubmissionList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Submission);
export const CardStatus = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    currentState: ExecutionStatus,
    currentValue: S.String,
    submissions: S.optional(SubmissionList),
})).annotate({ identifier: "CardStatus" });
export const CardStatusMap = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, CardStatus.pipe(S.optional));
export const GetQAppSessionOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    sessionId: S.String,
    sessionArn: S.String,
    sessionName: S.optional(S.String),
    appVersion: S.optional(S.Number),
    latestPublishedAppVersion: S.optional(S.Number),
    status: ExecutionStatus,
    cardStatus: CardStatusMap,
    userIsHost: S.optional(S.Boolean),
})).annotate({
    identifier: "GetQAppSessionOutput",
});
export const GetQAppSessionMetadataInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String.pipe(T.HttpQuery("sessionId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/runtime.getQAppSessionMetadata" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetQAppSessionMetadataInput",
});
export const SessionSharingConfiguration = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    enabled: S.Boolean,
    acceptResponses: S.optional(S.Boolean),
    revealCards: S.optional(S.Boolean),
})).annotate({
    identifier: "SessionSharingConfiguration",
});
export const GetQAppSessionMetadataOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    sessionId: S.String,
    sessionArn: S.String,
    sessionName: S.optional(S.String),
    sharingConfiguration: SessionSharingConfiguration,
    sessionOwner: S.optional(S.Boolean),
})).annotate({
    identifier: "GetQAppSessionMetadataOutput",
});
export const ImportDocumentInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    cardId: S.String,
    appId: S.String,
    fileContentsBase64: S.String,
    fileName: S.String,
    scope: DocumentScope,
    sessionId: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.importDocument" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ImportDocumentInput",
});
export const ImportDocumentOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ fileId: S.optional(S.String) })).annotate({
    identifier: "ImportDocumentOutput",
});
export const ListCategoriesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ instanceId: S.String.pipe(T.HttpHeader("instance-id")) }).pipe(T.all(T.Http({ method: "GET", uri: "/catalog.listCategories" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListCategoriesInput",
});
export const CategoriesList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Category);
export const ListCategoriesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ categories: S.optional(CategoriesList) })).annotate({
    identifier: "ListCategoriesOutput",
});
export const ListLibraryItemsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    limit: S.optional(S.Number).pipe(T.HttpQuery("limit")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    categoryId: S.optional(S.String).pipe(T.HttpQuery("categoryId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/catalog.list" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListLibraryItemsInput",
});
export const LibraryItemMember = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    libraryItemId: S.String,
    appId: S.String,
    appVersion: S.Number,
    categories: CategoryList,
    status: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedBy: S.optional(S.String),
    ratingCount: S.Number,
    isRatedByUser: S.optional(S.Boolean),
    userCount: S.optional(S.Number),
    isVerified: S.optional(S.Boolean),
})).annotate({
    identifier: "LibraryItemMember",
});
export const LibraryItemList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(LibraryItemMember);
export const ListLibraryItemsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    libraryItems: S.optional(LibraryItemList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListLibraryItemsOutput",
});
export const ListQAppsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    limit: S.optional(S.Number).pipe(T.HttpQuery("limit")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/apps.list" }), svc, auth, proto, ver, rules))).annotate({ identifier: "ListQAppsInput" });
export const UserAppItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appId: S.String,
    appArn: S.String,
    title: S.String,
    description: S.optional(S.String),
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    canEdit: S.optional(S.Boolean),
    status: S.optional(S.String),
    isVerified: S.optional(S.Boolean),
})).annotate({ identifier: "UserAppItem" });
export const UserAppsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(UserAppItem);
export const ListQAppsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ apps: UserAppsList, nextToken: S.optional(S.String) })).annotate({
    identifier: "ListQAppsOutput",
});
export const ListQAppSessionDataInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String.pipe(T.HttpQuery("sessionId")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/runtime.listQAppSessionData" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListQAppSessionDataInput",
});
export const User = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ userId: S.optional(S.String) })).annotate({ identifier: "User" });
export const QAppSessionData = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    cardId: S.String,
    value: S.optional(S.Any),
    user: User,
    submissionId: S.optional(S.String),
    timestamp: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "QAppSessionData",
});
export const QAppSessionDataList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(QAppSessionData);
export const ListQAppSessionDataOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    sessionId: S.String,
    sessionArn: S.String,
    sessionData: S.optional(QAppSessionDataList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListQAppSessionDataOutput",
});
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, S.String.pipe(S.optional));
export const ListTagsForResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tags: S.optional(Tags) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const Sender = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ConversationMessage = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ body: S.String, type: Sender })).annotate({
    identifier: "ConversationMessage",
});
export const MessageList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ConversationMessage);
export const PredictQAppInputOptions = /*@__PURE__*/ /*#__PURE__*/ S.Union([
    S.Struct({ conversation: MessageList }),
    S.Struct({ problemStatement: S.String }),
]);
export const PredictQAppInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    options: S.optional(PredictQAppInputOptions),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.predictQApp" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "PredictQAppInput",
});
export const PredictAppDefinition = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    title: S.String,
    description: S.optional(S.String),
    appDefinition: AppDefinitionInput,
})).annotate({
    identifier: "PredictAppDefinition",
});
export const PredictQAppOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ app: PredictAppDefinition, problemStatement: S.String })).annotate({
    identifier: "PredictQAppOutput",
});
export const SubmissionMutationKind = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SubmissionMutation = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ submissionId: S.String, mutationType: SubmissionMutationKind })).annotate({
    identifier: "SubmissionMutation",
});
export const CardValue = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    cardId: S.String,
    value: S.String,
    submissionMutation: S.optional(SubmissionMutation),
})).annotate({ identifier: "CardValue" });
export const CardValueList = /*@__PURE__*/ /*#__PURE__*/ S.Array(CardValue);
export const StartQAppSessionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
    appVersion: S.Number,
    initialValues: S.optional(CardValueList),
    sessionId: S.optional(S.String),
    tags: S.optional(TagMap),
}).pipe(T.all(T.Http({ method: "POST", uri: "/runtime.startQAppSession" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartQAppSessionInput",
});
export const StartQAppSessionOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ sessionId: S.String, sessionArn: S.String })).annotate({
    identifier: "StartQAppSessionOutput",
});
export const StopQAppSessionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/runtime.deleteMiniAppRun" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StopQAppSessionInput",
});
export const StopQAppSessionResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "StopQAppSessionResponse",
});
export const TagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceARN: S.String.pipe(T.HttpLabel("resourceARN")),
    tags: Tags,
}).pipe(T.all(T.Http({ method: "POST", uri: "/tags/{resourceARN}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "TagResourceRequest",
});
export const TagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "TagResourceResponse",
});
export const TagKeys = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceARN: S.String.pipe(T.HttpLabel("resourceARN")),
    tagKeys: TagKeys.pipe(T.HttpQuery("tagKeys")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/tags/{resourceARN}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UntagResourceRequest",
});
export const UntagResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UntagResourceResponse",
});
export const LibraryItemStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const UpdateLibraryItemInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String,
    status: S.optional(LibraryItemStatus),
    categories: S.optional(CategoryIdList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.updateItem" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateLibraryItemInput",
});
export const UpdateLibraryItemOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    libraryItemId: S.String,
    appId: S.String,
    appVersion: S.Number,
    categories: CategoryList,
    status: S.String,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    updatedBy: S.optional(S.String),
    ratingCount: S.Number,
    isRatedByUser: S.optional(S.Boolean),
    userCount: S.optional(S.Number),
    isVerified: S.optional(S.Boolean),
})).annotate({
    identifier: "UpdateLibraryItemOutput",
});
export const UpdateLibraryItemMetadataInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    libraryItemId: S.String,
    isVerified: S.optional(S.Boolean),
}).pipe(T.all(T.Http({ method: "POST", uri: "/catalog.updateItemMetadata" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateLibraryItemMetadataInput",
});
export const UpdateLibraryItemMetadataResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "UpdateLibraryItemMetadataResponse",
});
export const UpdateQAppInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
    title: S.optional(S.String),
    description: S.optional(S.String),
    appDefinition: S.optional(AppDefinitionInput),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.update" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateQAppInput",
});
export const UpdateQAppOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    appId: S.String,
    appArn: S.String,
    title: S.String,
    description: S.optional(S.String),
    initialPrompt: S.optional(S.String),
    appVersion: S.Number,
    status: AppStatus,
    createdAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    createdBy: S.String,
    updatedAt: T.DateFromString.pipe(T.TimestampFormat("date-time")),
    updatedBy: S.String,
    requiredCapabilities: S.optional(AppRequiredCapabilities),
})).annotate({
    identifier: "UpdateQAppOutput",
});
export const PermissionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ action: Action, principal: S.String })).annotate({
    identifier: "PermissionInput",
});
export const PermissionsInputList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PermissionInput);
export const UpdateQAppPermissionsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    appId: S.String,
    grantPermissions: S.optional(PermissionsInputList),
    revokePermissions: S.optional(PermissionsInputList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/apps.updateQAppPermissions" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateQAppPermissionsInput",
});
export const UpdateQAppPermissionsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.optional(S.String),
    appId: S.optional(S.String),
    permissions: S.optional(PermissionsOutputList),
})).annotate({
    identifier: "UpdateQAppPermissionsOutput",
});
export const UpdateQAppSessionInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String,
    values: S.optional(CardValueList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/runtime.updateQAppSession" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateQAppSessionInput",
});
export const UpdateQAppSessionOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ sessionId: S.String, sessionArn: S.String })).annotate({
    identifier: "UpdateQAppSessionOutput",
});
export const UpdateQAppSessionMetadataInput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    instanceId: S.String.pipe(T.HttpHeader("instance-id")),
    sessionId: S.String,
    sessionName: S.optional(S.String),
    sharingConfiguration: SessionSharingConfiguration,
}).pipe(T.all(T.Http({ method: "POST", uri: "/runtime.updateQAppSessionMetadata" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateQAppSessionMetadataInput",
});
export const UpdateQAppSessionMetadataOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    sessionId: S.String,
    sessionArn: S.String,
    sessionName: S.optional(S.String),
    sharingConfiguration: SessionSharingConfiguration,
})).annotate({
    identifier: "UpdateQAppSessionMetadataOutput",
});
//# Errors
export class AccessDeniedException extends S.TaggedErrorClass()("AccessDeniedException", { message: S.String }).pipe(C.withAuthError) {
}
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withConflictError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", {
    message: S.String,
    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 ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", {
    message: S.String,
    resourceId: S.String,
    resourceType: S.String,
    serviceCode: S.String,
    quotaCode: S.String,
}).pipe(C.withQuotaError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", {
    message: S.String,
    serviceCode: S.String,
    quotaCode: S.String,
    retryAfterSeconds: S.optional(S.Number).pipe(T.HttpHeader("Retry-After")),
}, T.Retryable({ throttling: true })).pipe(C.withThrottlingError, C.withRetryableError) {
}
export class UnauthorizedException extends S.TaggedErrorClass()("UnauthorizedException", { message: S.String }).pipe(C.withAuthError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { message: S.String }).pipe(C.withBadRequestError) {
}
export class ContentTooLargeException extends S.TaggedErrorClass()("ContentTooLargeException", { message: S.String, resourceId: S.String, resourceType: S.String }).pipe(C.withBadRequestError) {
}
/**
 * Associates a rating or review for a library item with the user submitting the request. This increments the rating count for the specified library item.
 */
export const associateLibraryItemReview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AssociateLibraryItemReviewInput,
    output: AssociateLibraryItemReviewResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * This operation creates a link between the user's identity calling the operation and a specific Q App. This is useful to mark the Q App as a *favorite* for the user if the user doesn't own the Amazon Q App so they can still run it and see it in their inventory of Q Apps.
 */
export const associateQAppWithUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AssociateQAppWithUserInput,
    output: AssociateQAppWithUserResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Creates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
 */
export const batchCreateCategory = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchCreateCategoryInput,
    output: BatchCreateCategoryResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Deletes Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
 */
export const batchDeleteCategory = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchDeleteCategoryInput,
    output: BatchDeleteCategoryResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates Categories for the Amazon Q Business application environment instance. Web experience users use Categories to tag and filter library items. For more information, see Custom labels for Amazon Q Apps.
 */
export const batchUpdateCategory = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: BatchUpdateCategoryInput,
    output: BatchUpdateCategoryResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Creates a new library item for an Amazon Q App, allowing it to be discovered and used by other allowed users.
 */
export const createLibraryItem = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateLibraryItemInput,
    output: CreateLibraryItemOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Creates a presigned URL for an S3 POST operation to upload a file. You can use this URL to set a default file for a `FileUploadCard` in a Q App definition or to provide a file for a single Q App run. The `scope` parameter determines how the file will be used, either at the app definition level or the app session level.
 *
 * The IAM permissions are derived from the `qapps:ImportDocument` action. For more information on the IAM policy for Amazon Q Apps, see IAM permissions for using Amazon Q Apps.
 */
export const createPresignedUrl = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreatePresignedUrlInput,
    output: CreatePresignedUrlOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Creates a new Amazon Q App based on the provided definition. The Q App definition specifies the cards and flow of the Q App. This operation also calculates the dependencies between the cards by inspecting the references in the prompts.
 */
export const createQApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateQAppInput,
    output: CreateQAppOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        ContentTooLargeException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Deletes a library item for an Amazon Q App, removing it from the library so it can no longer be discovered or used by other users.
 */
export const deleteLibraryItem = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteLibraryItemInput,
    output: DeleteLibraryItemResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Deletes an Amazon Q App owned by the user. If the Q App was previously published to the library, it is also removed from the library.
 */
export const deleteQApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteQAppInput,
    output: DeleteQAppResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Describes read permissions for a Amazon Q App in Amazon Q Business application environment instance.
 */
export const describeQAppPermissions = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DescribeQAppPermissionsInput,
    output: DescribeQAppPermissionsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Removes a rating or review previously submitted by the user for a library item.
 */
export const disassociateLibraryItemReview = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DisassociateLibraryItemReviewInput,
    output: DisassociateLibraryItemReviewResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Disassociates a Q App from a user removing the user's access to run the Q App.
 */
export const disassociateQAppFromUser = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DisassociateQAppFromUserInput,
    output: DisassociateQAppFromUserResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Exports the collected data of a Q App data collection session.
 */
export const exportQAppSessionData = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ExportQAppSessionDataInput,
    output: ExportQAppSessionDataOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Retrieves details about a library item for an Amazon Q App, including its metadata, categories, ratings, and usage statistics.
 */
export const getLibraryItem = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetLibraryItemInput,
    output: GetLibraryItemOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Retrieves the full details of an Q App, including its definition specifying the cards and flow.
 */
export const getQApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetQAppInput,
    output: GetQAppOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Retrieves the current state and results for an active session of an Amazon Q App.
 */
export const getQAppSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetQAppSessionInput,
    output: GetQAppSessionOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Retrieves the current configuration of a Q App session.
 */
export const getQAppSessionMetadata = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetQAppSessionMetadataInput,
    output: GetQAppSessionMetadataOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Uploads a file that can then be used either as a default in a `FileUploadCard` from Q App definition or as a file that is used inside a single Q App run. The purpose of the document is determined by a scope parameter that indicates whether it is at the app definition level or at the app session level.
 */
export const importDocument = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ImportDocumentInput,
    output: ImportDocumentOutput,
    errors: [
        AccessDeniedException,
        ContentTooLargeException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Lists the categories of a Amazon Q Business application environment instance. For more information, see Custom labels for Amazon Q Apps.
 */
export const listCategories = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListCategoriesInput,
    output: ListCategoriesOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Lists the library items for Amazon Q Apps that are published and available for users in your Amazon Web Services account.
 */
export const listLibraryItems = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListLibraryItemsInput,
    output: ListLibraryItemsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "libraryItems",
        pageSize: "limit",
    },
}));
/**
 * Lists the Amazon Q Apps owned by or associated with the user either because they created it or because they used it from the library in the past. The user identity is extracted from the credentials used to invoke this operation..
 */
export const listQApps = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListQAppsInput,
    output: ListQAppsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "apps",
        pageSize: "limit",
    },
}));
/**
 * Lists the collected data of a Q App data collection session.
 */
export const listQAppSessionData = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListQAppSessionDataInput,
    output: ListQAppSessionDataOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Lists the tags associated with an Amazon Q Apps resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Generates an Amazon Q App definition based on either a conversation or a problem statement provided as input.The resulting app definition can be used to call `CreateQApp`. This API doesn't create Amazon Q Apps directly.
 */
export const predictQApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PredictQAppInput,
    output: PredictQAppOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Starts a new session for an Amazon Q App, allowing inputs to be provided and the app to be run.
 *
 * Each Q App session will be condensed into a single conversation in the web experience.
 */
export const startQAppSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartQAppSessionInput,
    output: StartQAppSessionOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Stops an active session for an Amazon Q App.This deletes all data related to the session and makes it invalid for future uses. The results of the session will be persisted as part of the conversation.
 */
export const stopQAppSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StopQAppSessionInput,
    output: StopQAppSessionResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Associates tags with an Amazon Q Apps resource.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Disassociates tags from an Amazon Q Apps resource.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates the library item for an Amazon Q App.
 */
export const updateLibraryItem = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateLibraryItemInput,
    output: UpdateLibraryItemOutput,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates the verification status of a library item for an Amazon Q App.
 */
export const updateLibraryItemMetadata = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateLibraryItemMetadataInput,
    output: UpdateLibraryItemMetadataResponse,
    errors: [
        AccessDeniedException,
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates an existing Amazon Q App, allowing modifications to its title, description, and definition.
 */
export const updateQApp = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateQAppInput,
    output: UpdateQAppOutput,
    errors: [
        AccessDeniedException,
        ContentTooLargeException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates read permissions for a Amazon Q App in Amazon Q Business application environment instance.
 */
export const updateQAppPermissions = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateQAppPermissionsInput,
    output: UpdateQAppPermissionsOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates the session for a given Q App `sessionId`. This is only valid when at least one card of the session is in the `WAITING` state. Data for each `WAITING` card can be provided as input. If inputs are not provided, the call will be accepted but session will not move forward. Inputs for cards that are not in the `WAITING` status will be ignored.
 */
export const updateQAppSession = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateQAppSessionInput,
    output: UpdateQAppSessionOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
/**
 * Updates the configuration metadata of a session for a given Q App `sessionId`.
 */
export const updateQAppSessionMetadata = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateQAppSessionMetadataInput,
    output: UpdateQAppSessionMetadataOutput,
    errors: [
        AccessDeniedException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        UnauthorizedException,
        ValidationException,
    ],
}));
//# sourceMappingURL=qapps.js.map