Beispiel #1
0
        internal static GenericResourceAutoGenerated DeserializeGenericResourceAutoGenerated(JsonElement element)
        {
            Optional <string>            managedBy = default;
            Optional <SkuAutoGenerated>  sku       = default;
            IDictionary <string, string> tags      = default;
            Location           location            = default;
            ResourceIdentifier id   = default;
            string             name = default;
            ResourceType       type = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
            }
            return(new GenericResourceAutoGenerated(id, name, type, tags, location, managedBy.Value, sku.Value));
        }
Beispiel #2
0
 internal Application(string id, string name, string type, string location, IDictionary <string, string> tags, string managedBy, SkuAutoGenerated sku, IdentityAutoGenerated2 identity, PlanAutoGenerated plan, string kind, string managedResourceGroupId, string applicationDefinitionId, object parameters, object outputs, ProvisioningState?provisioningState) : base(id, name, type, location, tags, managedBy, sku, identity)
 {
     Plan = plan;
     Kind = kind;
     ManagedResourceGroupId  = managedResourceGroupId;
     ApplicationDefinitionId = applicationDefinitionId;
     Parameters        = parameters;
     Outputs           = outputs;
     ProvisioningState = provisioningState;
 }
 internal GenericResourceAutoGenerated(string id, string name, string type, string location, IDictionary <string, string> tags, string managedBy, SkuAutoGenerated sku, IdentityAutoGenerated2 identity) : base(id, name, type, location, tags)
 {
     ManagedBy = managedBy;
     Sku       = sku;
     Identity  = identity;
 }
        internal static Application DeserializeApplication(JsonElement element)
        {
            Optional <PlanAutoGenerated> plan                  = default;
            string                                   kind      = default;
            Optional <string>                        managedBy = default;
            Optional <SkuAutoGenerated>              sku       = default;
            Optional <IdentityAutoGenerated2>        identity  = default;
            Optional <string>                        id        = default;
            Optional <string>                        name      = default;
            Optional <string>                        type      = default;
            Optional <string>                        location  = default;
            Optional <IDictionary <string, string> > tags      = default;
            string                                   managedResourceGroupId  = default;
            Optional <string>                        applicationDefinitionId = default;
            Optional <object>                        parameters        = default;
            Optional <object>                        outputs           = default;
            Optional <ProvisioningState>             provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("plan"))
                {
                    plan = PlanAutoGenerated.DeserializePlanAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("managedResourceGroupId"))
                        {
                            managedResourceGroupId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("applicationDefinitionId"))
                        {
                            applicationDefinitionId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("parameters"))
                        {
                            parameters = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("outputs"))
                        {
                            outputs = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new Application(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), managedBy.Value, sku.Value, identity.Value, plan.Value, kind, managedResourceGroupId, applicationDefinitionId.Value, parameters.Value, outputs.Value, Optional.ToNullable(provisioningState)));
        }
        internal static GenericResourceAutoGenerated DeserializeGenericResourceAutoGenerated(JsonElement element)
        {
            Optional <string>                        managedBy = default;
            Optional <SkuAutoGenerated>              sku       = default;
            Optional <IdentityAutoGenerated2>        identity  = default;
            Optional <string>                        id        = default;
            Optional <string>                        name      = default;
            Optional <string>                        type      = default;
            Optional <string>                        location  = default;
            Optional <IDictionary <string, string> > tags      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new GenericResourceAutoGenerated(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), managedBy.Value, sku.Value, identity.Value));
        }
        internal static ApplicationPatchable DeserializeApplicationPatchable(JsonElement element)
        {
            Optional <Plan>   plan = default;
            Optional <string> kind = default;
            Optional <IdentityAutoGenerated> identity                           = default;
            Optional <string>            managedBy                              = default;
            Optional <SkuAutoGenerated>  sku                                    = default;
            IDictionary <string, string> tags                                   = default;
            Location                     location                               = default;
            ResourceIdentifier           id                                     = default;
            string                       name                                   = default;
            ResourceType                 type                                   = default;
            Optional <string>            managedResourceGroupId                 = default;
            Optional <string>            applicationDefinitionId                = default;
            Optional <object>            parameters                             = default;
            Optional <object>            outputs                                = default;
            Optional <ProvisioningState> provisioningState                      = default;
            Optional <ApplicationBillingDetailsDefinition> billingDetails       = default;
            Optional <ApplicationJitAccessPolicy>          jitAccessPolicy      = default;
            Optional <string> publisherTenantId                                 = default;
            Optional <IReadOnlyList <ApplicationAuthorization> > authorizations = default;
            Optional <ApplicationManagementMode>            managementMode      = default;
            Optional <ApplicationPackageContact>            customerSupport     = default;
            Optional <ApplicationPackageSupportUrls>        supportUrls         = default;
            Optional <IReadOnlyList <ApplicationArtifact> > artifacts           = default;
            Optional <ApplicationClientDetails>             createdBy           = default;
            Optional <ApplicationClientDetails>             updatedBy           = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("plan"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    plan = JsonSerializer.Deserialize <Plan>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = IdentityAutoGenerated.DeserializeIdentityAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = new ResourceIdentifier(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("managedResourceGroupId"))
                        {
                            managedResourceGroupId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("applicationDefinitionId"))
                        {
                            applicationDefinitionId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("parameters"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            parameters = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("outputs"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            outputs = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("billingDetails"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            billingDetails = ApplicationBillingDetailsDefinition.DeserializeApplicationBillingDetailsDefinition(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("jitAccessPolicy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            jitAccessPolicy = ApplicationJitAccessPolicy.DeserializeApplicationJitAccessPolicy(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("publisherTenantId"))
                        {
                            publisherTenantId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("authorizations"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ApplicationAuthorization> array = new List <ApplicationAuthorization>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationAuthorization.DeserializeApplicationAuthorization(item));
                            }
                            authorizations = array;
                            continue;
                        }
                        if (property0.NameEquals("managementMode"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            managementMode = new ApplicationManagementMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("customerSupport"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            customerSupport = ApplicationPackageContact.DeserializeApplicationPackageContact(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("supportUrls"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            supportUrls = ApplicationPackageSupportUrls.DeserializeApplicationPackageSupportUrls(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("artifacts"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <ApplicationArtifact> array = new List <ApplicationArtifact>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationArtifact.DeserializeApplicationArtifact(item));
                            }
                            artifacts = array;
                            continue;
                        }
                        if (property0.NameEquals("createdBy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            createdBy = ApplicationClientDetails.DeserializeApplicationClientDetails(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("updatedBy"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            updatedBy = ApplicationClientDetails.DeserializeApplicationClientDetails(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationPatchable(id, name, type, tags, location, managedBy.Value, sku.Value, plan, kind.Value, identity.Value, managedResourceGroupId.Value, applicationDefinitionId.Value, parameters.Value, outputs.Value, Optional.ToNullable(provisioningState), billingDetails.Value, jitAccessPolicy.Value, publisherTenantId.Value, Optional.ToList(authorizations), Optional.ToNullable(managementMode), customerSupport.Value, supportUrls.Value, Optional.ToList(artifacts), createdBy.Value, updatedBy.Value));
        }
        internal static GenericResourceAutoGenerated DeserializeGenericResourceAutoGenerated(JsonElement element)
        {
            string                       managedBy = default;
            SkuAutoGenerated             sku       = default;
            IdentityAutoGenerated2       identity  = default;
            string                       id        = default;
            string                       name      = default;
            string                       type      = default;
            string                       location  = default;
            IDictionary <string, string> tags      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
            }
            return(new GenericResourceAutoGenerated(id, name, type, location, tags, managedBy, sku, identity));
        }
Beispiel #8
0
 internal ApplicationDefinition(string id, string name, string type, string location, IDictionary <string, string> tags, string managedBy, SkuAutoGenerated sku, IdentityAutoGenerated2 identity, ApplicationLockLevel lockLevel, string displayName, string isEnabled, IList <ApplicationProviderAuthorization> authorizations, IList <ApplicationArtifact> artifacts, string description, string packageFileUri, object mainTemplate, object createUiDefinition) : base(id, name, type, location, tags, managedBy, sku, identity)
 {
     LockLevel          = lockLevel;
     DisplayName        = displayName;
     IsEnabled          = isEnabled;
     Authorizations     = authorizations;
     Artifacts          = artifacts;
     Description        = description;
     PackageFileUri     = packageFileUri;
     MainTemplate       = mainTemplate;
     CreateUiDefinition = createUiDefinition;
 }
 internal GenericResourceAutoGenerated(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, string managedBy, SkuAutoGenerated sku) : base(id, name, type, tags, location)
 {
     ManagedBy = managedBy;
     Sku       = sku;
 }
        internal static ApplicationDefinition DeserializeApplicationDefinition(JsonElement element)
        {
            Optional <string>                        managedBy          = default;
            Optional <SkuAutoGenerated>              sku                = default;
            Optional <IdentityAutoGenerated2>        identity           = default;
            Optional <string>                        id                 = default;
            Optional <string>                        name               = default;
            Optional <string>                        type               = default;
            Optional <string>                        location           = default;
            Optional <IDictionary <string, string> > tags               = default;
            ApplicationLockLevel                     lockLevel          = default;
            Optional <string>                        displayName        = default;
            Optional <string>                        isEnabled          = default;
            IList <ApplicationProviderAuthorization> authorizations     = default;
            Optional <IList <ApplicationArtifact> >  artifacts          = default;
            Optional <string>                        description        = default;
            Optional <string>                        packageFileUri     = default;
            Optional <object>                        mainTemplate       = default;
            Optional <object>                        createUiDefinition = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        dictionary.Add(property0.Name, property0.Value.GetString());
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("lockLevel"))
                        {
                            lockLevel = property0.Value.GetString().ToApplicationLockLevel();
                            continue;
                        }
                        if (property0.NameEquals("displayName"))
                        {
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("isEnabled"))
                        {
                            isEnabled = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("authorizations"))
                        {
                            List <ApplicationProviderAuthorization> array = new List <ApplicationProviderAuthorization>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationProviderAuthorization.DeserializeApplicationProviderAuthorization(item));
                            }
                            authorizations = array;
                            continue;
                        }
                        if (property0.NameEquals("artifacts"))
                        {
                            List <ApplicationArtifact> array = new List <ApplicationArtifact>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ApplicationArtifact.DeserializeApplicationArtifact(item));
                            }
                            artifacts = array;
                            continue;
                        }
                        if (property0.NameEquals("description"))
                        {
                            description = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("packageFileUri"))
                        {
                            packageFileUri = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("mainTemplate"))
                        {
                            mainTemplate = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("createUiDefinition"))
                        {
                            createUiDefinition = property0.Value.GetObject();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationDefinition(id.Value, name.Value, type.Value, location.Value, Optional.ToDictionary(tags), managedBy.Value, sku.Value, identity.Value, lockLevel, displayName.Value, isEnabled.Value, authorizations, Optional.ToList(artifacts), description.Value, packageFileUri.Value, mainTemplate.Value, createUiDefinition.Value));
        }
Beispiel #11
0
        internal static ApplicationDefinition DeserializeApplicationDefinition(JsonElement element)
        {
            string                                   managedBy          = default;
            SkuAutoGenerated                         sku                = default;
            IdentityAutoGenerated2                   identity           = default;
            string                                   id                 = default;
            string                                   name               = default;
            string                                   type               = default;
            string                                   location           = default;
            IDictionary <string, string>             tags               = default;
            ApplicationLockLevel                     lockLevel          = default;
            string                                   displayName        = default;
            string                                   isEnabled          = default;
            IList <ApplicationProviderAuthorization> authorizations     = default;
            IList <ApplicationArtifact>              artifacts          = default;
            string                                   description        = default;
            string                                   packageFileUri     = default;
            object                                   mainTemplate       = default;
            object                                   createUiDefinition = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("managedBy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("lockLevel"))
                        {
                            lockLevel = property0.Value.GetString().ToApplicationLockLevel();
                            continue;
                        }
                        if (property0.NameEquals("displayName"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("isEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            isEnabled = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("authorizations"))
                        {
                            List <ApplicationProviderAuthorization> array = new List <ApplicationProviderAuthorization>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationProviderAuthorization.DeserializeApplicationProviderAuthorization(item));
                                }
                            }
                            authorizations = array;
                            continue;
                        }
                        if (property0.NameEquals("artifacts"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            List <ApplicationArtifact> array = new List <ApplicationArtifact>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                if (item.ValueKind == JsonValueKind.Null)
                                {
                                    array.Add(null);
                                }
                                else
                                {
                                    array.Add(ApplicationArtifact.DeserializeApplicationArtifact(item));
                                }
                            }
                            artifacts = array;
                            continue;
                        }
                        if (property0.NameEquals("description"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            description = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("packageFileUri"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            packageFileUri = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("mainTemplate"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            mainTemplate = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("createUiDefinition"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            createUiDefinition = property0.Value.GetObject();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ApplicationDefinition(id, name, type, location, tags, managedBy, sku, identity, lockLevel, displayName, isEnabled, authorizations, artifacts, description, packageFileUri, mainTemplate, createUiDefinition));
        }
Beispiel #12
0
 internal ApplicationPatchable(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, string managedBy, SkuAutoGenerated sku, Plan plan, string kind, IdentityAutoGenerated identity, string managedResourceGroupId, string applicationDefinitionId, object parameters, object outputs, ProvisioningState?provisioningState, ApplicationBillingDetailsDefinition billingDetails, ApplicationJitAccessPolicy jitAccessPolicy, string publisherTenantId, IReadOnlyList <ApplicationAuthorization> authorizations, ApplicationManagementMode?managementMode, ApplicationPackageContact customerSupport, ApplicationPackageSupportUrls supportUrls, IReadOnlyList <ApplicationArtifact> artifacts, ApplicationClientDetails createdBy, ApplicationClientDetails updatedBy) : base(id, name, type, tags, location, managedBy, sku)
 {
     Plan     = plan;
     Kind     = kind;
     Identity = identity;
     ManagedResourceGroupId  = managedResourceGroupId;
     ApplicationDefinitionId = applicationDefinitionId;
     Parameters        = parameters;
     Outputs           = outputs;
     ProvisioningState = provisioningState;
     BillingDetails    = billingDetails;
     JitAccessPolicy   = jitAccessPolicy;
     PublisherTenantId = publisherTenantId;
     Authorizations    = authorizations;
     ManagementMode    = managementMode;
     CustomerSupport   = customerSupport;
     SupportUrls       = supportUrls;
     Artifacts         = artifacts;
     CreatedBy         = createdBy;
     UpdatedBy         = updatedBy;
 }
Beispiel #13
0
        internal static Application DeserializeApplication(JsonElement element)
        {
            PlanAutoGenerated            plan      = default;
            string                       kind      = default;
            string                       managedBy = default;
            SkuAutoGenerated             sku       = default;
            IdentityAutoGenerated2       identity  = default;
            string                       id        = default;
            string                       name      = default;
            string                       type      = default;
            string                       location  = default;
            IDictionary <string, string> tags      = default;
            string                       managedResourceGroupId  = default;
            string                       applicationDefinitionId = default;
            object                       parameters        = default;
            object                       outputs           = default;
            ProvisioningState?           provisioningState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("plan"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    plan = PlanAutoGenerated.DeserializePlanAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("managedBy"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    managedBy = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    sku = SkuAutoGenerated.DeserializeSkuAutoGenerated(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    identity = IdentityAutoGenerated2.DeserializeIdentityAutoGenerated2(property.Value);
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    id = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("name"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        continue;
                    }
                    Dictionary <string, string> dictionary = new Dictionary <string, string>();
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.Value.ValueKind == JsonValueKind.Null)
                        {
                            dictionary.Add(property0.Name, null);
                        }
                        else
                        {
                            dictionary.Add(property0.Name, property0.Value.GetString());
                        }
                    }
                    tags = dictionary;
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("managedResourceGroupId"))
                        {
                            managedResourceGroupId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("applicationDefinitionId"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            applicationDefinitionId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("parameters"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            parameters = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("outputs"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            outputs = property0.Value.GetObject();
                            continue;
                        }
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new Application(id, name, type, location, tags, managedBy, sku, identity, plan, kind, managedResourceGroupId, applicationDefinitionId, parameters, outputs, provisioningState));
        }