コード例 #1
0
        public AzurePostgreSqlSection(DatastoreCredentials credentials, string databaseName, string endpoint, int portNumber, string serverName)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }
            if (databaseName == null)
            {
                throw new ArgumentNullException(nameof(databaseName));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (serverName == null)
            {
                throw new ArgumentNullException(nameof(serverName));
            }

            Credentials  = credentials;
            DatabaseName = databaseName;
            Endpoint     = endpoint;
            PortNumber   = portNumber;
            ServerName   = serverName;
        }
コード例 #2
0
        public AzureStorageSection(string accountName, string containerName, DatastoreCredentials credentials, string endpoint, string protocol)
        {
            if (accountName == null)
            {
                throw new ArgumentNullException(nameof(accountName));
            }
            if (containerName == null)
            {
                throw new ArgumentNullException(nameof(containerName));
            }
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }
            if (endpoint == null)
            {
                throw new ArgumentNullException(nameof(endpoint));
            }
            if (protocol == null)
            {
                throw new ArgumentNullException(nameof(protocol));
            }

            AccountName   = accountName;
            ContainerName = containerName;
            Credentials   = credentials;
            Endpoint      = endpoint;
            Protocol      = protocol;
        }
コード例 #3
0
 internal AzurePostgreSqlSection(bool?enableSSL, DatastoreCredentials credentials, string databaseName, string endpoint, int portNumber, string serverName)
 {
     EnableSSL    = enableSSL;
     Credentials  = credentials;
     DatabaseName = databaseName;
     Endpoint     = endpoint;
     PortNumber   = portNumber;
     ServerName   = serverName;
 }
コード例 #4
0
 internal AzureStorageSection(string accountName, int?blobCacheTimeout, string containerName, DatastoreCredentials credentials, string endpoint, string protocol)
 {
     AccountName      = accountName;
     BlobCacheTimeout = blobCacheTimeout;
     ContainerName    = containerName;
     Credentials      = credentials;
     Endpoint         = endpoint;
     Protocol         = protocol;
 }
コード例 #5
0
        public AzureDataLakeSection(DatastoreCredentials credentials, string storeName)
        {
            if (credentials == null)
            {
                throw new ArgumentNullException(nameof(credentials));
            }
            if (storeName == null)
            {
                throw new ArgumentNullException(nameof(storeName));
            }

            Credentials = credentials;
            StoreName   = storeName;
        }
コード例 #6
0
        internal static AzurePostgreSqlSection DeserializeAzurePostgreSqlSection(JsonElement element)
        {
            Optional <bool>      enableSSL   = default;
            DatastoreCredentials credentials = default;
            string databaseName = default;
            string endpoint     = default;
            int    portNumber   = default;
            string serverName   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("enableSSL"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    enableSSL = property.Value.GetBoolean();
                    continue;
                }
                if (property.NameEquals("credentials"))
                {
                    credentials = DatastoreCredentials.DeserializeDatastoreCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseName"))
                {
                    databaseName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("endpoint"))
                {
                    endpoint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("portNumber"))
                {
                    portNumber = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("serverName"))
                {
                    serverName = property.Value.GetString();
                    continue;
                }
            }
            return(new AzurePostgreSqlSection(Optional.ToNullable(enableSSL), credentials, databaseName, endpoint, portNumber, serverName));
        }
コード例 #7
0
        internal static AzureStorageSection DeserializeAzureStorageSection(JsonElement element)
        {
            string               accountName      = default;
            Optional <int>       blobCacheTimeout = default;
            string               containerName    = default;
            DatastoreCredentials credentials      = default;
            string               endpoint         = default;
            string               protocol         = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("accountName"))
                {
                    accountName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("blobCacheTimeout"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    blobCacheTimeout = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("containerName"))
                {
                    containerName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("credentials"))
                {
                    credentials = DatastoreCredentials.DeserializeDatastoreCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("endpoint"))
                {
                    endpoint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("protocol"))
                {
                    protocol = property.Value.GetString();
                    continue;
                }
            }
            return(new AzureStorageSection(accountName, Optional.ToNullable(blobCacheTimeout), containerName, credentials, endpoint, protocol));
        }
コード例 #8
0
        internal static AzureDataLakeSection DeserializeAzureDataLakeSection(JsonElement element)
        {
            DatastoreCredentials credentials = default;
            string storeName = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("credentials"))
                {
                    credentials = DatastoreCredentials.DeserializeDatastoreCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("storeName"))
                {
                    storeName = property.Value.GetString();
                    continue;
                }
            }
            return(new AzureDataLakeSection(credentials, storeName));
        }
        internal static AzureSqlDatabaseSection DeserializeAzureSqlDatabaseSection(JsonElement element)
        {
            DatastoreCredentials credentials = default;
            string databaseName = default;
            string endpoint     = default;
            int    portNumber   = default;
            string serverName   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("credentials"))
                {
                    credentials = DatastoreCredentials.DeserializeDatastoreCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("databaseName"))
                {
                    databaseName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("endpoint"))
                {
                    endpoint = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("portNumber"))
                {
                    portNumber = property.Value.GetInt32();
                    continue;
                }
                if (property.NameEquals("serverName"))
                {
                    serverName = property.Value.GetString();
                    continue;
                }
            }
            return(new AzureSqlDatabaseSection(credentials, databaseName, endpoint, portNumber, serverName));
        }