GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: add PhoneService, PhoneAPIKeyService, and WebhookService by AchoArnold · Pull Request #5 · NdoleStudio/httpsms-go

Conversation

@AchoArnold

@AchoArnold AchoArnold commented May 5, 2026

Copy link
Copy Markdown
Member

Adds three new services to the SDK for managing phones, phone API keys, and webhooks programmatically.

New Services

  • PhoneService: \Upsert()\ and \UpsertFCMToken()\ for phone management
  • PhoneAPIKeyService: \Store()\ for creating phone API keys
  • WebhookService: \Store()\ for creating webhooks with signing keys

Changes

  • \client.go: Register new services (Phones, PhoneAPIKeys, Webhooks)
  • \phone_service.go\ + \phone.go: Phone models and service
  • \phone_api_key_service.go\ + \phone_api_key.go: PhoneAPIKey models and service
  • \webhook_service.go\ + \webhook.go: Webhook models and service

These are needed by the httpSMS integration test suite to dynamically create phones and webhooks per test.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
AchoArnold and others added 3 commits May 5, 2026 11:42
@AchoArnold
feat: add PhoneService, PhoneAPIKeyService, and WebhookService
6989cf6
- PhoneService: Upsert() and UpsertFCMToken() for phone management
- PhoneAPIKeyService: Store() for creating phone API keys
- WebhookService: Store() for creating webhooks with signing keys
- Register new services on Client struct

Co-authored-by: Copilot <[email protected]>
@AchoArnold
Fix uuid
f68ae42
@AchoArnold
test: add tests for PhoneService, PhoneAPIKeyService, and WebhookService
2830472
Add success, error, and request verification tests for all new service
methods introduced in this branch:
- PhoneService.Upsert and PhoneService.UpsertFCMToken
- PhoneAPIKeyService.Store
- WebhookService.Store

Co-authored-by: Copilot <[email protected]>
@AchoArnold
AchoArnold requested a review from Copilot May 5, 2026 19:55
Copilot started reviewing on behalf of AchoArnold May 5, 2026 19:55
View session
@AchoArnold
AchoArnold merged commit 40737b4 into main May 5, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@AchoArnold
AchoArnold deleted the feature/add-phone-webhook-services branch May 5, 2026 19:57
Copilot AI reviewed May 5, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown

There was a problem hiding this 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 expands the Go SDK with new write-side services for provisioning phones, phone API keys, and webhooks, which fits the SDK’s role as a thin client over the httpSMS API and supports the integration tests’ need to create these resources programmatically.

Changes:

  • Registers Phones, PhoneAPIKeys, and Webhooks on the shared Client.
  • Adds models and service methods for phone upsert/FCM token binding, phone API key creation, and webhook creation.
  • Adds stub-backed unit tests for the new services and updates the google/uuid dependency version.

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
client.go Wires the three new services into client construction.
phone.go Adds the phone resource model and response wrapper.
phone_service.go Adds phone upsert and FCM-token endpoints.
phone_service_test.go Adds success, error, and request-shape tests for phone APIs.
phone_api_key.go Adds the phone API key resource model and response wrapper.
phone_api_key_service.go Adds the phone API key creation endpoint.
phone_api_key_service_test.go Adds tests for phone API key creation behavior.
webhook.go Adds the webhook resource model and response wrapper.
webhook_service.go Adds the webhook creation endpoint.
webhook_service_test.go Adds tests for webhook creation behavior.
internal/stubs/phone.go Adds phone endpoint stub payloads.
internal/stubs/phone_api_key.go Adds phone API key stub payloads.
internal/stubs/webhook.go Adds webhook stub payloads.
go.mod Bumps github.com/google/uuid to v1.6.0.
go.sum Refreshes checksums for the dependency bump.

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread phone_service.go
Comment on lines +14 to +19
PhoneNumber string `json:"phone_number"`
FcmToken string `json:"fcm_token,omitempty"`
MessagesPerMinute uint `json:"messages_per_minute,omitempty"`
MaxSendAttempts uint `json:"max_send_attempts,omitempty"`
MessageExpirationSeconds uint `json:"message_expiration_seconds,omitempty"`
SIM string `json:"sim,omitempty"`
Comment thread webhook_service.go
Comment on lines +20 to +22
// Store adds a new webhook
func (service *WebhookService) Store(ctx context.Context, params *WebhookStoreParams) (*WebhookResponse, *Response, error) {
request, err := service.client.newRequest(ctx, http.MethodPost, "/v1/webhooks", params)
Comment thread client.go
Comment on lines +28 to +30
Phones *PhoneService
PhoneAPIKeys *PhoneAPIKeyService
Webhooks *WebhookService
Comment thread phone_api_key_service.go

// Store adds a new phone api key
func (service *PhoneAPIKeyService) Store(ctx context.Context, params *PhoneAPIKeyStoreParams) (*PhoneAPIKeyResponse, *Response, error) {
request, err := service.client.newRequest(ctx, http.MethodPost, "/v1/phone-api-keys/", params)
@AchoArnold

AchoArnold commented May 5, 2026

Copy link
Copy Markdown
Member Author

All 4 review comments have been addressed in commits 0df3505 and d10459f on main:

  1. Pointer types for PhoneUpsertParams — Optional fields now use *string/*uint so callers can distinguish 'unset' from zero values.
  2. Webhook event constants — Tests and stubs updated to use EventTypeMessagePhoneReceived/EventTypeMessagePhoneSent instead of raw strings.
  3. README updated — Phones, Phone API Keys, and Webhooks added to the Implemented section.
  4. Trailing slash removed — /v1/phone-api-keys/ → /v1/phone-api-keys for consistency with other endpoints.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@AchoArnold
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.