Task Description: Implement Domain and Domain Record Management Functionality
Create the necessary functionality for managing domains and their associated records in the /app/ directory. Your implementation should support both synchronous and asynchronous operations through the provided Client and AsyncClient classes. The functionality must include the following features:
Create a Domain:
A method to create a new domain that accepts a Domain object containing at least a name.
The method should return the created domain with its attributes, including name.
Read a Domain:
A method to retrieve an existing domain by its name. This should return the domain details and confirm that the time-to-live (ttl) is greater than 0 and that the zone file has a non-zero length.
List All Domains:
A method to return a list of all domains managed by the client.
Create a Domain Record:
A method to add a record to a specified domain. The record should include fields such as type, name, and data. It must return the created record's details, including a valid ID and a default ttl of 1800 seconds.
Update a Domain Record:
A method to update an existing record based on domain name and record details. It should allow changes to the record’s name and ttl attributes.
Read Domain Records:
A method to retrieve all records for a specific domain. Additionally, it should have the capability to filter records by name and type.
Delete a Domain Record:
A method to remove a specified record from a domain.
Delete a Domain:
A method to delete an existing domain.
Your implementation must ensure that all methods work correctly with the test cases provided in the given test code, passing assertions that cover various scenarios of domain and record management.