import { __assign, __awaiter, __generator } from "tslib";
import { getRegionInfo } from "@aws-sdk/config-resolver";
var regionHash = {
    "us-east-1": {
        variants: [
            {
                hostname: "codebuild.us-east-1.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-east-1.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
    "us-east-2": {
        variants: [
            {
                hostname: "codebuild.us-east-2.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-east-2.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
    "us-gov-east-1": {
        variants: [
            {
                hostname: "codebuild.us-gov-east-1.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-gov-east-1.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
    "us-gov-west-1": {
        variants: [
            {
                hostname: "codebuild.us-gov-west-1.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-gov-west-1.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
    "us-west-1": {
        variants: [
            {
                hostname: "codebuild.us-west-1.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-west-1.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
    "us-west-2": {
        variants: [
            {
                hostname: "codebuild.us-west-2.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.us-west-2.amazonaws.com",
                tags: ["fips"],
            },
        ],
    },
};
var partitionHash = {
    aws: {
        regions: [
            "af-south-1",
            "ap-east-1",
            "ap-northeast-1",
            "ap-northeast-2",
            "ap-northeast-3",
            "ap-south-1",
            "ap-southeast-1",
            "ap-southeast-2",
            "ca-central-1",
            "eu-central-1",
            "eu-north-1",
            "eu-south-1",
            "eu-west-1",
            "eu-west-2",
            "eu-west-3",
            "me-south-1",
            "sa-east-1",
            "us-east-1",
            "us-east-1-fips",
            "us-east-2",
            "us-east-2-fips",
            "us-west-1",
            "us-west-1-fips",
            "us-west-2",
            "us-west-2-fips",
        ],
        regionRegex: "^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",
        variants: [
            {
                hostname: "codebuild.{region}.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.{region}.amazonaws.com",
                tags: ["fips"],
            },
            {
                hostname: "codebuild-fips.{region}.api.aws",
                tags: ["dualstack", "fips"],
            },
            {
                hostname: "codebuild.{region}.api.aws",
                tags: ["dualstack"],
            },
        ],
    },
    "aws-cn": {
        regions: ["cn-north-1", "cn-northwest-1"],
        regionRegex: "^cn\\-\\w+\\-\\d+$",
        variants: [
            {
                hostname: "codebuild.{region}.amazonaws.com.cn",
                tags: [],
            },
            {
                hostname: "codebuild-fips.{region}.amazonaws.com.cn",
                tags: ["fips"],
            },
            {
                hostname: "codebuild-fips.{region}.api.amazonwebservices.com.cn",
                tags: ["dualstack", "fips"],
            },
            {
                hostname: "codebuild.{region}.api.amazonwebservices.com.cn",
                tags: ["dualstack"],
            },
        ],
    },
    "aws-iso": {
        regions: ["us-iso-east-1", "us-iso-west-1"],
        regionRegex: "^us\\-iso\\-\\w+\\-\\d+$",
        variants: [
            {
                hostname: "codebuild.{region}.c2s.ic.gov",
                tags: [],
            },
            {
                hostname: "codebuild-fips.{region}.c2s.ic.gov",
                tags: ["fips"],
            },
        ],
    },
    "aws-iso-b": {
        regions: ["us-isob-east-1"],
        regionRegex: "^us\\-isob\\-\\w+\\-\\d+$",
        variants: [
            {
                hostname: "codebuild.{region}.sc2s.sgov.gov",
                tags: [],
            },
            {
                hostname: "codebuild-fips.{region}.sc2s.sgov.gov",
                tags: ["fips"],
            },
        ],
    },
    "aws-us-gov": {
        regions: ["us-gov-east-1", "us-gov-east-1-fips", "us-gov-west-1", "us-gov-west-1-fips"],
        regionRegex: "^us\\-gov\\-\\w+\\-\\d+$",
        variants: [
            {
                hostname: "codebuild.{region}.amazonaws.com",
                tags: [],
            },
            {
                hostname: "codebuild-fips.{region}.amazonaws.com",
                tags: ["fips"],
            },
            {
                hostname: "codebuild-fips.{region}.api.aws",
                tags: ["dualstack", "fips"],
            },
            {
                hostname: "codebuild.{region}.api.aws",
                tags: ["dualstack"],
            },
        ],
    },
};
export var defaultRegionInfoProvider = function (region, options) { return __awaiter(void 0, void 0, void 0, function () {
    return __generator(this, function (_a) {
        return [2, getRegionInfo(region, __assign(__assign({}, options), { signingService: "codebuild", regionHash: regionHash, partitionHash: partitionHash }))];
    });
}); };
