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: "Resource Groups",
    serviceShapeName: "Ardi",
});
const auth = T.AwsAuthSigv4({ name: "resource-groups" });
const ver = T.ServiceVersion("2017-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://resource-groups-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://resource-groups.${Region}.amazonaws.com`);
                        }
                        return e(`https://resource-groups-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://resource-groups.${Region}.${_.getAttr(PartitionResult, "dualStackDnsSuffix")}`);
                    }
                    return err("DualStack is enabled but this partition does not support DualStack");
                }
                return e(`https://resource-groups.${Region}.${_.getAttr(PartitionResult, "dnsSuffix")}`);
            }
        }
    }
    return err("Invalid Configuration: Missing Region");
});
export const CancelTagSyncTaskInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ TaskArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/cancel-tag-sync-task" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CancelTagSyncTaskInput",
});
export const CancelTagSyncTaskResponse = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "CancelTagSyncTaskResponse",
});
export const QueryType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceQuery = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Type: QueryType, Query: S.String })).annotate({ identifier: "ResourceQuery" });
export const Tags = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const GroupConfigurationParameterValueList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const GroupConfigurationParameter = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: S.String,
    Values: S.optional(GroupConfigurationParameterValueList),
})).annotate({
    identifier: "GroupConfigurationParameter",
});
export const GroupParameterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(GroupConfigurationParameter);
export const GroupConfigurationItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Type: S.String, Parameters: S.optional(GroupParameterList) })).annotate({
    identifier: "GroupConfigurationItem",
});
export const GroupConfigurationList = /*@__PURE__*/ /*#__PURE__*/ S.Array(GroupConfigurationItem);
export const CreateGroupInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: S.String,
    Description: S.optional(S.String),
    ResourceQuery: S.optional(ResourceQuery),
    Tags: S.optional(Tags),
    Configuration: S.optional(GroupConfigurationList),
    Criticality: S.optional(S.Number),
    Owner: S.optional(S.String),
    DisplayName: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/groups" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "CreateGroupInput",
});
export const ApplicationTag = /*@__PURE__*/ /*#__PURE__*/ S.Record(S.String, S.String.pipe(S.optional));
export const Group = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupArn: S.String,
    Name: S.String,
    Description: S.optional(S.String),
    Criticality: S.optional(S.Number),
    Owner: S.optional(S.String),
    DisplayName: S.optional(S.String),
    ApplicationTag: S.optional(ApplicationTag),
})).annotate({ identifier: "Group" });
export const GroupConfigurationStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GroupConfiguration = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Configuration: S.optional(GroupConfigurationList),
    ProposedConfiguration: S.optional(GroupConfigurationList),
    Status: S.optional(GroupConfigurationStatus),
    FailureReason: S.optional(S.String),
})).annotate({
    identifier: "GroupConfiguration",
});
export const CreateGroupOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Group: S.optional(Group),
    ResourceQuery: S.optional(ResourceQuery),
    Tags: S.optional(Tags),
    GroupConfiguration: S.optional(GroupConfiguration),
})).annotate({
    identifier: "CreateGroupOutput",
});
export const DeleteGroupInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/delete-group" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "DeleteGroupInput",
});
export const DeleteGroupOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.optional(Group) })).annotate({
    identifier: "DeleteGroupOutput",
});
export const GetAccountSettingsRequest = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.all(T.Http({ method: "POST", uri: "/" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetAccountSettingsRequest",
});
export const GroupLifecycleEventsDesiredStatus = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const GroupLifecycleEventsStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const AccountSettings = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupLifecycleEventsDesiredStatus: S.optional(GroupLifecycleEventsDesiredStatus),
    GroupLifecycleEventsStatus: S.optional(GroupLifecycleEventsStatus),
    GroupLifecycleEventsStatusMessage: S.optional(S.String),
})).annotate({
    identifier: "AccountSettings",
});
export const GetAccountSettingsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ AccountSettings: S.optional(AccountSettings) })).annotate({
    identifier: "GetAccountSettingsOutput",
});
export const GetGroupInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/get-group" }), svc, auth, proto, ver, rules))).annotate({ identifier: "GetGroupInput" });
export const GetGroupOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.optional(Group) })).annotate({ identifier: "GetGroupOutput" });
export const GetGroupConfigurationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.optional(S.String) }).pipe(T.all(T.Http({ method: "POST", uri: "/get-group-configuration" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetGroupConfigurationInput",
});
export const GetGroupConfigurationOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupConfiguration: S.optional(GroupConfiguration) })).annotate({
    identifier: "GetGroupConfigurationOutput",
});
export const GetGroupQueryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/get-group-query" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetGroupQueryInput",
});
export const GroupQuery = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupName: S.String, ResourceQuery: ResourceQuery })).annotate({ identifier: "GroupQuery" });
export const GetGroupQueryOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupQuery: S.optional(GroupQuery) })).annotate({
    identifier: "GetGroupQueryOutput",
});
export const GetTagsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.String.pipe(T.HttpLabel("Arn")) }).pipe(T.all(T.Http({ method: "GET", uri: "/resources/{Arn}/tags" }), svc, auth, proto, ver, rules))).annotate({ identifier: "GetTagsInput" });
export const GetTagsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.optional(S.String), Tags: S.optional(Tags) })).annotate({ identifier: "GetTagsOutput" });
export const GetTagSyncTaskInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ TaskArn: S.String }).pipe(T.all(T.Http({ method: "POST", uri: "/get-tag-sync-task" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GetTagSyncTaskInput",
});
export const TagSyncTaskStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GetTagSyncTaskOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupArn: S.optional(S.String),
    GroupName: S.optional(S.String),
    TaskArn: S.optional(S.String),
    TagKey: S.optional(S.String),
    TagValue: S.optional(S.String),
    ResourceQuery: S.optional(ResourceQuery),
    RoleArn: S.optional(S.String),
    Status: S.optional(TagSyncTaskStatus),
    ErrorMessage: S.optional(S.String),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "GetTagSyncTaskOutput",
});
export const ResourceArnList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const GroupResourcesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.String, ResourceArns: ResourceArnList }).pipe(T.all(T.Http({ method: "POST", uri: "/group-resources" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "GroupResourcesInput",
});
export const FailedResource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.optional(S.String),
    ErrorMessage: S.optional(S.String),
    ErrorCode: S.optional(S.String),
})).annotate({ identifier: "FailedResource" });
export const FailedResourceList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(FailedResource);
export const PendingResource = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ ResourceArn: S.optional(S.String) })).annotate({
    identifier: "PendingResource",
});
export const PendingResourceList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(PendingResource);
export const GroupResourcesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Succeeded: S.optional(ResourceArnList),
    Failed: S.optional(FailedResourceList),
    Pending: S.optional(PendingResourceList),
})).annotate({
    identifier: "GroupResourcesOutput",
});
export const ListGroupingStatusesFilterName = 
/*@__PURE__*/ /*#__PURE__*/ S.String;
export const ListGroupingStatusesFilterValues = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ListGroupingStatusesFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Name: ListGroupingStatusesFilterName,
    Values: ListGroupingStatusesFilterValues,
})).annotate({
    identifier: "ListGroupingStatusesFilter",
});
export const ListGroupingStatusesFilterList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ListGroupingStatusesFilter);
export const ListGroupingStatusesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Group: S.String,
    MaxResults: S.optional(S.Number),
    Filters: S.optional(ListGroupingStatusesFilterList),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-grouping-statuses" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupingStatusesInput",
});
export const GroupingType = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GroupingStatus = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GroupingStatusesItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.optional(S.String),
    Action: S.optional(GroupingType),
    Status: S.optional(GroupingStatus),
    ErrorMessage: S.optional(S.String),
    ErrorCode: S.optional(S.String),
    UpdatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "GroupingStatusesItem",
});
export const GroupingStatusesList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GroupingStatusesItem);
export const ListGroupingStatusesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Group: S.optional(S.String),
    GroupingStatuses: S.optional(GroupingStatusesList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListGroupingStatusesOutput",
});
export const ResourceFilterName = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceFilterValues = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const ResourceFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: ResourceFilterName, Values: ResourceFilterValues })).annotate({ identifier: "ResourceFilter" });
export const ResourceFilterList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ResourceFilter);
export const ListGroupResourcesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
    Filters: S.optional(ResourceFilterList),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-group-resources" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupResourcesInput",
});
export const ResourceIdentifier = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceArn: S.optional(S.String),
    ResourceType: S.optional(S.String),
})).annotate({
    identifier: "ResourceIdentifier",
});
export const ResourceStatusValue = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const ResourceStatus = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: S.optional(ResourceStatusValue) })).annotate({ identifier: "ResourceStatus" });
export const ListGroupResourcesItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Identifier: S.optional(ResourceIdentifier),
    Status: S.optional(ResourceStatus),
})).annotate({
    identifier: "ListGroupResourcesItem",
});
export const ListGroupResourcesItemList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ListGroupResourcesItem);
export const ResourceIdentifierList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(ResourceIdentifier);
export const QueryErrorCode = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const QueryError = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ErrorCode: S.optional(QueryErrorCode),
    Message: S.optional(S.String),
})).annotate({ identifier: "QueryError" });
export const QueryErrorList = /*@__PURE__*/ /*#__PURE__*/ S.Array(QueryError);
export const ListGroupResourcesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Resources: S.optional(ListGroupResourcesItemList),
    ResourceIdentifiers: S.optional(ResourceIdentifierList),
    NextToken: S.optional(S.String),
    QueryErrors: S.optional(QueryErrorList),
})).annotate({
    identifier: "ListGroupResourcesOutput",
});
export const GroupFilterName = /*@__PURE__*/ /*#__PURE__*/ S.String;
export const GroupFilterValues = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const GroupFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Name: GroupFilterName, Values: GroupFilterValues })).annotate({ identifier: "GroupFilter" });
export const GroupFilterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(GroupFilter);
export const ListGroupsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Filters: S.optional(GroupFilterList),
    MaxResults: S.optional(S.Number).pipe(T.HttpQuery("maxResults")),
    NextToken: S.optional(S.String).pipe(T.HttpQuery("nextToken")),
}).pipe(T.all(T.Http({ method: "POST", uri: "/groups-list" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListGroupsInput",
});
export const GroupIdentifier = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    GroupArn: S.optional(S.String),
    Description: S.optional(S.String),
    Criticality: S.optional(S.Number),
    Owner: S.optional(S.String),
    DisplayName: S.optional(S.String),
})).annotate({
    identifier: "GroupIdentifier",
});
export const GroupIdentifierList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(GroupIdentifier);
export const GroupList = /*@__PURE__*/ /*#__PURE__*/ S.Array(Group);
export const ListGroupsOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupIdentifiers: S.optional(GroupIdentifierList),
    Groups: S.optional(GroupList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListGroupsOutput",
});
export const ListTagSyncTasksFilter = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupArn: S.optional(S.String),
    GroupName: S.optional(S.String),
})).annotate({
    identifier: "ListTagSyncTasksFilter",
});
export const ListTagSyncTasksFilterList = /*@__PURE__*/ /*#__PURE__*/ S.Array(ListTagSyncTasksFilter);
export const ListTagSyncTasksInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Filters: S.optional(ListTagSyncTasksFilterList),
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/list-tag-sync-tasks" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "ListTagSyncTasksInput",
});
export const TagSyncTaskItem = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupArn: S.optional(S.String),
    GroupName: S.optional(S.String),
    TaskArn: S.optional(S.String),
    TagKey: S.optional(S.String),
    TagValue: S.optional(S.String),
    ResourceQuery: S.optional(ResourceQuery),
    RoleArn: S.optional(S.String),
    Status: S.optional(TagSyncTaskStatus),
    ErrorMessage: S.optional(S.String),
    CreatedAt: S.optional(S.Date.pipe(T.TimestampFormat("epoch-seconds"))),
})).annotate({
    identifier: "TagSyncTaskItem",
});
export const TagSyncTaskList = 
/*@__PURE__*/ /*#__PURE__*/ S.Array(TagSyncTaskItem);
export const ListTagSyncTasksOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    TagSyncTasks: S.optional(TagSyncTaskList),
    NextToken: S.optional(S.String),
})).annotate({
    identifier: "ListTagSyncTasksOutput",
});
export const PutGroupConfigurationInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Group: S.optional(S.String),
    Configuration: S.optional(GroupConfigurationList),
}).pipe(T.all(T.Http({ method: "POST", uri: "/put-group-configuration" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "PutGroupConfigurationInput",
});
export const PutGroupConfigurationOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({})).annotate({
    identifier: "PutGroupConfigurationOutput",
});
export const SearchResourcesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceQuery: ResourceQuery,
    MaxResults: S.optional(S.Number),
    NextToken: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/resources/search" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "SearchResourcesInput",
});
export const SearchResourcesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    ResourceIdentifiers: S.optional(ResourceIdentifierList),
    NextToken: S.optional(S.String),
    QueryErrors: S.optional(QueryErrorList),
})).annotate({
    identifier: "SearchResourcesOutput",
});
export const StartTagSyncTaskInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Group: S.String,
    TagKey: S.optional(S.String),
    TagValue: S.optional(S.String),
    ResourceQuery: S.optional(ResourceQuery),
    RoleArn: S.String,
}).pipe(T.all(T.Http({ method: "POST", uri: "/start-tag-sync-task" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "StartTagSyncTaskInput",
});
export const StartTagSyncTaskOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupArn: S.optional(S.String),
    GroupName: S.optional(S.String),
    TaskArn: S.optional(S.String),
    TagKey: S.optional(S.String),
    TagValue: S.optional(S.String),
    ResourceQuery: S.optional(ResourceQuery),
    RoleArn: S.optional(S.String),
})).annotate({
    identifier: "StartTagSyncTaskOutput",
});
export const TagInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.String.pipe(T.HttpLabel("Arn")), Tags: Tags }).pipe(T.all(T.Http({ method: "PUT", uri: "/resources/{Arn}/tags" }), svc, auth, proto, ver, rules))).annotate({ identifier: "TagInput" });
export const TagOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.optional(S.String), Tags: S.optional(Tags) })).annotate({ identifier: "TagOutput" });
export const UngroupResourcesInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.String, ResourceArns: ResourceArnList }).pipe(T.all(T.Http({ method: "POST", uri: "/ungroup-resources" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UngroupResourcesInput",
});
export const UngroupResourcesOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    Succeeded: S.optional(ResourceArnList),
    Failed: S.optional(FailedResourceList),
    Pending: S.optional(PendingResourceList),
})).annotate({
    identifier: "UngroupResourcesOutput",
});
export const TagKeyList = /*@__PURE__*/ /*#__PURE__*/ S.Array(S.String);
export const UntagInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.String.pipe(T.HttpLabel("Arn")), Keys: TagKeyList }).pipe(T.all(T.Http({ method: "PATCH", uri: "/resources/{Arn}/tags" }), svc, auth, proto, ver, rules))).annotate({ identifier: "UntagInput" });
export const UntagOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Arn: S.optional(S.String), Keys: S.optional(TagKeyList) })).annotate({ identifier: "UntagOutput" });
export const UpdateAccountSettingsInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupLifecycleEventsDesiredStatus: S.optional(GroupLifecycleEventsDesiredStatus),
}).pipe(T.all(T.Http({ method: "POST", uri: "/update-account-settings" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateAccountSettingsInput",
});
export const UpdateAccountSettingsOutput = 
/*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ AccountSettings: S.optional(AccountSettings) })).annotate({
    identifier: "UpdateAccountSettingsOutput",
});
export const UpdateGroupInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
    Description: S.optional(S.String),
    Criticality: S.optional(S.Number),
    Owner: S.optional(S.String),
    DisplayName: S.optional(S.String),
}).pipe(T.all(T.Http({ method: "POST", uri: "/update-group" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateGroupInput",
});
export const UpdateGroupOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ Group: S.optional(Group) })).annotate({
    identifier: "UpdateGroupOutput",
});
export const UpdateGroupQueryInput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({
    GroupName: S.optional(S.String),
    Group: S.optional(S.String),
    ResourceQuery: ResourceQuery,
}).pipe(T.all(T.Http({ method: "POST", uri: "/update-group-query" }), svc, auth, proto, ver, rules))).annotate({
    identifier: "UpdateGroupQueryInput",
});
export const UpdateGroupQueryOutput = /*@__PURE__*/ /*#__PURE__*/ S.suspend(() => S.Struct({ GroupQuery: S.optional(GroupQuery) })).annotate({
    identifier: "UpdateGroupQueryOutput",
});
//# Errors
export class BadRequestException extends S.TaggedErrorClass()("BadRequestException", { Message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class ForbiddenException extends S.TaggedErrorClass()("ForbiddenException", { Message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class InternalServerErrorException extends S.TaggedErrorClass()("InternalServerErrorException", { Message: S.optional(S.String) }).pipe(C.withServerError) {
}
export class MethodNotAllowedException extends S.TaggedErrorClass()("MethodNotAllowedException", { Message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
export class TooManyRequestsException extends S.TaggedErrorClass()("TooManyRequestsException", { Message: S.optional(S.String) }).pipe(C.withThrottlingError) {
}
export class UnauthorizedException extends S.TaggedErrorClass()("UnauthorizedException", { Message: S.optional(S.String) }).pipe(C.withAuthError) {
}
export class NotFoundException extends S.TaggedErrorClass()("NotFoundException", { Message: S.optional(S.String) }).pipe(C.withBadRequestError) {
}
/**
 * Cancels the specified tag-sync task.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:CancelTagSyncTask` on the application group
 *
 * - `resource-groups:DeleteGroup`
 */
export const cancelTagSyncTask = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CancelTagSyncTaskInput,
    output: CancelTagSyncTaskResponse,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
}));
/**
 * Creates a resource group with the specified name and description. You can optionally
 * include either a resource query or a service configuration. For more information about
 * constructing a resource query, see Build queries and groups in
 * Resource Groups in the *Resource Groups User Guide*. For more information
 * about service-linked groups and service configurations, see Service configurations for Resource Groups.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:CreateGroup`
 */
export const createGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: CreateGroupInput,
    output: CreateGroupOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
    ],
}));
/**
 * Deletes the specified resource group. Deleting a resource group does not delete any
 * resources that are members of the group; it only deletes the group structure.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:DeleteGroup`
 */
export const deleteGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: DeleteGroupInput,
    output: DeleteGroupOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Retrieves the current status of optional features in Resource Groups.
 */
export const getAccountSettings = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetAccountSettingsRequest,
    output: GetAccountSettingsOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns information about a specified resource group.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GetGroup`
 */
export const getGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGroupInput,
    output: GetGroupOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Retrieves the service configuration associated with the specified resource group. For
 * details about the service configuration syntax, see Service configurations for Resource Groups.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GetGroupConfiguration`
 */
export const getGroupConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGroupConfigurationInput,
    output: GetGroupConfigurationOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Retrieves the resource query associated with the specified resource group. For more
 * information about resource queries, see Create
 * a tag-based group in Resource Groups.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GetGroupQuery`
 */
export const getGroupQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetGroupQueryInput,
    output: GetGroupQueryOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns a list of tags that are associated with a resource group, specified by an
 * Amazon resource name (ARN).
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GetTags`
 */
export const getTags = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetTagsInput,
    output: GetTagsOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns information about a specified tag-sync task.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GetTagSyncTask` on the application group
 */
export const getTagSyncTask = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GetTagSyncTaskInput,
    output: GetTagSyncTaskOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
}));
/**
 * Adds the specified resources to the specified group.
 *
 * You can only use this operation with the following groups:
 *
 * - `AWS::EC2::HostManagement`
 *
 * - `AWS::EC2::CapacityReservationPool`
 *
 * - `AWS::ResourceGroups::ApplicationGroup`
 *
 * Other resource group types and resource types are not currently supported by this
 * operation.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:GroupResources`
 */
export const groupResources = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: GroupResourcesInput,
    output: GroupResourcesOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns the status of the last grouping or ungrouping action for
 * each resource in the specified application group.
 */
export const listGroupingStatuses = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupingStatusesInput,
    output: ListGroupingStatusesOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "GroupingStatuses",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of Amazon resource names (ARNs) of the resources that are members of a specified resource
 * group.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:ListGroupResources`
 *
 * - `cloudformation:DescribeStacks`
 *
 * - `cloudformation:ListStackResources`
 *
 * - `tag:GetResources`
 */
export const listGroupResources = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupResourcesInput,
    output: ListGroupResourcesOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ResourceIdentifiers",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of existing Resource Groups in your account.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:ListGroups`
 */
export const listGroups = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListGroupsInput,
    output: ListGroupsOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "GroupIdentifiers",
        pageSize: "MaxResults",
    },
}));
/**
 * Returns a list of tag-sync tasks.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:ListTagSyncTasks` with the group passed in the filters as the resource
 * or * if using no filters
 */
export const listTagSyncTasks = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: ListTagSyncTasksInput,
    output: ListTagSyncTasksOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "TagSyncTasks",
        pageSize: "MaxResults",
    },
}));
/**
 * Attaches a service configuration to the specified group. This occurs asynchronously,
 * and can take time to complete. You can use GetGroupConfiguration to
 * check the status of the update.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:PutGroupConfiguration`
 */
export const putGroupConfiguration = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: PutGroupConfigurationInput,
    output: PutGroupConfigurationOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Returns a list of Amazon Web Services resource identifiers that matches the specified query. The
 * query uses the same format as a resource query in a CreateGroup or
 * UpdateGroupQuery operation.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:SearchResources`
 *
 * - `cloudformation:DescribeStacks`
 *
 * - `cloudformation:ListStackResources`
 *
 * - `tag:GetResources`
 */
export const searchResources = /*@__PURE__*/ /*#__PURE__*/ API.makePaginated(() => ({
    input: SearchResourcesInput,
    output: SearchResourcesOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
    pagination: {
        inputToken: "NextToken",
        outputToken: "NextToken",
        items: "ResourceIdentifiers",
        pageSize: "MaxResults",
    },
}));
/**
 * Creates a new tag-sync task to onboard and sync resources tagged with a specific tag key-value pair to an
 * application. To start a tag-sync task, you need a resource tagging role.
 * The resource tagging role grants permissions to tag and untag applications resources and must include a
 * trust policy that allows Resource Groups to assume the role and perform resource tagging tasks on your behalf.
 *
 * For instructions on creating a tag-sync task, see Create a tag-sync
 * using the Resource Groups API in the *Amazon Web Services Service Catalog AppRegistry Administrator Guide*.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:StartTagSyncTask` on the application group
 *
 * - `resource-groups:CreateGroup`
 *
 * - `iam:PassRole` on the role provided in the request
 */
export const startTagSyncTask = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: StartTagSyncTaskInput,
    output: StartTagSyncTaskOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
        UnauthorizedException,
    ],
}));
/**
 * Adds tags to a resource group with the specified Amazon resource name (ARN). Existing tags on a resource
 * group are not changed if they are not specified in the request parameters.
 *
 * Do not store personally identifiable information (PII) or other confidential or
 * sensitive information in tags. We use tags to provide you with billing and
 * administration services. Tags are not intended to be used for private or sensitive
 * data.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:Tag`
 */
export const tag = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: TagInput,
    output: TagOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Removes the specified resources from the specified group. This operation works only
 * with static groups that you populated using the GroupResources
 * operation. It doesn't work with any resource groups that are automatically populated by
 * tag-based or CloudFormation stack-based queries.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:UngroupResources`
 */
export const ungroupResources = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UngroupResourcesInput,
    output: UngroupResourcesOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Deletes tags from a specified resource group.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:Untag`
 */
export const untag = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UntagInput,
    output: UntagOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Turns on or turns off optional features in Resource Groups.
 *
 * The preceding example shows that the request to turn on group lifecycle events is
 * `IN_PROGRESS`. You can call the GetAccountSettings
 * operation to check for completion by looking for `GroupLifecycleEventsStatus`
 * to change to `ACTIVE`.
 */
export const updateAccountSettings = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateAccountSettingsInput,
    output: UpdateAccountSettingsOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        TooManyRequestsException,
    ],
}));
/**
 * Updates the description for an existing group. You cannot update the name of a
 * resource group.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:UpdateGroup`
 */
export const updateGroup = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateGroupInput,
    output: UpdateGroupOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
/**
 * Updates the resource query of a group. For more information about resource queries,
 * see Create a tag-based group in Resource Groups.
 *
 * **Minimum permissions**
 *
 * To run this command, you must have the following permissions:
 *
 * - `resource-groups:UpdateGroupQuery`
 */
export const updateGroupQuery = /*@__PURE__*/ /*#__PURE__*/ API.make(() => ({
    input: UpdateGroupQueryInput,
    output: UpdateGroupQueryOutput,
    errors: [
        BadRequestException,
        ForbiddenException,
        InternalServerErrorException,
        MethodNotAllowedException,
        NotFoundException,
        TooManyRequestsException,
    ],
}));
//# sourceMappingURL=resource-groups.js.map