Skip to content

Conversation

@ahwm
Copy link
Owner

@ahwm ahwm commented Nov 18, 2025

Will resolve #86

Also addresses new warnings with .NET 10 building

@ahwm ahwm marked this pull request as ready for review November 18, 2025 16:47
Copilot AI review requested due to automatic review settings November 18, 2025 16:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for GoDaddy API v2 endpoints while maintaining backward compatibility with v1 APIs, and addresses .NET 10 build warnings by removing deprecated package references.

  • Adds v2 endpoint support for domains, certificates, and abuse tickets with new request/response models
  • Updates base URLs to support both v1 and v2 API versions by removing hardcoded /v1/ paths
  • Bumps package version to 4.0.0 and updates target frameworks to include .NET 10

Reviewed Changes

Copilot reviewed 27 out of 27 changed files in this pull request and generated 18 comments.

Show a summary per file
File Description
src/V2_IMPLEMENTATION_SUMMARY.md Documentation of v2 implementation approach and changes
src/GodaddyWrapper/Services.cs Removes hardcoded /v1/ from base URLs to support v1 and v2 endpoints
src/GodaddyWrapper/Serialization/JsonContext.cs Registers v2 request and response types for JSON source generation
src/GodaddyWrapper/Responses/DomainTransferV2Response.cs Adds v2 domain transfer response model
src/GodaddyWrapper/Responses/DomainPurchaseV2Response.cs Adds v2 domain purchase response model
src/GodaddyWrapper/Responses/DomainListV2Response.cs Adds v2 domain listing response with pagination support
src/GodaddyWrapper/Responses/DomainAvailabilityV2Response.cs Adds v2 domain availability response model
src/GodaddyWrapper/Requests/DomainUpdateV2.cs Adds v2 domain update request with privacy settings
src/GodaddyWrapper/Requests/DomainTransferV2.cs Adds v2 domain transfer request with consent tracking
src/GodaddyWrapper/Requests/DomainRenewV2.cs Adds v2 domain renewal request model
src/GodaddyWrapper/Requests/DomainPurchaseV2.cs Adds v2 domain purchase request with consent and contact models
src/GodaddyWrapper/Requests/DomainContactsV2.cs Adds v2 domain contacts update request model
src/GodaddyWrapper/Helper/QueryStringBuilder.cs Adds dictionary-to-query-string helper for v2 endpoint parameters
src/GodaddyWrapper/GodaddyWrapper.csproj Updates version to 4.0.0 and comments out deprecated package references
src/GodaddyWrapper/Client.cs Removes hardcoded /v1/ from endpoint URLs
src/GodaddyWrapper/Client.Subscription.cs Adds V1_BASE prefix to all subscription endpoints
src/GodaddyWrapper/Client.Shopper.cs Adds V1_BASE prefix to all shopper endpoints
src/GodaddyWrapper/Client.Order.cs Adds V1_BASE prefix to all order endpoints
src/GodaddyWrapper/Client.DomainV2.cs Implements all v2 domain management endpoints
src/GodaddyWrapper/Client.Domain.cs Adds V1_BASE constant and prefix to all v1 domain endpoints
src/GodaddyWrapper/Client.Countries.cs Adds V1_BASE prefix to all countries endpoints
src/GodaddyWrapper/Client.Certificate.cs Implements v2 variants for all certificate operations
src/GodaddyWrapper/Client.Agreements.cs Adds V1_BASE prefix to agreements endpoint
src/GodaddyWrapper/Client.Aftermarket.cs Adds V1_BASE prefix to all aftermarket endpoints
src/GodaddyWrapper/Client.AbuseTicket.cs Implements v2 variants for abuse ticket operations
src/GodaddyWrapper.Tests/GodaddyWrapper.Tests.csproj Adds .NET 10 target framework and comments out deprecated package references
.github/workflows/build.yml Adds .NET 10 SDK setup step to CI workflow

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 22 to 39
/// Whether or not the domain should be renewed automatically
/// </summary>
public bool? RenewAuto { get; set; }

/// <summary>
/// Subaccount ID
/// </summary>
public string SubaccountId { get; set; }

/// <summary>
/// Whether or not privacy protection is enabled
/// </summary>
public bool? PrivacyEnabled { get; set; }

/// <summary>
/// Whether or not the domain is set to auto-renew
/// </summary>
public bool? AutoRenewEnabled { get; set; }
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant property: Both RenewAuto (line 24) and AutoRenewEnabled (line 39) appear to represent the same auto-renewal setting. This is confusing and could lead to inconsistent behavior if both are set to different values. Consider:

  1. Removing one of these properties
  2. Or clearly documenting which one takes precedence
  3. Or if they serve different purposes, rename them to clarify the distinction

Copilot uses AI. Check for mistakes.
queryParams.Add("includes", includes);

var queryString = QueryStringBuilder.DictionaryToQueryString(queryParams);
var response = await httpClient.GetAsync($"{V2_BASE}customers/{{customerId}}/domains{queryString}");
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Copilot uses AI. Check for mistakes.
Comment on lines 138 to 146
/// <param name="XShopperId">Shopper ID to be operated on, if different from JWT</param>
/// <returns>Domain purchase response</returns>
public async Task<DomainPurchaseV2Response> PurchaseDomainV2(DomainPurchaseV2 request, string XShopperId = null)
{
CheckRequestValid(request);
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);

var response = await httpClient.PostAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/purchase", request, JsonSettings);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Suggested change
/// <param name="XShopperId">Shopper ID to be operated on, if different from JWT</param>
/// <returns>Domain purchase response</returns>
public async Task<DomainPurchaseV2Response> PurchaseDomainV2(DomainPurchaseV2 request, string XShopperId = null)
{
CheckRequestValid(request);
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
var response = await httpClient.PostAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/purchase", request, JsonSettings);
/// <param name="customerId">Customer ID to be used in the API path</param>
/// <param name="XShopperId">Shopper ID to be operated on, if different from JWT</param>
public async Task<DomainPurchaseV2Response> PurchaseDomainV2(DomainPurchaseV2 request, string customerId, string XShopperId = null)
{
CheckRequestValid(request);
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
var response = await httpClient.PostAsJsonAsync($"{V2_BASE}customers/{customerId}/domains/purchase", request, JsonSettings);

Copilot uses AI. Check for mistakes.
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);

var response = await httpClient.PutAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}/records", records, JsonSettings);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Copilot uses AI. Check for mistakes.
queryParams.Add("includes", includes);

var queryString = QueryStringBuilder.DictionaryToQueryString(queryParams);
var response = await httpClient.GetAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}{queryString}");
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime. Consider:

  1. Adding a customerId parameter to the method
  2. Using a client-level configuration for the customer ID
  3. Or documenting clearly that this is intentionally a placeholder that must be replaced by consumers

Copilot uses AI. Check for mistakes.
Comment on lines 89 to 92
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);

var response = await httpClient.PatchAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}", request, JsonSettings);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Suggested change
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
var response = await httpClient.PatchAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}", request, JsonSettings);
if (string.IsNullOrEmpty(XShopperId))
throw new System.ArgumentNullException(nameof(XShopperId), "XShopperId (customerId) must be provided.");
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);
var response = await httpClient.PatchAsJsonAsync($"{V2_BASE}customers/{XShopperId}/domains/{domain}", request, JsonSettings);

Copilot uses AI. Check for mistakes.
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);

var response = await httpClient.PostAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}/renew", request, JsonSettings);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Copilot uses AI. Check for mistakes.
if (XShopperId != null)
httpClient.DefaultRequestHeaders.Add("X-Shopper-Id", XShopperId);

var response = await httpClient.PatchAsJsonAsync($"{V2_BASE}customers/{{customerId}}/domains/{domain}/records", records, JsonSettings);
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard-coded placeholder {customerId} in URL path. This placeholder will be sent as-is to the API, which will fail. The actual customer ID should be obtained and substituted at runtime.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

Copy link
Contributor

Copilot AI commented Jan 26, 2026

@ahwm I've opened a new pull request, #105, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 5 commits January 26, 2026 22:43
Co-authored-by: ahwm <20478373+ahwm@users.noreply.github.com>
Co-authored-by: ahwm <20478373+ahwm@users.noreply.github.com>
Fix hard-coded {customerId} placeholder in V2 domain API endpoints
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ahwm
Copy link
Owner Author

ahwm commented Jan 27, 2026

@copilot open a new pull request to apply changes based on the comments in this thread

Copy link
Contributor

Copilot AI commented Jan 27, 2026

@ahwm I've opened a new pull request, #106, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits January 27, 2026 15:15
…e duplicate property

Co-authored-by: ahwm <20478373+ahwm@users.noreply.github.com>
Co-authored-by: ahwm <20478373+ahwm@users.noreply.github.com>
Fix code review feedback: API typo, null safety, duplicate property, docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GoDaddy now has v2 APIs

2 participants