Add Javadoc generation scripts and enhance README examples
Introduce Javadoc-related files (`javadoc.sh`, `options`, and `packages`) for API documentation generation. Update README to improve clarity on usage examples and remove redundant "Example" headings for a cleaner presentation.
This commit is contained in:
@@ -27,14 +27,22 @@ BETA
|
|||||||
|
|
||||||
## Methods Overview
|
## Methods Overview
|
||||||
|
|
||||||
### 1. `zoneListAll`
|
The following text focuses on the basic methods. For further information take a look at the [javadoc of the CfDnsClient](docs/apidocs/codes/thischwa/cf/CfDnsClient.html).
|
||||||
|
|
||||||
|
### Instantiation of `CfDnsClient`
|
||||||
|
|
||||||
|
```java
|
||||||
|
CfDnsClient client = new CfDnsClient(
|
||||||
|
"email@example.com", "yourApiKey", "yourApiToken"
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
### `zoneListAll`
|
||||||
|
|
||||||
Retrieve all zones within the Cloudflare account.
|
Retrieve all zones within the Cloudflare account.
|
||||||
|
|
||||||
- **Returns**: A list of `ZoneEntity` objects.
|
- **Returns**: A list of `ZoneEntity` objects.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
List<ZoneEntity> zones = cfDnsClient.zoneListAll();
|
List<ZoneEntity> zones = cfDnsClient.zoneListAll();
|
||||||
zones.forEach(zone -> System.out.println("Zone: " + zone.getName()));
|
zones.forEach(zone -> System.out.println("Zone: " + zone.getName()));
|
||||||
@@ -42,7 +50,7 @@ zones.forEach(zone -> System.out.println("Zone: " + zone.getName()));
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 2. `zoneInfo`
|
### `zoneInfo`
|
||||||
|
|
||||||
Get detailed information about a specific zone by its name.
|
Get detailed information about a specific zone by its name.
|
||||||
|
|
||||||
@@ -50,8 +58,6 @@ Get detailed information about a specific zone by its name.
|
|||||||
- `String name` - The zone name (e.g., "example.com").
|
- `String name` - The zone name (e.g., "example.com").
|
||||||
- **Returns**: A `ZoneEntity` object.
|
- **Returns**: A `ZoneEntity` object.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
ZoneEntity zone = cfDnsClient.zoneInfo("example.com");
|
ZoneEntity zone = cfDnsClient.zoneInfo("example.com");
|
||||||
System.out.println("Zone ID: " + zone.getId());
|
System.out.println("Zone ID: " + zone.getId());
|
||||||
@@ -59,7 +65,7 @@ System.out.println("Zone ID: " + zone.getId());
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 3. `sldListAll`
|
### `sldListAll`
|
||||||
|
|
||||||
Retrieve all records for a specific second-level domain (SLD) under a given zone.
|
Retrieve all records for a specific second-level domain (SLD) under a given zone.
|
||||||
|
|
||||||
@@ -68,8 +74,6 @@ Retrieve all records for a specific second-level domain (SLD) under a given zone
|
|||||||
- `String sld` - Second-level domain (e.g., "www" in "www.example.com").
|
- `String sld` - Second-level domain (e.g., "www" in "www.example.com").
|
||||||
- **Returns**: A list of `RecordEntity` objects.
|
- **Returns**: A list of `RecordEntity` objects.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
List<RecordEntity> records = cfDnsClient.sldListAll(zone, "sld");
|
List<RecordEntity> records = cfDnsClient.sldListAll(zone, "sld");
|
||||||
records.forEach(record ->
|
records.forEach(record ->
|
||||||
@@ -79,7 +83,7 @@ records.forEach(record ->
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 4. `sldInfo`
|
### `sldInfo`
|
||||||
|
|
||||||
Retrieve DNS record details for a specific SLD, zone, and record type.
|
Retrieve DNS record details for a specific SLD, zone, and record type.
|
||||||
|
|
||||||
@@ -88,8 +92,6 @@ Retrieve DNS record details for a specific SLD, zone, and record type.
|
|||||||
- `String sld` - The second-level domain.
|
- `String sld` - The second-level domain.
|
||||||
- `RecordType type` - Record type (e.g., A, CNAME).
|
- `RecordType type` - Record type (e.g., A, CNAME).
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
RecordEntity record = cfDnsClient.sldInfo(zone, "www", RecordType.A);
|
RecordEntity record = cfDnsClient.sldInfo(zone, "www", RecordType.A);
|
||||||
System.out.println("Record IP: " + record.getContent());
|
System.out.println("Record IP: " + record.getContent());
|
||||||
@@ -97,7 +99,7 @@ System.out.println("Record IP: " + record.getContent());
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 5. `recordCreate`
|
### `recordCreate`
|
||||||
|
|
||||||
Create a new DNS record in a specific zone.
|
Create a new DNS record in a specific zone.
|
||||||
|
|
||||||
@@ -105,8 +107,6 @@ Create a new DNS record in a specific zone.
|
|||||||
- `ZoneEntity zone` - DNS zone object.
|
- `ZoneEntity zone` - DNS zone object.
|
||||||
- `RecordEntity rec` - Details of the new record (name, type, content).
|
- `RecordEntity rec` - Details of the new record (name, type, content).
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
RecordEntity newRecord = new RecordEntity("api.example.com", RecordType.A, "192.168.1.1");
|
RecordEntity newRecord = new RecordEntity("api.example.com", RecordType.A, "192.168.1.1");
|
||||||
RecordEntity created = cfDnsClient.recordCreate(zone, newRecord);
|
RecordEntity created = cfDnsClient.recordCreate(zone, newRecord);
|
||||||
@@ -115,7 +115,7 @@ System.out.println("Created Record ID: " + created.getId());
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 6. `recordUpdate`
|
### `recordUpdate`
|
||||||
|
|
||||||
Update an existing DNS record.
|
Update an existing DNS record.
|
||||||
|
|
||||||
@@ -123,8 +123,6 @@ Update an existing DNS record.
|
|||||||
- `ZoneEntity zone` - The zone that contains the record.
|
- `ZoneEntity zone` - The zone that contains the record.
|
||||||
- `RecordEntity rec` - Updated record data.
|
- `RecordEntity rec` - Updated record data.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
record.setContent("192.168.1.2");
|
record.setContent("192.168.1.2");
|
||||||
RecordEntity updated = cfDnsClient.recordUpdate(zone, record);
|
RecordEntity updated = cfDnsClient.recordUpdate(zone, record);
|
||||||
@@ -133,7 +131,7 @@ System.out.println("Updated Record: " + updated.getContent());
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 7. `recordDelete`
|
### `recordDelete`
|
||||||
|
|
||||||
Delete a DNS record from a zone.
|
Delete a DNS record from a zone.
|
||||||
|
|
||||||
@@ -141,8 +139,6 @@ Delete a DNS record from a zone.
|
|||||||
- `ZoneEntity zone` - The parent zone.
|
- `ZoneEntity zone` - The parent zone.
|
||||||
- `RecordEntity rec` - Record to delete.
|
- `RecordEntity rec` - Record to delete.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
boolean isDeleted = cfDnsClient.recordDelete(zone, record);
|
boolean isDeleted = cfDnsClient.recordDelete(zone, record);
|
||||||
System.out.println(isDeleted ? "Deletion successful." : "Deletion failed.");
|
System.out.println(isDeleted ? "Deletion successful." : "Deletion failed.");
|
||||||
@@ -150,7 +146,7 @@ System.out.println(isDeleted ? "Deletion successful." : "Deletion failed.");
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
### 8. `recordDeleteTypeIfExists`
|
### `recordDeleteTypeIfExists`
|
||||||
|
|
||||||
Delete a DNS record of a specific type if it exists.
|
Delete a DNS record of a specific type if it exists.
|
||||||
|
|
||||||
@@ -159,8 +155,6 @@ Delete a DNS record of a specific type if it exists.
|
|||||||
- `String sld` - Second-level domain.
|
- `String sld` - Second-level domain.
|
||||||
- `RecordType type` - Record type.
|
- `RecordType type` - Record type.
|
||||||
|
|
||||||
**Example:**
|
|
||||||
|
|
||||||
```java
|
```java
|
||||||
cfDnsClient.recordDeleteTypeIfExists(zone, "api", RecordType.A);
|
cfDnsClient.recordDeleteTypeIfExists(zone, "api", RecordType.A);
|
||||||
System.out.println("Deletion attempt completed.");
|
System.out.println("Deletion attempt completed.");
|
||||||
|
|||||||
Executable
+1
@@ -0,0 +1 @@
|
|||||||
|
/Users/thilo/.sdkman/candidates/java/21.0.4-amzn/bin/javadoc @options @packages
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
-classpath
|
||||||
|
'/Users/thilo/.m2/repository/org/apache/httpcomponents/client5/httpclient5/5.4.2/httpclient5-5.4.2.jar:/Users/thilo/.m2/repository/org/apache/httpcomponents/core5/httpcore5/5.3.3/httpcore5-5.3.3.jar:/Users/thilo/.m2/repository/org/apache/httpcomponents/core5/httpcore5-h2/5.3.3/httpcore5-h2-5.3.3.jar:/Users/thilo/.m2/repository/org/slf4j/slf4j-api/1.7.36/slf4j-api-1.7.36.jar:/Users/thilo/.m2/repository/org/projectlombok/lombok/1.18.36/lombok-1.18.36.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.18.2/jackson-databind-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.18.2/jackson-annotations-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.18.2/jackson-core-2.18.2.jar:/Users/thilo/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.18.2/jackson-datatype-jsr310-2.18.2.jar:/Users/thilo/.m2/repository/ch/qos/logback/logback-classic/1.5.12/logback-classic-1.5.12.jar:/Users/thilo/.m2/repository/ch/qos/logback/logback-core/1.5.12/logback-core-1.5.12.jar:/Users/thilo/.m2/repository/org/jetbrains/annotations/24.0.0/annotations-24.0.0.jar'
|
||||||
|
-encoding
|
||||||
|
'UTF-8'
|
||||||
|
-protected
|
||||||
|
-source
|
||||||
|
'17'
|
||||||
|
-sourcepath
|
||||||
|
'/Users/thilo/development/java/CloudflareDNS-java/src/main/java'
|
||||||
|
-author
|
||||||
|
-bottom
|
||||||
|
'Copyright © 2025. All rights reserved.'
|
||||||
|
-charset
|
||||||
|
'UTF-8'
|
||||||
|
-d
|
||||||
|
'/Users/thilo/development/java/CloudflareDNS-java/docs/apidocs'
|
||||||
|
-docencoding
|
||||||
|
'UTF-8'
|
||||||
|
-doctitle
|
||||||
|
'CloudflareDNS-java 0.1.0-SNAPSHOT API'
|
||||||
|
-use
|
||||||
|
-version
|
||||||
|
-windowtitle
|
||||||
|
'CloudflareDNS-java 0.1.0-SNAPSHOT API'
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
codes.thischwa.cf
|
||||||
|
codes.thischwa.cf.model
|
||||||
Reference in New Issue
Block a user