コード例 #1
0
        public DataLakeGen2SharedKeyCredential(string dataSourceCredentialName, DataLakeGen2SharedKeyParam parameters) : base(dataSourceCredentialName)
        {
            if (dataSourceCredentialName == null)
            {
                throw new ArgumentNullException(nameof(dataSourceCredentialName));
            }
            if (parameters == null)
            {
                throw new ArgumentNullException(nameof(parameters));
            }

            Parameters = parameters;
            DataSourceCredentialType = DataSourceCredentialType.DataLakeGen2SharedKey;
        }
        internal static DataLakeGen2SharedKeyCredential DeserializeDataLakeGen2SharedKeyCredential(JsonElement element)
        {
            DataLakeGen2SharedKeyParam parameters = default;
            DataSourceCredentialType   dataSourceCredentialType = default;
            Optional <Guid>            dataSourceCredentialId   = default;
            string            dataSourceCredentialName          = default;
            Optional <string> dataSourceCredentialDescription   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = DataLakeGen2SharedKeyParam.DeserializeDataLakeGen2SharedKeyParam(property.Value);
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialType"))
                {
                    dataSourceCredentialType = new DataSourceCredentialType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialId"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    dataSourceCredentialId = property.Value.GetGuid();
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialName"))
                {
                    dataSourceCredentialName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialDescription"))
                {
                    dataSourceCredentialDescription = property.Value.GetString();
                    continue;
                }
            }
            return(new DataLakeGen2SharedKeyCredential(dataSourceCredentialType, Optional.ToNullable(dataSourceCredentialId), dataSourceCredentialName, dataSourceCredentialDescription.Value, parameters));
        }
        internal static DataLakeGen2SharedKeyDatasourceCredential DeserializeDataLakeGen2SharedKeyDatasourceCredential(JsonElement element)
        {
            DataLakeGen2SharedKeyParam parameters = default;
            DataSourceCredentialType   dataSourceCredentialType = default;
            Optional <string>          dataSourceCredentialId   = default;
            string            dataSourceCredentialName          = default;
            Optional <string> dataSourceCredentialDescription   = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("parameters"))
                {
                    parameters = DataLakeGen2SharedKeyParam.DeserializeDataLakeGen2SharedKeyParam(property.Value);
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialType"))
                {
                    dataSourceCredentialType = new DataSourceCredentialType(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialId"))
                {
                    dataSourceCredentialId = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialName"))
                {
                    dataSourceCredentialName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("dataSourceCredentialDescription"))
                {
                    dataSourceCredentialDescription = property.Value.GetString();
                    continue;
                }
            }
            return(new DataLakeGen2SharedKeyDatasourceCredential(dataSourceCredentialType, dataSourceCredentialId.Value, dataSourceCredentialName, dataSourceCredentialDescription.Value, parameters));
        }
コード例 #4
0
 internal DataLakeGen2SharedKeyCredential(DataSourceCredentialType dataSourceCredentialType, Guid?dataSourceCredentialId, string dataSourceCredentialName, string dataSourceCredentialDescription, DataLakeGen2SharedKeyParam parameters) : base(dataSourceCredentialType, dataSourceCredentialId, dataSourceCredentialName, dataSourceCredentialDescription)
 {
     Parameters = parameters;
     DataSourceCredentialType = dataSourceCredentialType;
 }
コード例 #5
0
        /// <summary>
        /// Initializes a new instance of <see cref="Administration.DataLakeSharedKeyCredentialEntity"/> for mocking purposes.
        /// </summary>
        /// <param name="id">Sets the <see cref="DataSourceCredentialEntity.Id"/> property.</param>
        /// <param name="name">Sets the <see cref="DataSourceCredentialEntity.Name"/> property.</param>
        /// <param name="description">Sets the <see cref="DataSourceCredentialEntity.Description"/> property.</param>
        /// <param name="accountKey">Sets the account key. This secret is not exposed in a property.</param>
        /// <returns>A new instance of <see cref="Administration.DataLakeSharedKeyCredentialEntity"/> for mocking purposes.</returns>
        public static DataLakeSharedKeyCredentialEntity DataLakeSharedKeyCredentialEntity(string id = null, string name = null, string description = null, string accountKey = null)
        {
            DataLakeGen2SharedKeyParam parameters = new DataLakeGen2SharedKeyParam(accountKey);

            return(new DataLakeSharedKeyCredentialEntity(DataSourceCredentialKind.DataLakeSharedKey, id, name, description, parameters));
        }
コード例 #6
0
 internal DataLakeGen2SharedKeyDatasourceCredential(DataSourceCredentialType dataSourceCredentialType, string id, string name, string description, DataLakeGen2SharedKeyParam parameters)
     : base(dataSourceCredentialType, id, name, description)
 {
     DataSourceCredentialType = dataSourceCredentialType;
     AccountKey = parameters.AccountKey;
 }