Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[In Progress] DNS fluent implementation #1258

Closed
wants to merge 8 commits into from
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
package com.microsoft.azure.management.dns;

import com.microsoft.azure.management.resources.fluentcore.arm.models.HasTags;
import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
import com.microsoft.azure.management.resources.fluentcore.model.Creatable;

import java.util.List;

/**
* An immutable client-side representation of a A (Ipv4) record set in Azure Dns Zone.
*/
public interface ARecordSet extends DnsRecordSet<ARecordSet, DnsZone> {
/**
* @return the Ipv4 addresses of A records in this record set
*/
List<String> ipv4Addresses();

/**
* The entirety of the A record set definition.
*/
interface Definition extends
DefinitionStages.Blank,
DefinitionStages.WithCreate {
}

/**
* Grouping of A record set definition stages.
*/
interface DefinitionStages {
/**
* The first stage of an A record set definition.
*/
interface Blank extends WithIpv4Address {
}

/**
* The stage of the A record set definition allowing to add a record.
*/
interface WithIpv4Address {
/**
* Creates an A record with the provided Ipv4 address in this record set.
*
* @param ipv4Address the Ipv4 address
* @return the next stage of the record set definition
*/
WithCreate withIpv4Address(String ipv4Address);
}

/**
* The stage of the record set definition allowing to specify Ttl for the records in this record set.
*/
interface WithTtl {
/**
* Specifies the Ttl for the records in the record set.
*
* @param ttlInSeconds ttl in seconds
* @return the next stage of the record set definition
*/
WithCreate withTimeToLive(long ttlInSeconds);
}

/**
* The stage of the definition which contains all the minimum required inputs for
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends
Creatable<ARecordSet>,
HasTags.DefinitionWithTags<WithCreate>,
DefinitionStages.WithTtl {
}
}

/**
* Grouping of A record set update stages.
*/
interface UpdateStages {
/**
* The stage of the Aaaa record set update allowing to add or remove a record.
*/
interface WithIpv4Address {
/**
* Creates an A record with the provided Ipv4 address in this record set.
*
* @param ipv4Address the Ipv4 address
* @return the next stage of the record set update
*/
Update withIpv4Address(String ipv4Address);

/**
* Removes an A record with the provided Ipv4 address from this record set.
*
* @param ipv4Address the Ipv4 address
* @return the next stage of the record set update
*/
Update withoutIpv4Address(String ipv4Address);
}

/**
* The stage of the record set update allowing to specify Ttl for the records in this record set.
*/
interface WithTtl {
/**
* Specifies the Ttl for the records in the record set.
*
* @param ttlInSeconds ttl in seconds
* @return the next stage of the record set update
*/
Update withTimeToLive(long ttlInSeconds);
}
}

/**
* The template for an update operation, containing all the settings that
* can be modified.
* <p>
* Call {@link Update#apply()} to apply the changes to the resource in Azure.
*/
interface Update extends
Appliable<ARecordSet>,
HasTags.UpdateWithTags<Update>,
UpdateStages.WithIpv4Address,
UpdateStages.WithTtl {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.microsoft.azure.management.dns;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;

/**
* Entry point to Dns zone A record set management API.
*/
@Fluent
public interface ARecordSets extends
DnsRecordSets<ARecordSet>,
SupportsListing<ARecordSet>,
SupportsGettingByName<ARecordSet>,
SupportsGettingById<ARecordSet>,
SupportsCreating<ARecordSet.DefinitionStages.Blank>,
SupportsDeletingById {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
package com.microsoft.azure.management.dns;

import com.microsoft.azure.management.resources.fluentcore.arm.models.HasTags;
import com.microsoft.azure.management.resources.fluentcore.model.Appliable;
import com.microsoft.azure.management.resources.fluentcore.model.Creatable;

import java.util.List;

/**
* An immutable client-side representation of a Aaaa (Ipv6) record set in Azure Dns Zone.
*/
public interface AaaaRecordSet extends DnsRecordSet<AaaaRecordSet, DnsZone> {
/**
* @return the IPv6 addresses of Aaaa records in this record set
*/
List<String> ipv6Addresses();

/**
* The entirety of the Aaaa record set definition.
*/
interface Definition extends
DefinitionStages.Blank,
DefinitionStages.WithIpv6Address,
DefinitionStages.WithCreate {
}

/**
* Grouping of Aaaa record set definition stages.
*/
interface DefinitionStages {
/**
* The first stage of a Aaaa record set definition.
*/
interface Blank extends WithIpv6Address {
}

/**
* The stage of the Aaaa record set definition allowing to add a record.
*/
interface WithIpv6Address {
/**
* Creates an Aaaa record with the provided Ipv6 address in this record set.
*
* @param ipv6Address the Ipv6 address
* @return the next stage of the record set definition
*/
WithCreate withIpv6Address(String ipv6Address);
}

/**
* The stage of the record set definition allowing to specify Ttl for the records in this record set.
*/
interface WithTtl {
/**
* Specifies the Ttl for the records in the record set.
*
* @param ttlInSeconds ttl in seconds
* @return the next stage of the record set definition
*/
WithCreate withTimeToLive(long ttlInSeconds);
}

/**
* The stage of the definition which contains all the minimum required inputs for
* the resource to be created (via {@link WithCreate#create()}), but also allows
* for any other optional settings to be specified.
*/
interface WithCreate extends
Creatable<AaaaRecordSet>,
HasTags.DefinitionWithTags<WithCreate>,
DefinitionStages.WithIpv6Address,
DefinitionStages.WithTtl {
}
}

/**
* Grouping of Aaaa record set update stages.
*/
interface UpdateStages {
/**
* The stage of the Aaaa record set update allowing to add or remove a record.
*/
interface WithIpv6Address {
/**
* Creates an Aaaa record with the provided Ipv6 address in this record set.
*
* @param ipv6Address the Ipv6 address
* @return the next stage of the record set update
*/
Update withIpv6Address(String ipv6Address);

/**
* Removes an Aaaa record with the provided Ipv6 address from this record set.
*
* @param ipv6Address the Ipv6 address
* @return the next stage of the record set update
*/
Update withoutIpv6Address(String ipv6Address);
}

/**
* The stage of the record set update allowing to specify Ttl for the records in this record set.
*/
interface WithTtl {
/**
* Specifies the Ttl for the records in the record set.
*
* @param ttlInSeconds ttl in seconds
* @return the next stage of the record set update
*/
Update withTimeToLive(long ttlInSeconds);
}
}

/**
* The template for an update operation, containing all the settings that
* can be modified.
* <p>
* Call {@link Update#apply()} to apply the changes to the resource in Azure.
*/
interface Update extends
Appliable<AaaaRecordSet>,
HasTags.UpdateWithTags<Update>,
UpdateStages.WithIpv6Address,
UpdateStages.WithTtl {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.microsoft.azure.management.dns;

import com.microsoft.azure.management.apigeneration.Fluent;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingById;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.SupportsGettingByName;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsCreating;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsDeletingById;
import com.microsoft.azure.management.resources.fluentcore.collection.SupportsListing;

/**
* Entry point to Dns zone Aaaa record set management API.
*/
@Fluent
public interface AaaaRecordSets extends
DnsRecordSets<AaaaRecordSet>,
SupportsListing<AaaaRecordSet>,
SupportsGettingByName<AaaaRecordSet>,
SupportsGettingById<AaaaRecordSet>,
SupportsCreating<AaaaRecordSet.DefinitionStages.Blank>,
SupportsDeletingById {
}
Loading