From cc1777af0c57ad3bad432e477cd4954f5e7e6925 Mon Sep 17 00:00:00 2001 From: sarahcaseybot Date: Tue, 3 Oct 2023 13:46:19 -0400 Subject: [PATCH] Add custom YAML serializer for Duration (#2161) * Add custom YAML serializer for Duration This addresses b/301119144. This changes the YAML representation of a TLD to show Duration fields as a String reperesntation using the Java Duration object's toString() format. This eliminates the previous ambiguity over the time unit that is being used for each duration. * change standardSeconds to standardMinutes in test * Add custom serializer to the entire mapper --- .../registry/model/EntityYamlUtils.java | 26 ++++++++++++++++--- .../registry/tools/GetTldCommandTest.java | 2 +- .../google/registry/model/tld/tld.yaml | 18 ++++++------- .../resources/google/registry/tools/1tld.yaml | 18 ++++++------- .../google/registry/tools/badidn.yaml | 18 ++++++------- .../google/registry/tools/badunicode.yaml | 18 ++++++------- .../google/registry/tools/extrafield.yaml | 18 ++++++------- .../resources/google/registry/tools/idns.yaml | 16 ++++++------ .../registry/tools/missingnullablefields.yaml | 16 ++++++------ .../registry/tools/nullablefieldsallnull.yaml | 16 ++++++------ .../registry/tools/outoforderfields.yaml | 18 ++++++------- .../resources/google/registry/tools/tld.yaml | 18 ++++++------- .../google/registry/tools/wildcard.yaml | 18 ++++++------- 13 files changed, 119 insertions(+), 101 deletions(-) diff --git a/core/src/main/java/google/registry/model/EntityYamlUtils.java b/core/src/main/java/google/registry/model/EntityYamlUtils.java index 576d48009..9e226d918 100644 --- a/core/src/main/java/google/registry/model/EntityYamlUtils.java +++ b/core/src/main/java/google/registry/model/EntityYamlUtils.java @@ -58,13 +58,13 @@ public class EntityYamlUtils { SimpleModule module = new SimpleModule(); module.addSerializer(Money.class, new MoneySerializer()); module.addDeserializer(Money.class, new MoneyDeserializer()); + module.addSerializer(Duration.class, new DurationSerializer()); ObjectMapper mapper = JsonMapper.builder(new YAMLFactory().disable(Feature.WRITE_DOC_START_MARKER)) .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) .enable(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY) - .build() - .registerModule(module); - mapper.findAndRegisterModules(); + .build(); + mapper.findAndRegisterModules().registerModule(module); return mapper; } @@ -201,6 +201,24 @@ public class EntityYamlUtils { } } + /** A custom JSON serializer for a {@link Duration} object. */ + public static class DurationSerializer extends StdSerializer { + + public DurationSerializer() { + this(null); + } + + public DurationSerializer(Class t) { + super(t); + } + + @Override + public void serialize(Duration value, JsonGenerator gen, SerializerProvider provider) + throws IOException { + gen.writeString(value.toString()); + } + } + /** A custom JSON serializer for an Optional of a {@link Duration} object. */ public static class OptionalDurationSerializer extends StdSerializer> { @@ -216,7 +234,7 @@ public class EntityYamlUtils { public void serialize(Optional value, JsonGenerator gen, SerializerProvider provider) throws IOException { if (value.isPresent()) { - gen.writeNumber(value.get().getMillis()); + gen.writeString(value.get().toString()); } else { gen.writeNull(); } diff --git a/core/src/test/java/google/registry/tools/GetTldCommandTest.java b/core/src/test/java/google/registry/tools/GetTldCommandTest.java index 2d41d9123..e9873fcd4 100644 --- a/core/src/test/java/google/registry/tools/GetTldCommandTest.java +++ b/core/src/test/java/google/registry/tools/GetTldCommandTest.java @@ -45,7 +45,7 @@ class GetTldCommandTest extends CommandTestCase { PremiumList premiumList = persistPremiumList("test", USD, "silver,USD 50", "gold,USD 80"); persistResource( tld.asBuilder() - .setDnsAPlusAaaaTtl(Duration.millis(900)) + .setDnsAPlusAaaaTtl(Duration.standardMinutes(15)) .setDriveFolderId("driveFolder") .setCreateBillingCost(Money.of(USD, 25)) .setPremiumList(premiumList) diff --git a/core/src/test/resources/google/registry/model/tld/tld.yaml b/core/src/test/resources/google/registry/model/tld/tld.yaml index f17cfe4e2..6d8b2d824 100644 --- a/core/src/test/resources/google/registry/model/tld/tld.yaml +++ b/core/src/test/resources/google/registry/model/tld/tld.yaml @@ -1,10 +1,10 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT432000S" allowedFullyQualifiedHostNames: - "foo" allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT3888000S" +automaticTransferLength: "PT432000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -13,7 +13,7 @@ creationTime: "1970-01-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: - "bbbbb" -dnsAPlusAaaaTtl: 3600000 +dnsAPlusAaaaTtl: "PT3600S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -38,10 +38,10 @@ idnTables: invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT432000S" premiumListName: "tld" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -49,7 +49,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT432000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -63,4 +63,4 @@ tldStateTransitions: tldStr: "tld" tldType: "REAL" tldUnicode: "tld" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT432000S" diff --git a/core/src/test/resources/google/registry/tools/1tld.yaml b/core/src/test/resources/google/registry/tools/1tld.yaml index 25c45be38..1604bc7fd 100644 --- a/core/src/test/resources/google/registry/tools/1tld.yaml +++ b/core/src/test/resources/google/registry/tools/1tld.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT2592000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -27,10 +27,10 @@ idnTables: [] invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT2592000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -38,7 +38,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT2592000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -52,4 +52,4 @@ tldStateTransitions: tldStr: "1tld" tldType: "REAL" tldUnicode: "1tld" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT2592000S" diff --git a/core/src/test/resources/google/registry/tools/badidn.yaml b/core/src/test/resources/google/registry/tools/badidn.yaml index 30bac2e33..db173661b 100644 --- a/core/src/test/resources/google/registry/tools/badidn.yaml +++ b/core/src/test/resources/google/registry/tools/badidn.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT2592000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -28,10 +28,10 @@ idnTables: invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT2592000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -39,7 +39,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT2592000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -53,4 +53,4 @@ tldStateTransitions: tldStr: "badidn" tldType: "REAL" tldUnicode: "badidn" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT2592000S" diff --git a/core/src/test/resources/google/registry/tools/badunicode.yaml b/core/src/test/resources/google/registry/tools/badunicode.yaml index 686b9b011..beaf26014 100644 --- a/core/src/test/resources/google/registry/tools/badunicode.yaml +++ b/core/src/test/resources/google/registry/tools/badunicode.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT2592000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -27,10 +27,10 @@ idnTables: [] invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT2592000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -38,7 +38,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT2592000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -52,4 +52,4 @@ tldStateTransitions: tldStr: "badunicode" tldType: "REAL" tldUnicode: "tld" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT2592000S" diff --git a/core/src/test/resources/google/registry/tools/extrafield.yaml b/core/src/test/resources/google/registry/tools/extrafield.yaml index af3c54b0a..fb945c786 100644 --- a/core/src/test/resources/google/registry/tools/extrafield.yaml +++ b/core/src/test/resources/google/registry/tools/extrafield.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT2592000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -27,10 +27,10 @@ idnTables: [] invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT2592000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -38,7 +38,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT2592000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -52,5 +52,5 @@ tldStateTransitions: tldStr: "extrafield" tldType: "REAL" tldUnicode: "extrafield" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT2592000S" extraField: "hello" diff --git a/core/src/test/resources/google/registry/tools/idns.yaml b/core/src/test/resources/google/registry/tools/idns.yaml index 51186c30a..e58e9a488 100644 --- a/core/src/test/resources/google/registry/tools/idns.yaml +++ b/core/src/test/resources/google/registry/tools/idns.yaml @@ -1,13 +1,13 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT432000S" allowedFullyQualifiedHostNames: - "beta" - "zeta" - "alpha" - "gamma" allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT3888000S" +automaticTransferLength: "PT432000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -34,10 +34,10 @@ idnTables: invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT432000S" premiumListName: "idns" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -45,7 +45,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT432000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -59,4 +59,4 @@ tldStateTransitions: tldStr: "idns" tldType: "REAL" tldUnicode: "idns" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT432000S" diff --git a/core/src/test/resources/google/registry/tools/missingnullablefields.yaml b/core/src/test/resources/google/registry/tools/missingnullablefields.yaml index 7425c6c72..73a825af7 100644 --- a/core/src/test/resources/google/registry/tools/missingnullablefields.yaml +++ b/core/src/test/resources/google/registry/tools/missingnullablefields.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT2592000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -automaticTransferLength: 432000000 -autoRenewGracePeriodLength: 3888000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -25,9 +25,9 @@ escrowEnabled: false idnTables: [] invoicingEnabled: false lordnUsername: null -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT2592000S" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -35,7 +35,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT2592000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -47,4 +47,4 @@ serverStatusChangeBillingCost: tldStr: "missingnullablefields" tldType: "REAL" tldUnicode: "missingnullablefields" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT2592000S" diff --git a/core/src/test/resources/google/registry/tools/nullablefieldsallnull.yaml b/core/src/test/resources/google/registry/tools/nullablefieldsallnull.yaml index 3bb75a8d1..675aad65f 100644 --- a/core/src/test/resources/google/registry/tools/nullablefieldsallnull.yaml +++ b/core/src/test/resources/google/registry/tools/nullablefieldsallnull.yaml @@ -18,14 +18,14 @@ reservedListNames: null premiumListName: null escrowEnabled: false dnsPaused: false -addGracePeriodLength: 432000000 -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -redemptionGracePeriodLength: 2592000000 -renewGracePeriodLength: 432000000 -transferGracePeriodLength: 432000000 -automaticTransferLength: 432000000 -pendingDeleteLength: 432000000 +addGracePeriodLength: "PT2592000S" +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +redemptionGracePeriodLength: "PT2592000S" +renewGracePeriodLength: "PT2592000S" +transferGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" +pendingDeleteLength: "PT2592000S" currency: "USD" createBillingCost: currency: "USD" diff --git a/core/src/test/resources/google/registry/tools/outoforderfields.yaml b/core/src/test/resources/google/registry/tools/outoforderfields.yaml index c110d0500..e7e505154 100644 --- a/core/src/test/resources/google/registry/tools/outoforderfields.yaml +++ b/core/src/test/resources/google/registry/tools/outoforderfields.yaml @@ -5,13 +5,13 @@ reservedListNames: [] dnsPaused: false tldType: "REAL" escrowEnabled: false -anchorTenantAddGracePeriodLength: 2592000000 +anchorTenantAddGracePeriodLength: "PT2592000S" dnsNsTtl: null tldStr: "outoforderfields" roidSuffix: "TLD" dnsWriters: - "VoidDnsWriter" -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null tldUnicode: "outoforderfields" driveFolderId: "driveFolder" @@ -19,13 +19,13 @@ invoicingEnabled: false tldStateTransitions: "1970-01-01T00:00:00.000Z": "GENERAL_AVAILABILITY" premiumListName: "test" -addGracePeriodLength: 432000000 -autoRenewGracePeriodLength: 3888000000 -redemptionGracePeriodLength: 2592000000 -renewGracePeriodLength: 432000000 -transferGracePeriodLength: 432000000 -automaticTransferLength: 432000000 -pendingDeleteLength: 432000000 +addGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT2592000S" +redemptionGracePeriodLength: "PT2592000S" +renewGracePeriodLength: "PT2592000S" +transferGracePeriodLength: "PT2592000S" +automaticTransferLength: "PT2592000S" +pendingDeleteLength: "PT2592000S" currency: "USD" createBillingCost: currency: "USD" diff --git a/core/src/test/resources/google/registry/tools/tld.yaml b/core/src/test/resources/google/registry/tools/tld.yaml index 62363325b..71934a723 100644 --- a/core/src/test/resources/google/registry/tools/tld.yaml +++ b/core/src/test/resources/google/registry/tools/tld.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT432000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT3888000S" +automaticTransferLength: "PT432000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -27,10 +27,10 @@ idnTables: [] invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT432000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -38,7 +38,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT432000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -52,4 +52,4 @@ tldStateTransitions: tldStr: "tld" tldType: "REAL" tldUnicode: "tld" -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT432000S" diff --git a/core/src/test/resources/google/registry/tools/wildcard.yaml b/core/src/test/resources/google/registry/tools/wildcard.yaml index 854ad0800..a9900e165 100644 --- a/core/src/test/resources/google/registry/tools/wildcard.yaml +++ b/core/src/test/resources/google/registry/tools/wildcard.yaml @@ -1,9 +1,9 @@ -addGracePeriodLength: 432000000 +addGracePeriodLength: "PT432000S" allowedFullyQualifiedHostNames: [] allowedRegistrantContactIds: [] -anchorTenantAddGracePeriodLength: 2592000000 -autoRenewGracePeriodLength: 3888000000 -automaticTransferLength: 432000000 +anchorTenantAddGracePeriodLength: "PT2592000S" +autoRenewGracePeriodLength: "PT3888000S" +automaticTransferLength: "PT432000S" claimsPeriodEnd: "294247-01-10T04:00:54.775Z" createBillingCost: currency: "USD" @@ -11,7 +11,7 @@ createBillingCost: creationTime: "2022-09-01T00:00:00.000Z" currency: "USD" defaultPromoTokens: [] -dnsAPlusAaaaTtl: 900 +dnsAPlusAaaaTtl: "PT900S" dnsDsTtl: null dnsNsTtl: null dnsPaused: false @@ -27,10 +27,10 @@ idnTables: [] invoicingEnabled: false lordnUsername: null numDnsPublishLocks: 1 -pendingDeleteLength: 432000000 +pendingDeleteLength: "PT432000S" premiumListName: "test" pricingEngineClassName: "google.registry.model.pricing.StaticPremiumListPricingEngine" -redemptionGracePeriodLength: 2592000000 +redemptionGracePeriodLength: "PT2592000S" registryLockOrUnlockBillingCost: currency: "USD" amount: 0.00 @@ -38,7 +38,7 @@ renewBillingCostTransitions: "1970-01-01T00:00:00.000Z": currency: "USD" amount: 11.00 -renewGracePeriodLength: 432000000 +renewGracePeriodLength: "PT432000S" reservedListNames: [] restoreBillingCost: currency: "USD" @@ -52,4 +52,4 @@ tldStateTransitions: tldStr: %TLDSTR% tldType: "REAL" tldUnicode: %TLDUNICODE% -transferGracePeriodLength: 432000000 +transferGracePeriodLength: "PT432000S"