Exemplo n.º 1
0
        public ResourceTypeComponents GetResourceType(Azure.Bicep.Types.Concrete.ResourceType resourceType)
        {
            var resourceTypeReference = ResourceTypeReference.Parse(resourceType.Name);
            var bodyType = GetTypeSymbol(resourceType.Body.Type, true);

            return(new ResourceTypeComponents(resourceTypeReference, ToResourceScope(resourceType.ScopeType), bodyType));
        }
Exemplo n.º 2
0
        public ResourceTypeComponents GetResourceType(Azure.Bicep.Types.Concrete.ResourceType resourceType, IEnumerable <FunctionOverload> resourceFunctions)
        {
            var resourceTypeReference = ResourceTypeReference.Parse(resourceType.Name);
            var bodyType = GetTypeSymbol(resourceType.Body.Type, true);

            if (bodyType is ObjectType objectType && resourceFunctions.Any())
            {
                bodyType = new ObjectType(bodyType.Name, bodyType.ValidationFlags, objectType.Properties.Values, objectType.AdditionalPropertiesType, objectType.AdditionalPropertiesFlags, resourceFunctions);
            }

            return(new ResourceTypeComponents(resourceTypeReference, ToResourceScope(resourceType.ScopeType), bodyType));
        }
Exemplo n.º 3
0
        public ResourceType GetResourceType(Azure.Bicep.Types.Concrete.ResourceType resourceType)
        {
            var output = GetTypeSymbol(resourceType, false) as ResourceType;

            return(output ?? throw new ArgumentException("Unable to deserialize resource type", nameof(resourceType)));
        }