コード例 #1
0
 internal IotCentralAppData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary <string, string> tags, AzureLocation location, AppSkuInfo sku, SystemAssignedServiceIdentity identity, ProvisioningState?provisioningState, string applicationId, string displayName, string subdomain, string template, AppState?state, PublicNetworkAccess?publicNetworkAccess, NetworkRuleSets networkRuleSets, IReadOnlyList <IotCentralPrivateEndpointConnectionData> privateEndpointConnections) : base(id, name, resourceType, systemData, tags, location)
 {
     Sku                        = sku;
     Identity                   = identity;
     ProvisioningState          = provisioningState;
     ApplicationId              = applicationId;
     DisplayName                = displayName;
     Subdomain                  = subdomain;
     Template                   = template;
     State                      = state;
     PublicNetworkAccess        = publicNetworkAccess;
     NetworkRuleSets            = networkRuleSets;
     PrivateEndpointConnections = privateEndpointConnections;
 }
コード例 #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="Rest.ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (AuthorizationPolicies != null)
     {
         foreach (var element in AuthorizationPolicies)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (IpFilterRules != null)
     {
         foreach (var element1 in IpFilterRules)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
     if (NetworkRuleSets != null)
     {
         NetworkRuleSets.Validate();
     }
     if (PrivateEndpointConnections != null)
     {
         foreach (var element2 in PrivateEndpointConnections)
         {
             if (element2 != null)
             {
                 element2.Validate();
             }
         }
     }
     if (Routing != null)
     {
         Routing.Validate();
     }
     if (StorageEndpoints != null)
     {
         foreach (var valueElement in StorageEndpoints.Values)
         {
             if (valueElement != null)
             {
                 valueElement.Validate();
             }
         }
     }
     if (MessagingEndpoints != null)
     {
         foreach (var valueElement1 in MessagingEndpoints.Values)
         {
             if (valueElement1 != null)
             {
                 valueElement1.Validate();
             }
         }
     }
     if (CloudToDevice != null)
     {
         CloudToDevice.Validate();
     }
 }
コード例 #3
0
        internal static IotCentralAppData DeserializeIotCentralAppData(JsonElement element)
        {
            AppSkuInfo sku = default;
            Optional <SystemAssignedServiceIdentity> identity = default;
            IDictionary <string, string>             tags     = default;
            AzureLocation                  location           = default;
            ResourceIdentifier             id                  = default;
            string                         name                = default;
            ResourceType                   type                = default;
            SystemData                     systemData          = default;
            Optional <ProvisioningState>   provisioningState   = default;
            Optional <string>              applicationId       = default;
            Optional <string>              displayName         = default;
            Optional <string>              subdomain           = default;
            Optional <string>              template            = default;
            Optional <AppState>            state               = default;
            Optional <PublicNetworkAccess> publicNetworkAccess = default;
            Optional <NetworkRuleSets>     networkRuleSets     = default;
            Optional <IReadOnlyList <IotCentralPrivateEndpointConnectionData> > privateEndpointConnections = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("sku"))
                {
                    sku = AppSkuInfo.DeserializeAppSkuInfo(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = JsonSerializer.Deserialize <SystemAssignedServiceIdentity>(property.Value.ToString());
                    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("systemData"))
                {
                    systemData = JsonSerializer.Deserialize <SystemData>(property.Value.ToString());
                    continue;
                }
                if (property.NameEquals("properties"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("applicationId"))
                        {
                            applicationId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("displayName"))
                        {
                            displayName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("subdomain"))
                        {
                            subdomain = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("template"))
                        {
                            template = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            state = new AppState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("publicNetworkAccess"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            publicNetworkAccess = new PublicNetworkAccess(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("networkRuleSets"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            networkRuleSets = NetworkRuleSets.DeserializeNetworkRuleSets(property0.Value);
                            continue;
                        }
                        if (property0.NameEquals("privateEndpointConnections"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <IotCentralPrivateEndpointConnectionData> array = new List <IotCentralPrivateEndpointConnectionData>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(IotCentralPrivateEndpointConnectionData.DeserializeIotCentralPrivateEndpointConnectionData(item));
                            }
                            privateEndpointConnections = array;
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new IotCentralAppData(id, name, type, systemData, tags, location, sku, identity, Optional.ToNullable(provisioningState), applicationId.Value, displayName.Value, subdomain.Value, template.Value, Optional.ToNullable(state), Optional.ToNullable(publicNetworkAccess), networkRuleSets.Value, Optional.ToList(privateEndpointConnections)));
        }