From f9ce22f10d5adcb24e457c9f6e8ab1f21259f938 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:33:32 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-go-sdk: 1.46.2 --- .fern/metadata.json | 4 +- core/request_option.go | 4 +- reference.md | 4 +- transfers/client.go | 1 + types.go | 199 ++++++++++++++++- types_test.go | 387 +++++++++++++++++++++++++++++++++ webhook_notifications.go | 3 + webhook_notifications_test.go | 7 + webhooknotifications/client.go | 3 +- 9 files changed, 602 insertions(+), 10 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index ecc6cf8..f82f91d 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -11,7 +11,7 @@ "enableWireTests": true }, "invokedBy": "ci", - "requestedVersion": "1.31.0", + "requestedVersion": "1.32.0", "ciProvider": "gitlab", - "sdkVersion": "v1.31.0" + "sdkVersion": "v1.32.0" } \ No newline at end of file diff --git a/core/request_option.go b/core/request_option.go index bc2f160..1d71d98 100644 --- a/core/request_option.go +++ b/core/request_option.go @@ -62,8 +62,8 @@ func (r *RequestOptions) cloneHeader() http.Header { headers := r.HTTPHeader.Clone() headers.Set("X-Fern-Language", "Go") headers.Set("X-Fern-SDK-Name", "github.com/namedotcom/core-api-go") - headers.Set("X-Fern-SDK-Version", "v1.31.0") - headers.Set("User-Agent", "github.com/namedotcom/core-api-go/1.31.0") + headers.Set("X-Fern-SDK-Version", "v1.32.0") + headers.Set("User-Agent", "github.com/namedotcom/core-api-go/1.32.0") return headers } diff --git a/reference.md b/reference.md index f519655..265d6d2 100644 --- a/reference.md +++ b/reference.md @@ -4063,9 +4063,10 @@ client.WebhookNotifications.GetSubscribedNotifications( Creates a webhook subscription to receive real-time notifications about specific domain or account events (e.g. transfer completions, renewals). Pass the callback URL and event types. This allows external systems to stay in sync with name.com changes. Supported webhook event names: - `account.credit.balance_change` – account credit balance changes (increases or decreases). +- `account.domain.removal` – domain removed from the subscribing account. - `domain.lock.status_change` – domain lock added or removed. - `domain.transfer.status_change` – domain transfer IN to name.com; status updates while name.com is the gaining registrar. -- `domain.transfer_out.status_change` – domain transfer OUT from name.com to another registrar; fires when the domain is removed from the account. +- `domain.transfer_out.status_change` – domain transfer OUT from name.com; `initiated`, `completed` (domain removed), or `canceled` (no longer pending at the registry). - `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account via internal transfer. - `domain.transfer.internal_out` - name.com domain transfers out of the subscribing account via internal transfer. - `contact.verification.status_change` - contact verification status changes (verified or unverified). @@ -4866,6 +4867,7 @@ client.Transfers.CancelTransfer(
Cancels an outbound transfer for the given domain. Use this when the domain is being transferred out of name.com (losing registrar) to another (gaining) registrar and the registrant or reseller wants to cancel that transfer. +On success, subscribers receive `domain.transfer_out.status_change` with status `canceled`. The endpoint validates that the domain exists and belongs to the authenticated account. Only domains in a pending transfer (out) state can be canceled.
diff --git a/transfers/client.go b/transfers/client.go index 81d8a01..5252b03 100644 --- a/transfers/client.go +++ b/transfers/client.go @@ -121,6 +121,7 @@ func (c *Client) CancelTransfer( } // Cancels an outbound transfer for the given domain. Use this when the domain is being transferred out of name.com (losing registrar) to another (gaining) registrar and the registrant or reseller wants to cancel that transfer. +// On success, subscribers receive `domain.transfer_out.status_change` with status `canceled`. // The endpoint validates that the domain exists and belongs to the authenticated account. Only domains in a pending transfer (out) state can be canceled. func (c *Client) CancelOutboundTransfer( ctx context.Context, diff --git a/types.go b/types.go index cdccedc..1378884 100644 --- a/types.go +++ b/types.go @@ -328,6 +328,197 @@ func (a AccountCreditBalanceChangeEventName) Ptr() *AccountCreditBalanceChangeEv return &a } +// Payload sent when a domain is removed from the subscribing account. +var ( + accountDomainRemovalFieldEventName = big.NewInt(1 << 0) + accountDomainRemovalFieldDomainName = big.NewInt(1 << 1) + accountDomainRemovalFieldReason = big.NewInt(1 << 2) + accountDomainRemovalFieldExpireDate = big.NewInt(1 << 3) +) + +type AccountDomainRemoval struct { + // The name of the subscription event + EventName AccountDomainRemovalEventName `json:"eventName" url:"eventName"` + // The name of the domain that was removed + DomainName string `json:"domainName" url:"domainName"` + // Why the domain left inventory: `expiration` (registry delete / post-expiry inventory loss), `agp_refund` (AGP refund delete), or `administrative` (ops/support removal). + Reason AccountDomainRemovalReason `json:"reason" url:"reason"` + // The date and time when the domain expired + ExpireDate time.Time `json:"expireDate" url:"expireDate"` + + // Private bitmask of fields set to an explicit value and therefore not to be omitted + explicitFields *big.Int `json:"-" url:"-"` + + extraProperties map[string]interface{} + rawJSON json.RawMessage +} + +func (a *AccountDomainRemoval) GetEventName() AccountDomainRemovalEventName { + if a == nil { + return "" + } + return a.EventName +} + +func (a *AccountDomainRemoval) GetDomainName() string { + if a == nil { + return "" + } + return a.DomainName +} + +func (a *AccountDomainRemoval) GetReason() AccountDomainRemovalReason { + if a == nil { + return "" + } + return a.Reason +} + +func (a *AccountDomainRemoval) GetExpireDate() time.Time { + if a == nil { + return time.Time{} + } + return a.ExpireDate +} + +func (a *AccountDomainRemoval) GetExtraProperties() map[string]interface{} { + if a == nil { + return nil + } + return a.extraProperties +} + +func (a *AccountDomainRemoval) require(field *big.Int) { + if a.explicitFields == nil { + a.explicitFields = big.NewInt(0) + } + a.explicitFields.Or(a.explicitFields, field) +} + +// SetEventName sets the EventName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDomainRemoval) SetEventName(eventName AccountDomainRemovalEventName) { + a.EventName = eventName + a.require(accountDomainRemovalFieldEventName) +} + +// SetDomainName sets the DomainName field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDomainRemoval) SetDomainName(domainName string) { + a.DomainName = domainName + a.require(accountDomainRemovalFieldDomainName) +} + +// SetReason sets the Reason field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDomainRemoval) SetReason(reason AccountDomainRemovalReason) { + a.Reason = reason + a.require(accountDomainRemovalFieldReason) +} + +// SetExpireDate sets the ExpireDate field and marks it as non-optional; +// this prevents an empty or null value for this field from being omitted during serialization. +func (a *AccountDomainRemoval) SetExpireDate(expireDate time.Time) { + a.ExpireDate = expireDate + a.require(accountDomainRemovalFieldExpireDate) +} + +func (a *AccountDomainRemoval) UnmarshalJSON(data []byte) error { + type embed AccountDomainRemoval + var unmarshaler = struct { + embed + ExpireDate *internal.DateTime `json:"expireDate"` + }{ + embed: embed(*a), + } + if err := json.Unmarshal(data, &unmarshaler); err != nil { + return err + } + *a = AccountDomainRemoval(unmarshaler.embed) + a.ExpireDate = unmarshaler.ExpireDate.Time() + extraProperties, err := internal.ExtractExtraProperties(data, *a) + if err != nil { + return err + } + a.extraProperties = extraProperties + a.rawJSON = json.RawMessage(data) + return nil +} + +func (a *AccountDomainRemoval) MarshalJSON() ([]byte, error) { + type embed AccountDomainRemoval + var marshaler = struct { + embed + ExpireDate *internal.DateTime `json:"expireDate"` + }{ + embed: embed(*a), + ExpireDate: internal.NewDateTime(a.ExpireDate), + } + explicitMarshaler := internal.HandleExplicitFields(marshaler, a.explicitFields) + return json.Marshal(explicitMarshaler) +} + +func (a *AccountDomainRemoval) String() string { + if a == nil { + return "" + } + if len(a.rawJSON) > 0 { + if value, err := internal.StringifyJSON(a.rawJSON); err == nil { + return value + } + } + if value, err := internal.StringifyJSON(a); err == nil { + return value + } + return fmt.Sprintf("%#v", a) +} + +// The name of the subscription event +type AccountDomainRemovalEventName string + +const ( + AccountDomainRemovalEventNameAccountDomainRemoval AccountDomainRemovalEventName = "account.domain.removal" +) + +func NewAccountDomainRemovalEventNameFromString(s string) (AccountDomainRemovalEventName, error) { + switch s { + case "account.domain.removal": + return AccountDomainRemovalEventNameAccountDomainRemoval, nil + } + var t AccountDomainRemovalEventName + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccountDomainRemovalEventName) Ptr() *AccountDomainRemovalEventName { + return &a +} + +// Why the domain left inventory: `expiration` (registry delete / post-expiry inventory loss), `agp_refund` (AGP refund delete), or `administrative` (ops/support removal). +type AccountDomainRemovalReason string + +const ( + AccountDomainRemovalReasonExpiration AccountDomainRemovalReason = "expiration" + AccountDomainRemovalReasonAgpRefund AccountDomainRemovalReason = "agp_refund" + AccountDomainRemovalReasonAdministrative AccountDomainRemovalReason = "administrative" +) + +func NewAccountDomainRemovalReasonFromString(s string) (AccountDomainRemovalReason, error) { + switch s { + case "expiration": + return AccountDomainRemovalReasonExpiration, nil + case "agp_refund": + return AccountDomainRemovalReasonAgpRefund, nil + case "administrative": + return AccountDomainRemovalReasonAdministrative, nil + } + var t AccountDomainRemovalReason + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (a AccountDomainRemovalReason) Ptr() *AccountDomainRemovalReason { + return &a +} + // Indicates whether the domain is set to renew automatically before expiration. type AutorenewEnabled = bool @@ -3300,7 +3491,7 @@ func (d DomainTransferInternalOutStatusChangeStatus) Ptr() *DomainTransferIntern return &d } -// Payload sent when a domain transfer OUT from name.com to another registrar has a status change (initiated, completed, or canceled). When status is "completed", the domain has been removed from name.com. In some edge cases (including near-expiration scenarios) the data may not be fully accurate. +// Payload for `domain.transfer_out.status_change`. `completed` means the domain left name.com. `canceled` means the outbound transfer is no longer pending at the registry. var ( domainTransferOutStatusChangeFieldEventName = big.NewInt(1 << 0) domainTransferOutStatusChangeFieldDomainName = big.NewInt(1 << 1) @@ -3311,9 +3502,9 @@ var ( type DomainTransferOutStatusChange struct { // The name of the subscription event. EventName DomainTransferOutStatusChangeEventName `json:"eventName" url:"eventName"` - // The domain that has transferred out of name.com. + // The domain whose outbound transfer status changed. For `completed`, the domain has left name.com; for `initiated` and `canceled`, it remains on the losing account. DomainName string `json:"domainName" url:"domainName"` - // The status of the transfer out event. May be "initiated" (transfer out was started), "completed" (domain has been removed from the account), or "canceled" (transfer out was canceled before completion). + // `initiated` (pending out started), `completed` (domain removed), or `canceled` (no longer pending at the registry). Status DomainTransferOutStatusChangeStatus `json:"status" url:"status"` // The registry client ID associated with the domain at the time of transfer out, when available. This can help identify the gaining registrar at the registry. RegistryClientID *string `json:"registryClientId,omitempty" url:"registryClientId,omitempty"` @@ -3457,7 +3648,7 @@ func (d DomainTransferOutStatusChangeEventName) Ptr() *DomainTransferOutStatusCh return &d } -// The status of the transfer out event. May be "initiated" (transfer out was started), "completed" (domain has been removed from the account), or "canceled" (transfer out was canceled before completion). +// `initiated` (pending out started), `completed` (domain removed), or `canceled` (no longer pending at the registry). type DomainTransferOutStatusChangeStatus string const ( diff --git a/types_test.go b/types_test.go index d16d145..3b6f142 100644 --- a/types_test.go +++ b/types_test.go @@ -676,6 +676,263 @@ func TestSettersMarkExplicitAccountCreditBalanceChange(t *testing.T) { } +func TestSettersAccountDomainRemoval(t *testing.T) { + t.Run("SetEventName", func(t *testing.T) { + obj := &AccountDomainRemoval{} + var fernTestValueEventName AccountDomainRemovalEventName + obj.SetEventName(fernTestValueEventName) + assert.Equal(t, fernTestValueEventName, obj.EventName) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetDomainName", func(t *testing.T) { + obj := &AccountDomainRemoval{} + var fernTestValueDomainName string + obj.SetDomainName(fernTestValueDomainName) + assert.Equal(t, fernTestValueDomainName, obj.DomainName) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetReason", func(t *testing.T) { + obj := &AccountDomainRemoval{} + var fernTestValueReason AccountDomainRemovalReason + obj.SetReason(fernTestValueReason) + assert.Equal(t, fernTestValueReason, obj.Reason) + assert.NotNil(t, obj.explicitFields) + }) + + t.Run("SetExpireDate", func(t *testing.T) { + obj := &AccountDomainRemoval{} + var fernTestValueExpireDate time.Time + obj.SetExpireDate(fernTestValueExpireDate) + assert.Equal(t, fernTestValueExpireDate, obj.ExpireDate) + assert.NotNil(t, obj.explicitFields) + }) + +} + +func TestGettersAccountDomainRemoval(t *testing.T) { + t.Run("GetEventName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var expected AccountDomainRemovalEventName + obj.EventName = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetEventName(), "getter should return the property value") + }) + + t.Run("GetEventName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetEventName() // Should return zero value + }) + + t.Run("GetDomainName", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var expected string + obj.DomainName = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetDomainName(), "getter should return the property value") + }) + + t.Run("GetDomainName_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetDomainName() // Should return zero value + }) + + t.Run("GetReason", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var expected AccountDomainRemovalReason + obj.Reason = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetReason(), "getter should return the property value") + }) + + t.Run("GetReason_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetReason() // Should return zero value + }) + + t.Run("GetExpireDate", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var expected time.Time + obj.ExpireDate = expected + + // Act & Assert + assert.Equal(t, expected, obj.GetExpireDate(), "getter should return the property value") + }) + + t.Run("GetExpireDate_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + // Should not panic - getters should handle nil receiver gracefully + defer func() { + if r := recover(); r != nil { + t.Errorf("Getter panicked on nil receiver: %v", r) + } + }() + _ = obj.GetExpireDate() // Should return zero value + }) + +} + +func TestSettersMarkExplicitAccountDomainRemoval(t *testing.T) { + t.Run("SetEventName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var fernTestValueEventName AccountDomainRemovalEventName + + // Act + obj.SetEventName(fernTestValueEventName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetDomainName_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var fernTestValueDomainName string + + // Act + obj.SetDomainName(fernTestValueDomainName) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetReason_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var fernTestValueReason AccountDomainRemovalReason + + // Act + obj.SetReason(fernTestValueReason) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + + t.Run("SetExpireDate_MarksExplicit", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + var fernTestValueExpireDate time.Time + + // Act + obj.SetExpireDate(fernTestValueExpireDate) + + // Assert - object with explicitly set field can be marshaled/unmarshaled + bytes, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed for test setup") + + // This test ensures JSON marshaling and unmarshaling succeed when the field has a zero/nil value + // Detect if marshaled JSON is an object or primitive to use correct unmarshal target + if len(bytes) > 0 && bytes[0] == '{' { + // JSON object - unmarshal into map + var unmarshaled map[string]interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } else { + // JSON primitive (string, number, boolean, null) - unmarshal into interface{} + var unmarshaled interface{} + err = json.Unmarshal(bytes, &unmarshaled) + require.NoError(t, err, "unmarshaling should succeed for test verification") + } + + // Note: This does not explicitly assert the presence of a specific JSON field + // It verifies that setting a field via setter allows successful JSON round-trip + }) + +} + func TestSettersBadGateway502(t *testing.T) { t.Run("SetMessage", func(t *testing.T) { obj := &BadGateway502{} @@ -12074,6 +12331,39 @@ func TestJSONMarshalingAccountCreditBalanceChange(t *testing.T) { }) } +func TestJSONMarshalingAccountDomainRemoval(t *testing.T) { + t.Run("MarshalUnmarshal", func(t *testing.T) { + t.Parallel() + // Arrange + obj := &AccountDomainRemoval{} + + // Act - Marshal to JSON + data, err := json.Marshal(obj) + require.NoError(t, err, "marshaling should succeed") + assert.NotNil(t, data, "marshaled data should not be nil") + assert.NotEmpty(t, data, "marshaled data should not be empty") + + // Unmarshal back and verify round-trip + var unmarshaled AccountDomainRemoval + err = json.Unmarshal(data, &unmarshaled) + assert.NoError(t, err, "round-trip unmarshal should succeed") + }) + + t.Run("UnmarshalInvalidJSON", func(t *testing.T) { + t.Parallel() + var obj AccountDomainRemoval + err := json.Unmarshal([]byte(`{invalid json}`), &obj) + assert.Error(t, err, "unmarshaling invalid JSON should return an error") + }) + + t.Run("UnmarshalEmptyObject", func(t *testing.T) { + t.Parallel() + var obj AccountDomainRemoval + err := json.Unmarshal([]byte(`{}`), &obj) + assert.NoError(t, err, "unmarshaling empty object should succeed") + }) +} + func TestJSONMarshalingBadGateway502(t *testing.T) { t.Run("MarshalUnmarshal", func(t *testing.T) { t.Parallel() @@ -13459,6 +13749,22 @@ func TestStringAccountCreditBalanceChange(t *testing.T) { }) } +func TestStringAccountDomainRemoval(t *testing.T) { + t.Run("StringMethod", func(t *testing.T) { + t.Parallel() + obj := &AccountDomainRemoval{} + result := obj.String() + assert.NotEmpty(t, result, "String() should return a non-empty representation") + }) + + t.Run("StringMethod_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + result := obj.String() + assert.Equal(t, "", result, "String() should return for nil receiver") + }) +} + func TestStringBadGateway502(t *testing.T) { t.Run("StringMethod", func(t *testing.T) { t.Parallel() @@ -14137,6 +14443,64 @@ func TestEnumAccountCreditBalanceChangeEventName(t *testing.T) { }) } +func TestEnumAccountDomainRemovalEventName(t *testing.T) { + t.Run("NewFromString_account_domain_removal", func(t *testing.T) { + t.Parallel() + val, err := NewAccountDomainRemovalEventNameFromString("account.domain.removal") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, AccountDomainRemovalEventName("account.domain.removal"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewAccountDomainRemovalEventNameFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewAccountDomainRemovalEventNameFromString("account.domain.removal") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + +func TestEnumAccountDomainRemovalReason(t *testing.T) { + t.Run("NewFromString_expiration", func(t *testing.T) { + t.Parallel() + val, err := NewAccountDomainRemovalReasonFromString("expiration") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, AccountDomainRemovalReason("expiration"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_agp_refund", func(t *testing.T) { + t.Parallel() + val, err := NewAccountDomainRemovalReasonFromString("agp_refund") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, AccountDomainRemovalReason("agp_refund"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_administrative", func(t *testing.T) { + t.Parallel() + val, err := NewAccountDomainRemovalReasonFromString("administrative") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, AccountDomainRemovalReason("administrative"), val, "enum value should match expected wire value") + }) + + t.Run("NewFromString_Invalid", func(t *testing.T) { + _, err := NewAccountDomainRemovalReasonFromString("invalid_value_that_does_not_exist") + assert.Error(t, err) + }) + + t.Run("Ptr", func(t *testing.T) { + val, err := NewAccountDomainRemovalReasonFromString("expiration") + assert.NoError(t, err) + ptr := val.Ptr() + assert.NotNil(t, ptr) + assert.Equal(t, val, *ptr) + }) +} + func TestEnumContactVerificationStatusChangeEventName(t *testing.T) { t.Run("NewFromString_contact_verification_status_change", func(t *testing.T) { t.Parallel() @@ -14539,6 +14903,29 @@ func TestExtraPropertiesAccountCreditBalanceChange(t *testing.T) { }) } +func TestExtraPropertiesAccountDomainRemoval(t *testing.T) { + t.Run("GetExtraProperties", func(t *testing.T) { + t.Parallel() + obj := &AccountDomainRemoval{} + // Should not panic when calling GetExtraProperties() + defer func() { + if r := recover(); r != nil { + t.Errorf("GetExtraProperties() panicked: %v", r) + } + }() + extraProps := obj.GetExtraProperties() + // Result can be nil or an empty/non-empty map + _ = extraProps + }) + + t.Run("GetExtraProperties_NilReceiver", func(t *testing.T) { + t.Parallel() + var obj *AccountDomainRemoval + extraProps := obj.GetExtraProperties() + assert.Nil(t, extraProps, "nil receiver should return nil without panicking") + }) +} + func TestExtraPropertiesBadGateway502(t *testing.T) { t.Run("GetExtraProperties", func(t *testing.T) { t.Parallel() diff --git a/webhook_notifications.go b/webhook_notifications.go index 4e503d4..54be779 100644 --- a/webhook_notifications.go +++ b/webhook_notifications.go @@ -146,6 +146,7 @@ type AvailableWebhooks string const ( AvailableWebhooksAccountCreditBalanceChange AvailableWebhooks = "account.credit.balance_change" + AvailableWebhooksAccountDomainRemoval AvailableWebhooks = "account.domain.removal" AvailableWebhooksDomainLockStatusChange AvailableWebhooks = "domain.lock.status_change" AvailableWebhooksDomainTransferStatusChange AvailableWebhooks = "domain.transfer.status_change" AvailableWebhooksDomainTransferOutStatusChange AvailableWebhooks = "domain.transfer_out.status_change" @@ -160,6 +161,8 @@ func NewAvailableWebhooksFromString(s string) (AvailableWebhooks, error) { switch s { case "account.credit.balance_change": return AvailableWebhooksAccountCreditBalanceChange, nil + case "account.domain.removal": + return AvailableWebhooksAccountDomainRemoval, nil case "domain.lock.status_change": return AvailableWebhooksDomainLockStatusChange, nil case "domain.transfer.status_change": diff --git a/webhook_notifications_test.go b/webhook_notifications_test.go index 5eb7e75..2930a0a 100644 --- a/webhook_notifications_test.go +++ b/webhook_notifications_test.go @@ -1369,6 +1369,13 @@ func TestEnumAvailableWebhooks(t *testing.T) { assert.Equal(t, AvailableWebhooks("account.credit.balance_change"), val, "enum value should match expected wire value") }) + t.Run("NewFromString_account_domain_removal", func(t *testing.T) { + t.Parallel() + val, err := NewAvailableWebhooksFromString("account.domain.removal") + assert.NoError(t, err, "valid enum value should not return error") + assert.Equal(t, AvailableWebhooks("account.domain.removal"), val, "enum value should match expected wire value") + }) + t.Run("NewFromString_domain_lock_status_change", func(t *testing.T) { t.Parallel() val, err := NewAvailableWebhooksFromString("domain.lock.status_change") diff --git a/webhooknotifications/client.go b/webhooknotifications/client.go index 8db0b14..c6fffc1 100644 --- a/webhooknotifications/client.go +++ b/webhooknotifications/client.go @@ -52,9 +52,10 @@ func (c *Client) GetSubscribedNotifications( // Creates a webhook subscription to receive real-time notifications about specific domain or account events (e.g. transfer completions, renewals). Pass the callback URL and event types. This allows external systems to stay in sync with name.com changes. // Supported webhook event names: // - `account.credit.balance_change` – account credit balance changes (increases or decreases). +// - `account.domain.removal` – domain removed from the subscribing account. // - `domain.lock.status_change` – domain lock added or removed. // - `domain.transfer.status_change` – domain transfer IN to name.com; status updates while name.com is the gaining registrar. -// - `domain.transfer_out.status_change` – domain transfer OUT from name.com to another registrar; fires when the domain is removed from the account. +// - `domain.transfer_out.status_change` – domain transfer OUT from name.com; `initiated`, `completed` (domain removed), or `canceled` (no longer pending at the registry). // - `domain.transfer.internal_in` - name.com domain transfers in to the subscribing account via internal transfer. // - `domain.transfer.internal_out` - name.com domain transfers out of the subscribing account via internal transfer. // - `contact.verification.status_change` - contact verification status changes (verified or unverified). From 845227ea88c399b9515fc7e441e1ff273230148a Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 20:33:32 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index 896ba1f..1962462 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -12,5 +12,11 @@ generations: cli_version: unknown generator_versions: fernapi/fern-go-sdk: 1.46.2 -current_generation: 64ab9341d1faa7e65db85835763bccb74057e74b + - commit_sha: a83e0ab738a0ede5980d037936a0d67c87529565 + tree_hash: 90a216a030577e808eada8d7d441b75bbf88262e + timestamp: 2026-08-04T20:33:29.848Z + cli_version: unknown + generator_versions: + fernapi/fern-go-sdk: 1.46.2 +current_generation: a83e0ab738a0ede5980d037936a0d67c87529565 patches: []