Files
CloudflareDNS-java/src/main/java/codes/thischwa/cf/fluent/ZoneOperationsImpl.java
T
thischwaandgitea-actions-bot 8515f81621
Build and Analyse / build-and-analyse (push) Successful in 1m20s
ai review (#1)
Co-authored-by: gitea-actions-bot <bot@mein-gateway.de>
Reviewed-on: #1
Co-authored-by: Thilo Schwarz <osp@thischwa.codes>
2026-11-06 14:28:06 +01:00

45 lines
1.4 KiB
Java

package codes.thischwa.cf.fluent;
import codes.thischwa.cf.CfDnsClient;
import codes.thischwa.cf.CloudflareApiException;
import codes.thischwa.cf.model.RecordEntity;
import codes.thischwa.cf.model.RecordType;
import codes.thischwa.cf.model.ZoneEntity;
import java.util.List;
import org.jetbrains.annotations.Nullable;
/**
* Implementation of ZoneOperations for fluent API access to zone-level operations.
*/
public class ZoneOperationsImpl implements ZoneOperations {
private final CfDnsClient client;
private final ZoneEntity zone;
/**
* Constructs a ZoneOperationsImpl instance.
*
* @param client the CfDnsClient instance to use for operations
* @param zone the ZoneEntity representing the DNS zone
*/
public ZoneOperationsImpl(CfDnsClient client, ZoneEntity zone) {
this.client = client;
this.zone = zone;
}
@Override
public RecordOperations getRecord(String subdomain) throws CloudflareApiException {
return new RecordOperationsImpl(client, zone, subdomain, null);
}
@Override
public RecordOperations getRecord(String subdomain, @Nullable RecordType... types) throws CloudflareApiException {
return new RecordOperationsImpl(client, zone, subdomain, types);
}
@Override
public List<RecordEntity> list(@Nullable RecordType... types) throws CloudflareApiException {
return client.recordListByType(zone, types);
}
}