public static bool TryParse()

in wwauth/Google.Solutions.WWAuth/Data/IdentityPoolConfiguration.cs [93:123]


        public static bool TryParse(
            string audience,
            out WorkloadIdentityPoolConfiguration configuration)
        {
            configuration = null;

            if (audience == null)
            {
                return false;
            }

            var audienceMatch = new Regex(
                "^//iam.googleapis.com/projects/(\\d+)/locations/(.+)/workloadIdentityPools/" +
                "(.+)/providers/(.+)$").Match(audience);
            if (audienceMatch.Success)
            {
                configuration = new WorkloadIdentityPoolConfiguration()
                {
                    ProjectNumber = ulong.Parse(audienceMatch.Groups[1].Value),
                    Location = audienceMatch.Groups[2].Value,
                    PoolName = audienceMatch.Groups[3].Value,
                    ProviderName = audienceMatch.Groups[4].Value
                };

                return true;
            }
            else
            {
                return false;
            }
        }