예제 #1
0
 internal PrivateLinkServiceConnection(ResourceIdentifier id, string name, ResourceType?resourceType, ETag?etag, NetworkProvisioningState?provisioningState, string privateLinkServiceId, IList <string> groupIds, string requestMessage, NetworkPrivateLinkServiceConnectionState connectionState) : base(id, name, resourceType)
 {
     Etag = etag;
     ProvisioningState    = provisioningState;
     PrivateLinkServiceId = privateLinkServiceId;
     GroupIds             = groupIds;
     RequestMessage       = requestMessage;
     ConnectionState      = connectionState;
 }
 internal PrivateLinkServiceConnection(string id, string name, string resourceType, string etag, ProvisioningState?provisioningState, string privateLinkServiceId, IList <string> groupIds, string requestMessage, NetworkPrivateLinkServiceConnectionState connectionState) : base(id)
 {
     Name                 = name;
     ResourceType         = resourceType;
     Etag                 = etag;
     ProvisioningState    = provisioningState;
     PrivateLinkServiceId = privateLinkServiceId;
     GroupIds             = groupIds;
     RequestMessage       = requestMessage;
     ConnectionState      = connectionState;
 }
예제 #3
0
        internal static PrivateLinkServiceConnection DeserializePrivateLinkServiceConnection(JsonElement element)
        {
            Optional <string>            name = default;
            Optional <string>            type = default;
            Optional <string>            etag = default;
            Optional <string>            id   = default;
            Optional <ProvisioningState> provisioningState    = default;
            Optional <string>            privateLinkServiceId = default;
            Optional <IList <string> >   groupIds             = default;
            Optional <string>            requestMessage       = default;
            Optional <NetworkPrivateLinkServiceConnectionState> privateLinkServiceConnectionState = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("name"))
                {
                    name = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("type"))
                {
                    type = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("etag"))
                {
                    etag = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("id"))
                {
                    id = 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("provisioningState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            provisioningState = new ProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("privateLinkServiceId"))
                        {
                            privateLinkServiceId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("groupIds"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            List <string> array = new List <string>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(item.GetString());
                            }
                            groupIds = array;
                            continue;
                        }
                        if (property0.NameEquals("requestMessage"))
                        {
                            requestMessage = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("privateLinkServiceConnectionState"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            privateLinkServiceConnectionState = NetworkPrivateLinkServiceConnectionState.DeserializeNetworkPrivateLinkServiceConnectionState(property0.Value);
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new PrivateLinkServiceConnection(id.Value, name.Value, type.Value, etag.Value, Optional.ToNullable(provisioningState), privateLinkServiceId.Value, Optional.ToList(groupIds), requestMessage.Value, privateLinkServiceConnectionState.Value));
        }