internal ManagedInstanceData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, Models.ResourceIdentity identity, Models.Sku sku, ManagedInstancePropertiesProvisioningState?provisioningState, ManagedServerCreateMode?managedInstanceCreateMode, string fullyQualifiedDomainName, string administratorLogin, string administratorLoginPassword, string subnetId, string state, ManagedInstanceLicenseType?licenseType, int?vCores, int?storageSizeInGB, string collation, string dnsZone, string dnsZonePartner, bool?publicDataEndpointEnabled, string sourceManagedInstanceId, DateTimeOffset?restorePointInTime, ManagedInstanceProxyOverride?proxyOverride, string timezoneId, string instancePoolId, string maintenanceConfigurationId, IReadOnlyList <ManagedInstancePecProperty> privateEndpointConnections, string minimalTlsVersion, StorageAccountType?storageAccountType, bool?zoneRedundant, string primaryUserAssignedIdentityId, string keyId, ManagedInstanceExternalAdministrator administrators) : base(id, name, type, tags, location)
 {
     Identity                      = identity;
     Sku                           = sku;
     ProvisioningState             = provisioningState;
     ManagedInstanceCreateMode     = managedInstanceCreateMode;
     FullyQualifiedDomainName      = fullyQualifiedDomainName;
     AdministratorLogin            = administratorLogin;
     AdministratorLoginPassword    = administratorLoginPassword;
     SubnetId                      = subnetId;
     State                         = state;
     LicenseType                   = licenseType;
     VCores                        = vCores;
     StorageSizeInGB               = storageSizeInGB;
     Collation                     = collation;
     DnsZone                       = dnsZone;
     DnsZonePartner                = dnsZonePartner;
     PublicDataEndpointEnabled     = publicDataEndpointEnabled;
     SourceManagedInstanceId       = sourceManagedInstanceId;
     RestorePointInTime            = restorePointInTime;
     ProxyOverride                 = proxyOverride;
     TimezoneId                    = timezoneId;
     InstancePoolId                = instancePoolId;
     MaintenanceConfigurationId    = maintenanceConfigurationId;
     PrivateEndpointConnections    = privateEndpointConnections;
     MinimalTlsVersion             = minimalTlsVersion;
     StorageAccountType            = storageAccountType;
     ZoneRedundant                 = zoneRedundant;
     PrimaryUserAssignedIdentityId = primaryUserAssignedIdentityId;
     KeyId                         = keyId;
     Administrators                = administrators;
 }
 internal SqlServerData(ResourceIdentifier id, string name, ResourceType type, IDictionary <string, string> tags, Location location, Models.ResourceIdentity identity, string kind, string administratorLogin, string administratorLoginPassword, string version, string state, string fullyQualifiedDomainName, IReadOnlyList <ServerPrivateEndpointConnection> privateEndpointConnections, string minimalTlsVersion, ServerNetworkAccessFlag?publicNetworkAccess, ServerWorkspaceFeature?workspaceFeature, string primaryUserAssignedIdentityId, Guid?federatedClientId, string keyId, ServerExternalAdministrator administrators, ServerNetworkAccessFlag?restrictOutboundNetworkAccess) : base(id, name, type, tags, location)
 {
     Identity                      = identity;
     Kind                          = kind;
     AdministratorLogin            = administratorLogin;
     AdministratorLoginPassword    = administratorLoginPassword;
     Version                       = version;
     State                         = state;
     FullyQualifiedDomainName      = fullyQualifiedDomainName;
     PrivateEndpointConnections    = privateEndpointConnections;
     MinimalTlsVersion             = minimalTlsVersion;
     PublicNetworkAccess           = publicNetworkAccess;
     WorkspaceFeature              = workspaceFeature;
     PrimaryUserAssignedIdentityId = primaryUserAssignedIdentityId;
     FederatedClientId             = federatedClientId;
     KeyId                         = keyId;
     Administrators                = administrators;
     RestrictOutboundNetworkAccess = restrictOutboundNetworkAccess;
 }
Exemplo n.º 3
0
 internal Server(string id, string name, string type, string location, IDictionary <string, string> tags, ResourceIdentity identity, string kind, string administratorLogin, string administratorLoginPassword, string version, string state, string fullyQualifiedDomainName, IReadOnlyList <ServerPrivateEndpointConnection> privateEndpointConnections, string minimalTlsVersion, ServerPublicNetworkAccess?publicNetworkAccess) : base(id, name, type, location, tags)
 {
     Identity                   = identity;
     Kind                       = kind;
     AdministratorLogin         = administratorLogin;
     AdministratorLoginPassword = administratorLoginPassword;
     Version                    = version;
     State                      = state;
     FullyQualifiedDomainName   = fullyQualifiedDomainName;
     PrivateEndpointConnections = privateEndpointConnections;
     MinimalTlsVersion          = minimalTlsVersion;
     PublicNetworkAccess        = publicNetworkAccess;
 }
Exemplo n.º 4
0
        internal static ManagedInstance DeserializeManagedInstance(JsonElement element)
        {
            Optional <ResourceIdentity> identity = default;
            Optional <Sku> sku      = default;
            string         location = default;
            Optional <IDictionary <string, string> > tags = default;
            Optional <string> id   = default;
            Optional <string> name = default;
            Optional <string> type = default;
            Optional <ManagedInstancePropertiesProvisioningState> provisioningState = default;
            Optional <ManagedServerCreateMode> managedInstanceCreateMode            = default;
            Optional <string> fullyQualifiedDomainName   = default;
            Optional <string> administratorLogin         = default;
            Optional <string> administratorLoginPassword = default;
            Optional <string> subnetId = default;
            Optional <string> state    = default;
            Optional <ManagedInstanceLicenseType> licenseType = default;
            Optional <int>            vCores                      = default;
            Optional <int>            storageSizeInGB             = default;
            Optional <string>         collation                   = default;
            Optional <string>         dnsZone                     = default;
            Optional <string>         dnsZonePartner              = default;
            Optional <bool>           publicDataEndpointEnabled   = default;
            Optional <string>         sourceManagedInstanceId     = default;
            Optional <DateTimeOffset> restorePointInTime          = default;
            Optional <ManagedInstanceProxyOverride> proxyOverride = default;
            Optional <string> timezoneId                 = default;
            Optional <string> instancePoolId             = default;
            Optional <string> maintenanceConfigurationId = default;
            Optional <string> minimalTlsVersion          = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    identity = ResourceIdentity.DeserializeResourceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("sku"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    sku = Sku.DeserializeSku(property.Value);
                    continue;
                }
                if (property.NameEquals("location"))
                {
                    location = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("tags"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    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("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("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 ManagedInstancePropertiesProvisioningState(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("managedInstanceCreateMode"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            managedInstanceCreateMode = new ManagedServerCreateMode(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("fullyQualifiedDomainName"))
                        {
                            fullyQualifiedDomainName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("administratorLogin"))
                        {
                            administratorLogin = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("administratorLoginPassword"))
                        {
                            administratorLoginPassword = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("subnetId"))
                        {
                            subnetId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            state = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("licenseType"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            licenseType = new ManagedInstanceLicenseType(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("vCores"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            vCores = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("storageSizeInGB"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            storageSizeInGB = property0.Value.GetInt32();
                            continue;
                        }
                        if (property0.NameEquals("collation"))
                        {
                            collation = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("dnsZone"))
                        {
                            dnsZone = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("dnsZonePartner"))
                        {
                            dnsZonePartner = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("publicDataEndpointEnabled"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            publicDataEndpointEnabled = property0.Value.GetBoolean();
                            continue;
                        }
                        if (property0.NameEquals("sourceManagedInstanceId"))
                        {
                            sourceManagedInstanceId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("restorePointInTime"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            restorePointInTime = property0.Value.GetDateTimeOffset("O");
                            continue;
                        }
                        if (property0.NameEquals("proxyOverride"))
                        {
                            if (property0.Value.ValueKind == JsonValueKind.Null)
                            {
                                property0.ThrowNonNullablePropertyIsNull();
                                continue;
                            }
                            proxyOverride = new ManagedInstanceProxyOverride(property0.Value.GetString());
                            continue;
                        }
                        if (property0.NameEquals("timezoneId"))
                        {
                            timezoneId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("instancePoolId"))
                        {
                            instancePoolId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("maintenanceConfigurationId"))
                        {
                            maintenanceConfigurationId = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("minimalTlsVersion"))
                        {
                            minimalTlsVersion = property0.Value.GetString();
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new ManagedInstance(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags), identity.Value, sku.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(managedInstanceCreateMode), fullyQualifiedDomainName.Value, administratorLogin.Value, administratorLoginPassword.Value, subnetId.Value, state.Value, Optional.ToNullable(licenseType), Optional.ToNullable(vCores), Optional.ToNullable(storageSizeInGB), collation.Value, dnsZone.Value, dnsZonePartner.Value, Optional.ToNullable(publicDataEndpointEnabled), sourceManagedInstanceId.Value, Optional.ToNullable(restorePointInTime), Optional.ToNullable(proxyOverride), timezoneId.Value, instancePoolId.Value, maintenanceConfigurationId.Value, minimalTlsVersion.Value));
        }
Exemplo n.º 5
0
        internal static Server DeserializeServer(JsonElement element)
        {
            Optional <ResourceIdentity> identity = default;
            Optional <string>           kind     = default;
            string location = default;
            Optional <IDictionary <string, string> > tags = default;
            Optional <string> id   = default;
            Optional <string> name = default;
            Optional <string> type = default;
            Optional <string> administratorLogin         = default;
            Optional <string> administratorLoginPassword = default;
            Optional <string> version = default;
            Optional <string> state   = default;
            Optional <string> fullyQualifiedDomainName = default;
            Optional <IReadOnlyList <ServerPrivateEndpointConnection> > privateEndpointConnections = default;
            Optional <string> minimalTlsVersion = default;
            Optional <ServerPublicNetworkAccess> publicNetworkAccess = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("identity"))
                {
                    identity = ResourceIdentity.DeserializeResourceIdentity(property.Value);
                    continue;
                }
                if (property.NameEquals("kind"))
                {
                    kind = 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("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("properties"))
                {
                    foreach (var property0 in property.Value.EnumerateObject())
                    {
                        if (property0.NameEquals("administratorLogin"))
                        {
                            administratorLogin = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("administratorLoginPassword"))
                        {
                            administratorLoginPassword = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("version"))
                        {
                            version = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("state"))
                        {
                            state = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("fullyQualifiedDomainName"))
                        {
                            fullyQualifiedDomainName = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("privateEndpointConnections"))
                        {
                            List <ServerPrivateEndpointConnection> array = new List <ServerPrivateEndpointConnection>();
                            foreach (var item in property0.Value.EnumerateArray())
                            {
                                array.Add(ServerPrivateEndpointConnection.DeserializeServerPrivateEndpointConnection(item));
                            }
                            privateEndpointConnections = array;
                            continue;
                        }
                        if (property0.NameEquals("minimalTlsVersion"))
                        {
                            minimalTlsVersion = property0.Value.GetString();
                            continue;
                        }
                        if (property0.NameEquals("publicNetworkAccess"))
                        {
                            publicNetworkAccess = new ServerPublicNetworkAccess(property0.Value.GetString());
                            continue;
                        }
                    }
                    continue;
                }
            }
            return(new Server(id.Value, name.Value, type.Value, location, Optional.ToDictionary(tags), identity.Value, kind.Value, administratorLogin.Value, administratorLoginPassword.Value, version.Value, state.Value, fullyQualifiedDomainName.Value, Optional.ToList(privateEndpointConnections), minimalTlsVersion.Value, Optional.ToNullable(publicNetworkAccess)));
        }