コード例 #1
0
        public PsPolicyDefinitionProperties(JToken input)
        {
            var properties = input.ToObject <PolicyDefinitionProperties>(JsonExtensions.JsonMediaTypeSerializer);

            Description = properties.Description;
            DisplayName = properties.DisplayName;
            Metadata    = properties.Metadata.ToPsObject();
            Mode        = properties.Mode;
            Parameters  = properties.Parameters.ToPsObject();
            PolicyRule  = properties.PolicyRule.ToPsObject();
            PolicyType  = PsPolicyDefinitionProperties.PolicyTypeToPsPolicyType(properties.PolicyType);
        }
コード例 #2
0
        public PsPolicyDefinition(JToken input)
        {
            var resource = input.ToResource();

            Name = resource.Name;
            PolicyDefinitionId = resource.Id;
            Properties         = new PsPolicyDefinitionProperties(resource.Properties);
            ResourceId         = resource.Id;
            ResourceName       = resource.Name;
            ResourceType       = resource.Type;
            SubscriptionId     = string.IsNullOrEmpty(resource.Id) ? null : ResourceIdUtility.GetSubscriptionId(resource.Id);
        }