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: "Service Catalog AppRegistry",
    serviceShapeName: "AWS242AppRegistry",
});
const auth = T.AwsAuthSigv4({ name: "servicecatalog" });
const ver = T.ServiceVersion("2020-06-24");
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://servicecatalog-appregistry-fips.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("FIPS and DualStack are enabled, but this partition does not support one or both");
                }
                if (UseFIPS === true) {
                    if (_.getAttr(PartitionResult, "supportsFIPS") === true) {
                        if (_.getAttr(PartitionResult, "name") === "aws-us-gov") {
                            return e(`https://servicecatalog-appregistry.${Region}.amazonaws.com`);
                        }
                        return e(`https://servicecatalog-appregistry-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://servicecatalog-appregistry.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://servicecatalog-appregistry.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const AssociateAttributeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    attributeGroup: S.String.pipe(T.HttpLabel("attributeGroup")),
}).pipe(T.all(T.Http({
    method: "PUT",
    uri: "/applications/{application}/attribute-groups/{attributeGroup}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "AssociateAttributeGroupRequest",
});
export const AssociateAttributeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationArn: S.optional(S.String),
    attributeGroupArn: S.optional(S.String),
})).annotate({
    identifier: "AssociateAttributeGroupResponse",
});
export const ResourceType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AssociationOption = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const Options = /*@__PURE__*/ /*#__PURE__*/ S.Array(AssociationOption);
export const AssociateResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    resourceType: ResourceType.pipe(T.HttpLabel("resourceType")),
    resource: S.String.pipe(T.HttpLabel("resource")),
    options: S.optional(Options),
}).pipe(T.all(T.Http({
    method: "PUT",
    uri: "/applications/{application}/resources/{resourceType}/{resource}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "AssociateResourceRequest",
});
export const AssociateResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationArn: S.optional(S.String),
    resourceArn: S.optional(S.String),
    options: S.optional(Options),
})).annotate({
    identifier: "AssociateResourceResponse",
});
export const Tags = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const CreateApplicationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    description: S.optional(S.String),
    tags: S.optional(Tags),
    clientToken: S.String.pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/applications" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateApplicationRequest",
});
export const ApplicationTagDefinition = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const Application = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    tags: S.optional(Tags),
    applicationTag: S.optional(ApplicationTagDefinition),
})).annotate({ identifier: "Application" });
export const CreateApplicationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ application: S.optional(Application) })).annotate({
    identifier: "CreateApplicationResponse",
});
export const CreateAttributeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.String,
    description: S.optional(S.String),
    attributes: S.String,
    tags: S.optional(Tags),
    clientToken: S.String.pipe(T.IdempotencyToken()),
}).pipe(T.all(T.Http({ method: "POST", uri: "/attribute-groups" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateAttributeGroupRequest",
});
export const AttributeGroup = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    tags: S.optional(Tags),
})).annotate({ identifier: "AttributeGroup" });
export const CreateAttributeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ attributeGroup: S.optional(AttributeGroup) })).annotate({
    identifier: "CreateAttributeGroupResponse",
});
export const DeleteApplicationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ application: S.String.pipe(T.HttpLabel("application")) }).pipe(T.all(T.Http({ method: "DELETE", uri: "/applications/{application}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteApplicationRequest",
});
export const ApplicationSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
})).annotate({
    identifier: "ApplicationSummary",
});
export const DeleteApplicationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ application: S.optional(ApplicationSummary) })).annotate({
    identifier: "DeleteApplicationResponse",
});
export const DeleteAttributeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroup: S.String.pipe(T.HttpLabel("attributeGroup")),
}).pipe(T.all(T.Http({ method: "DELETE", uri: "/attribute-groups/{attributeGroup}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteAttributeGroupRequest",
});
export const AttributeGroupSummary = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    createdBy: S.optional(S.String),
})).annotate({
    identifier: "AttributeGroupSummary",
});
export const DeleteAttributeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ attributeGroup: S.optional(AttributeGroupSummary) })).annotate({
    identifier: "DeleteAttributeGroupResponse",
});
export const DisassociateAttributeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    attributeGroup: S.String.pipe(T.HttpLabel("attributeGroup")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/applications/{application}/attribute-groups/{attributeGroup}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DisassociateAttributeGroupRequest",
});
export const DisassociateAttributeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationArn: S.optional(S.String),
    attributeGroupArn: S.optional(S.String),
})).annotate({
    identifier: "DisassociateAttributeGroupResponse",
});
export const DisassociateResourceRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    resourceType: ResourceType.pipe(T.HttpLabel("resourceType")),
    resource: S.String.pipe(T.HttpLabel("resource")),
}).pipe(T.all(T.Http({
    method: "DELETE",
    uri: "/applications/{application}/resources/{resourceType}/{resource}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "DisassociateResourceRequest",
});
export const DisassociateResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationArn: S.optional(S.String),
    resourceArn: S.optional(S.String),
})).annotate({
    identifier: "DisassociateResourceResponse",
});
export const GetApplicationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ application: S.String.pipe(T.HttpLabel("application")) }).pipe(T.all(T.Http({ method: "GET", uri: "/applications/{application}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetApplicationRequest",
});
export const ResourceGroupState = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceGroup = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    state: S.optional(ResourceGroupState),
    arn: S.optional(S.String),
    errorMessage: S.optional(S.String),
})).annotate({ identifier: "ResourceGroup" });
export const Integrations = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceGroup: S.optional(ResourceGroup),
    applicationTagResourceGroup: S.optional(ResourceGroup),
})).annotate({ identifier: "Integrations" });
export const GetApplicationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    associatedResourceCount: S.optional(S.Number),
    tags: S.optional(Tags),
    integrations: S.optional(Integrations),
    applicationTag: S.optional(ApplicationTagDefinition),
})).annotate({
    identifier: "GetApplicationResponse",
});
export const ResourceItemStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GetAssociatedResourceFilter = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ResourceItemStatus);
export const GetAssociatedResourceRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    resourceType: ResourceType.pipe(T.HttpLabel("resourceType")),
    resource: S.String.pipe(T.HttpLabel("resource")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    resourceTagStatus: S.optional(GetAssociatedResourceFilter).pipe(T.HttpQuery("resourceTagStatus")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/applications/{application}/resources/{resourceType}/{resource}",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAssociatedResourceRequest",
});
export const ResourceIntegrations = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ resourceGroup: S.optional(ResourceGroup) })).annotate({
    identifier: "ResourceIntegrations",
});
export const Resource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.optional(S.String),
    arn: S.optional(S.String),
    associationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    integrations: S.optional(ResourceIntegrations),
})).annotate({ identifier: "Resource" });
export const ApplicationTagStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourcesListItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceArn: S.optional(S.String),
    errorMessage: S.optional(S.String),
    status: S.optional(S.String),
    resourceType: S.optional(S.String),
})).annotate({
    identifier: "ResourcesListItem",
});
export const ResourcesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ResourcesListItem);
export const ApplicationTagResult = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationTagStatus: S.optional(ApplicationTagStatus),
    errorMessage: S.optional(S.String),
    resources: S.optional(ResourcesList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ApplicationTagResult",
});
export const GetAssociatedResourceResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resource: S.optional(Resource),
    options: S.optional(Options),
    applicationTagResult: S.optional(ApplicationTagResult),
})).annotate({
    identifier: "GetAssociatedResourceResponse",
});
export const GetAttributeGroupRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroup: S.String.pipe(T.HttpLabel("attributeGroup")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/attribute-groups/{attributeGroup}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAttributeGroupRequest",
});
export const GetAttributeGroupResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    description: S.optional(S.String),
    attributes: S.optional(S.String),
    creationTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    lastUpdateTime: S.optional(T.DateFromString.pipe(T.TimestampFormat("date-time"))),
    tags: S.optional(Tags),
    createdBy: S.optional(S.String),
})).annotate({
    identifier: "GetAttributeGroupResponse",
});
export const GetConfigurationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetConfigurationRequest",
});
export const TagQueryConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tagKey: S.optional(S.String) })).annotate({
    identifier: "TagQueryConfiguration",
});
export const AppRegistryConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tagQueryConfiguration: S.optional(TagQueryConfiguration) })).annotate({
    identifier: "AppRegistryConfiguration",
});
export const GetConfigurationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ configuration: S.optional(AppRegistryConfiguration) })).annotate({
    identifier: "GetConfigurationResponse",
});
export const ListApplicationsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/applications" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListApplicationsRequest",
});
export const ApplicationSummaries = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ApplicationSummary);
export const ListApplicationsResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applications: S.optional(ApplicationSummaries),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListApplicationsResponse",
});
export const ListAssociatedAttributeGroupsRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/applications/{application}/attribute-groups",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAssociatedAttributeGroupsRequest",
});
export const AttributeGroupIds = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ListAssociatedAttributeGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroups: S.optional(AttributeGroupIds),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAssociatedAttributeGroupsResponse",
});
export const ListAssociatedResourcesRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/applications/{application}/resources" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAssociatedResourcesRequest",
});
export const ResourceDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ tagValue: S.optional(S.String) })).annotate({
    identifier: "ResourceDetails",
});
export const ResourceInfo = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    name: S.optional(S.String),
    arn: S.optional(S.String),
    resourceType: S.optional(ResourceType),
    resourceDetails: S.optional(ResourceDetails),
    options: S.optional(Options),
})).annotate({ identifier: "ResourceInfo" });
export const Resources = /*@__PURE__*/ /*#__PURE__*/ S.Array(ResourceInfo);
export const ListAssociatedResourcesResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resources: S.optional(Resources),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAssociatedResourcesResponse",
});
export const ListAttributeGroupsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({ method: "GET", uri: "/attribute-groups" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAttributeGroupsRequest",
});
export const AttributeGroupSummaries = /*@__PURE__*/ /*#__PURE__*/ S.Array(AttributeGroupSummary);
export const ListAttributeGroupsResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroups: S.optional(AttributeGroupSummaries),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAttributeGroupsResponse",
});
export const ListAttributeGroupsForApplicationRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    nextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
    maxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
}).pipe(T.all(T.Http({
    method: "GET",
    uri: "/applications/{application}/attribute-group-details",
}), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListAttributeGroupsForApplicationRequest",
});
export const AttributeGroupDetails = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    id: S.optional(S.String),
    arn: S.optional(S.String),
    name: S.optional(S.String),
    createdBy: S.optional(S.String),
})).annotate({
    identifier: "AttributeGroupDetails",
});
export const AttributeGroupDetailsList = /*@__PURE__*/ /*#__PURE__*/ S.Array(AttributeGroupDetails);
export const ListAttributeGroupsForApplicationResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroupsDetails: S.optional(AttributeGroupDetailsList),
    nextToken: S.optional(S.String),
})).annotate({
    identifier: "ListAttributeGroupsForApplicationResponse",
});
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(Tags) })).annotate({
    identifier: "ListTagsForResourceResponse",
});
export const PutConfigurationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ configuration: AppRegistryConfiguration }).pipe(T.all(T.Http({ method: "PUT", uri: "/configuration" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "PutConfigurationRequest",
});
export const PutConfigurationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "PutConfigurationResponse",
});
export const SyncResourceRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    resourceType: ResourceType.pipe(T.HttpLabel("resourceType")),
    resource: S.String.pipe(T.HttpLabel("resource")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/sync/{resourceType}/{resource}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SyncResourceRequest",
});
export const SyncAction = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const SyncResourceResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    applicationArn: S.optional(S.String),
    resourceArn: S.optional(S.String),
    actionTaken: S.optional(SyncAction),
})).annotate({
    identifier: "SyncResourceResponse",
});
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 UpdateApplicationRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    application: S.String.pipe(T.HttpLabel("application")),
    name: S.optional(S.String),
    description: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "PATCH", uri: "/applications/{application}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateApplicationRequest",
});
export const UpdateApplicationResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ application: S.optional(Application) })).annotate({
    identifier: "UpdateApplicationResponse",
});
export const UpdateAttributeGroupRequest = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    attributeGroup: S.String.pipe(T.HttpLabel("attributeGroup")),
    name: S.optional(S.String),
    description: S.optional(S.String),
    attributes: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "PATCH", uri: "/attribute-groups/{attributeGroup}" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateAttributeGroupRequest",
});
export const UpdateAttributeGroupResponse = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ attributeGroup: S.optional(AttributeGroup) })).annotate({
    identifier: "UpdateAttributeGroupResponse",
});
//# Errors
export class ConflictException extends S.TaggedErrorClass()("ConflictException", { message: S.optional(S.String) }).pipe(C.withConflictError) {
}
export class InternalServerException extends S.TaggedErrorClass()("InternalServerException", { message: S.optional(S.String) }).pipe(C.withServerError) {
}
export class ResourceNotFoundException extends S.TaggedErrorClass()("ResourceNotFoundException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ServiceQuotaExceededException extends S.TaggedErrorClass()("ServiceQuotaExceededException", { message: S.optional(S.String) }).pipe(C.withQuotaError) {
}
export class ValidationException extends S.TaggedErrorClass()("ValidationException", { message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ThrottlingException extends S.TaggedErrorClass()("ThrottlingException", { message: S.String, serviceCode: S.optional(S.String) }).pipe(C.withThrottlingError) {
}
/**
 * Associates an attribute group with an application to augment the application's metadata
 * with the group's attributes. This feature enables applications to be described with
 * user-defined details that are machine-readable, such as third-party integrations.
 */
export const associateAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AssociateAttributeGroupRequest,
    output: AssociateAttributeGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Associates a resource with an application.
 * The resource can be specified by its ARN or name.
 * The application can be specified by ARN, ID, or name.
 *
 * **Minimum permissions**
 *
 * You must have the following permissions to associate a resource using the `OPTIONS` parameter set to `APPLY_APPLICATION_TAG`.
 *
 * - `tag:GetResources`
 *
 * - `tag:TagResources`
 *
 * You must also have these additional permissions if you don't use the `AWSServiceCatalogAppRegistryFullAccess` policy.
 * For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.
 *
 * - `resource-groups:AssociateResource`
 *
 * - `cloudformation:UpdateStack`
 *
 * - `cloudformation:DescribeStacks`
 *
 * In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.
 * For more information, see TagResources in the *Resource Groups Tagging API Reference*.
 */
export const associateResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: AssociateResourceRequest,
    output: AssociateResourceResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a new application that is the top-level node in a hierarchy of related cloud resource abstractions.
 */
export const createApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateApplicationRequest,
    output: CreateApplicationResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Creates a new attribute group as a container for user-defined attributes. This feature
 * enables users to have full control over their cloud application's metadata in a rich
 * machine-readable format to facilitate integration with automated workflows and third-party
 * tools.
 */
export const createAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateAttributeGroupRequest,
    output: CreateAttributeGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ServiceQuotaExceededException,
        ValidationException,
    ],
}));
/**
 * Deletes an application that is specified either by its application ID, name, or ARN. All associated attribute groups and resources must be disassociated from it before deleting an application.
 */
export const deleteApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteApplicationRequest,
    output: DeleteApplicationResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Deletes an attribute group, specified either by its attribute group ID, name, or ARN.
 */
export const deleteAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteAttributeGroupRequest,
    output: DeleteAttributeGroupResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Disassociates an attribute group from an application to remove the extra attributes contained in the attribute group from the application's metadata. This operation reverts `AssociateAttributeGroup`.
 */
export const disassociateAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DisassociateAttributeGroupRequest,
    output: DisassociateAttributeGroupResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Disassociates a resource from application.
 * Both the resource and the application can be specified either by ID or name.
 *
 * **Minimum permissions**
 *
 * You must have the following permissions to remove a resource that's been associated with an application using the `APPLY_APPLICATION_TAG` option for AssociateResource.
 *
 * - `tag:GetResources`
 *
 * - `tag:UntagResources`
 *
 * You must also have the following permissions if you don't use the `AWSServiceCatalogAppRegistryFullAccess` policy.
 * For more information, see AWSServiceCatalogAppRegistryFullAccess in the AppRegistry Administrator Guide.
 *
 * - `resource-groups:DisassociateResource`
 *
 * - `cloudformation:UpdateStack`
 *
 * - `cloudformation:DescribeStacks`
 *
 * In addition, you must have the tagging permission defined by the Amazon Web Services service that creates the resource.
 * For more information, see UntagResources in the *Resource Groups Tagging API Reference*.
 */
export const disassociateResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DisassociateResourceRequest,
    output: DisassociateResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Retrieves metadata information
 * about one
 * of your applications.
 * The application can be specified
 * by its ARN, ID, or name
 * (which is unique
 * within one account
 * in one region
 * at a given point
 * in time).
 * Specify
 * by ARN or ID
 * in automated workflows
 * if you want
 * to make sure
 * that the exact same application is returned or a `ResourceNotFoundException` is thrown,
 * avoiding the ABA addressing problem.
 */
export const getApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetApplicationRequest,
    output: GetApplicationResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Gets the resource associated with the application.
 */
export const getAssociatedResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAssociatedResourceRequest,
    output: GetAssociatedResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Retrieves an attribute group
 * by its ARN, ID, or name.
 * The attribute group can be specified
 * by its ARN, ID, or name.
 */
export const getAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAttributeGroupRequest,
    output: GetAttributeGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Retrieves a `TagKey` configuration
 * from an account.
 */
export const getConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetConfigurationRequest,
    output: GetConfigurationResponse,
    errors: [InternalServerException],
}));
/**
 * Retrieves a list of all of your applications. Results are paginated.
 */
export const listApplications = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListApplicationsRequest,
    output: ListApplicationsResponse,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "applications",
        pageSize: "maxResults",
    },
}));
/**
 * Lists all attribute groups that are associated with specified application. Results are paginated.
 */
export const listAssociatedAttributeGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAssociatedAttributeGroupsRequest,
    output: ListAssociatedAttributeGroupsResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "attributeGroups",
        pageSize: "maxResults",
    },
}));
/**
 * Lists all
 * of the resources
 * that are associated
 * with the specified application.
 * Results are paginated.
 *
 * If you share an application,
 * and a consumer account associates a tag query
 * to the application,
 * all of the users
 * who can access the application
 * can also view the tag values
 * in all accounts
 * that are associated
 * with it
 * using this API.
 */
export const listAssociatedResources = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAssociatedResourcesRequest,
    output: ListAssociatedResourcesResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "resources",
        pageSize: "maxResults",
    },
}));
/**
 * Lists all attribute groups which you have access to. Results are paginated.
 */
export const listAttributeGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAttributeGroupsRequest,
    output: ListAttributeGroupsResponse,
    errors: [InternalServerException, ValidationException],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "attributeGroups",
        pageSize: "maxResults",
    },
}));
/**
 * Lists the details of all attribute groups associated with a specific application. The results display in pages.
 */
export const listAttributeGroupsForApplication = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListAttributeGroupsForApplicationRequest,
    output: ListAttributeGroupsForApplicationResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
    pagination: {
        inputToken: "nextToken",
        outputToken: "nextToken",
        items: "attributeGroupsDetails",
        pageSize: "maxResults",
    },
}));
/**
 * Lists all of the tags on the resource.
 */
export const listTagsForResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: ListTagsForResourceRequest,
    output: ListTagsForResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Associates a `TagKey` configuration
 * to an account.
 */
export const putConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutConfigurationRequest,
    output: PutConfigurationResponse,
    errors: [ConflictException, InternalServerException, ValidationException],
}));
/**
 * Syncs the resource with current AppRegistry records.
 *
 * Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.
 */
export const syncResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: SyncResourceRequest,
    output: SyncResourceResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Assigns one or more tags (key-value pairs) to the specified resource.
 *
 * Each tag consists of a key and an optional value. If a tag with the same key is already associated with the resource, this action updates its value.
 *
 * This operation returns an empty response if the call was successful.
 */
export const tagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagResourceRequest,
    output: TagResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Removes tags from a resource.
 *
 * This operation returns an empty response if the call was successful.
 */
export const untagResource = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagResourceRequest,
    output: UntagResourceResponse,
    errors: [
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
/**
 * Updates an existing application with new attributes.
 */
export const updateApplication = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateApplicationRequest,
    output: UpdateApplicationResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ThrottlingException,
        ValidationException,
    ],
}));
/**
 * Updates an existing attribute group with new details.
 */
export const updateAttributeGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAttributeGroupRequest,
    output: UpdateAttributeGroupResponse,
    errors: [
        ConflictException,
        InternalServerException,
        ResourceNotFoundException,
        ValidationException,
    ],
}));
//# sourceMappingURL=service-catalog-appregistry.js.map