Example #1
0
        internal static SearchResourceEncryptionKey DeserializeSearchResourceEncryptionKey(JsonElement element)
        {
            string keyVaultKeyName    = default;
            string keyVaultKeyVersion = default;
            string keyVaultUri        = default;
            Optional <AzureActiveDirectoryApplicationCredentials> accessCredentials = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("keyVaultKeyName"))
                {
                    keyVaultKeyName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("keyVaultKeyVersion"))
                {
                    keyVaultKeyVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("keyVaultUri"))
                {
                    keyVaultUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("accessCredentials"))
                {
                    accessCredentials = AzureActiveDirectoryApplicationCredentials.DeserializeAzureActiveDirectoryApplicationCredentials(property.Value);
                    continue;
                }
            }
            return(new SearchResourceEncryptionKey(keyVaultKeyName, keyVaultKeyVersion, keyVaultUri, accessCredentials.Value));
        }
 internal SearchResourceEncryptionKey(string keyName, string keyVersion, string VaultUri, AzureActiveDirectoryApplicationCredentials accessCredentialsInternal)
 {
     KeyName    = keyName;
     KeyVersion = keyVersion;
     _vaultUri  = VaultUri;
     AccessCredentialsInternal = accessCredentialsInternal;
 }
 internal SearchResourceEncryptionKey(string keyName, string keyVersion, string vaultUri, AzureActiveDirectoryApplicationCredentials accessCredentialsInternal, SearchIndexerDataIdentity identity)
 {
     KeyName    = keyName;
     KeyVersion = keyVersion;
     _vaultUri  = vaultUri;
     AccessCredentialsInternal = accessCredentialsInternal;
     Identity = identity;
 }
        internal static SearchResourceEncryptionKey DeserializeSearchResourceEncryptionKey(JsonElement element)
        {
            string keyVaultKeyName    = default;
            string keyVaultKeyVersion = default;
            string keyVaultUri        = default;
            Optional <AzureActiveDirectoryApplicationCredentials> accessCredentials = default;
            Optional <SearchIndexerDataIdentity> identity = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("keyVaultKeyName"))
                {
                    keyVaultKeyName = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("keyVaultKeyVersion"))
                {
                    keyVaultKeyVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("keyVaultUri"))
                {
                    keyVaultUri = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("accessCredentials"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        property.ThrowNonNullablePropertyIsNull();
                        continue;
                    }
                    accessCredentials = AzureActiveDirectoryApplicationCredentials.DeserializeAzureActiveDirectoryApplicationCredentials(property.Value);
                    continue;
                }
                if (property.NameEquals("identity"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        identity = null;
                        continue;
                    }
                    identity = SearchIndexerDataIdentity.DeserializeSearchIndexerDataIdentity(property.Value);
                    continue;
                }
            }
            return(new SearchResourceEncryptionKey(keyVaultKeyName, keyVaultKeyVersion, keyVaultUri, accessCredentials.Value, identity.Value));
        }