Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "4.44.0"
".": "4.45.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 953
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-8b57ba42d490172b1da263344e4a074d94b96c2801ba8329a6be5c743c932303.yml
openapi_spec_hash: 6c41c630cd8ab8236ae8f8611cd3e6d9
config_hash: 0ba5866e810d1835ea3496dd0331f5ba
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/telnyx%2Ftelnyx-82c1afa45ee737b39ce508fd8383d93b9c05d307a1c975893523451b99515112.yml
openapi_spec_hash: 3077927f7391151deb5ef556be246b25
config_hash: 5360c8b0113ee08335377331f5fc5440
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 4.45.0 (2026-03-10)

Full Changelog: [v4.44.0...v4.45.0](https://github.com/team-telnyx/telnyx-go/compare/v4.44.0...v4.45.0)

### Features

* **api:** manual updates ([6af49e0](https://github.com/team-telnyx/telnyx-go/commit/6af49e0b290c54e1df93de47b91b12c2e86cc83e))
* **messaging:** add wait_seconds to OutboundMessagePayload example ([db135bd](https://github.com/team-telnyx/telnyx-go/commit/db135bd23a00b7e1389b8e4e170c8c1c616e9a2c))


### Bug Fixes

* add title to InviteTool.invite for Stainless SDK ([156a718](https://github.com/team-telnyx/telnyx-go/commit/156a7183ce71a8f9df09d58c74296f4bdefbf777))


### Chores

* **internal:** use explicit returns in more places ([3ea4295](https://github.com/team-telnyx/telnyx-go/commit/3ea4295e5243761699d3af3a5976b63839ce0ad1))

## 4.44.0 (2026-03-10)

Full Changelog: [v4.43.0...v4.44.0](https://github.com/team-telnyx/telnyx-go/compare/v4.43.0...v4.44.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/team-telnyx/telnyx-go@v4.44.0'
go get -u 'github.com/team-telnyx/telnyx-go@v4.45.0'
```

<!-- x-release-please-end -->
Expand Down
126 changes: 63 additions & 63 deletions aiassistant.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ type AssistantToolsItemsUnion struct {
// This field is from variant [AssistantToolTransfer].
Transfer AssistantToolTransferTransfer `json:"transfer"`
// This field is from variant [AssistantToolInvite].
Invite AssistantToolInviteInvite `json:"invite"`
InviteConfig AssistantToolInviteInviteConfig `json:"invite_config"`
// This field is from variant [AssistantToolRefer].
Refer AssistantToolReferRefer `json:"refer"`
// This field is from variant [AssistantToolSendDtmf].
Expand All @@ -481,18 +481,18 @@ type AssistantToolsItemsUnion struct {
// This field is from variant [AssistantToolSkipTurn].
SkipTurn AssistantToolSkipTurnSkipTurn `json:"skip_turn"`
JSON struct {
Type respjson.Field
Webhook respjson.Field
Retrieval respjson.Field
Handoff respjson.Field
Hangup respjson.Field
Transfer respjson.Field
Invite respjson.Field
Refer respjson.Field
SendDtmf respjson.Field
SendMessage respjson.Field
SkipTurn respjson.Field
raw string
Type respjson.Field
Webhook respjson.Field
Retrieval respjson.Field
Handoff respjson.Field
Hangup respjson.Field
Transfer respjson.Field
InviteConfig respjson.Field
Refer respjson.Field
SendDtmf respjson.Field
SendMessage respjson.Field
SkipTurn respjson.Field
raw string
} `json:"-"`
}

Expand Down Expand Up @@ -920,14 +920,14 @@ func (r *AssistantToolTransferTransferVoicemailDetectionOnVoicemailDetectedVoice
}

type AssistantToolInvite struct {
Invite AssistantToolInviteInvite `json:"invite" api:"required"`
Type constant.Invite `json:"type" api:"required"`
InviteConfig AssistantToolInviteInviteConfig `json:"invite_config" api:"required"`
Type constant.Invite `json:"type" api:"required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Invite respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
raw string
InviteConfig respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
raw string
} `json:"-"`
}

Expand All @@ -937,14 +937,14 @@ func (r *AssistantToolInvite) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type AssistantToolInviteInvite struct {
type AssistantToolInviteInviteConfig struct {
// Custom headers to be added to the SIP INVITE for the invite command.
CustomHeaders []AssistantToolInviteInviteCustomHeader `json:"custom_headers"`
CustomHeaders []AssistantToolInviteInviteConfigCustomHeader `json:"custom_headers"`
// Number or SIP URI placing the call.
From string `json:"from"`
// Configuration for voicemail detection (AMD - Answering Machine Detection) on the
// invited call.
VoicemailDetection AssistantToolInviteInviteVoicemailDetection `json:"voicemail_detection"`
VoicemailDetection AssistantToolInviteInviteConfigVoicemailDetection `json:"voicemail_detection"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CustomHeaders respjson.Field
Expand All @@ -956,12 +956,12 @@ type AssistantToolInviteInvite struct {
}

// Returns the unmodified JSON received from the API
func (r AssistantToolInviteInvite) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInvite) UnmarshalJSON(data []byte) error {
func (r AssistantToolInviteInviteConfig) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInviteConfig) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type AssistantToolInviteInviteCustomHeader struct {
type AssistantToolInviteInviteConfigCustomHeader struct {
Name string `json:"name"`
// The value of the header. Note that we support mustache templating for the value.
// For example you can use
Expand All @@ -978,21 +978,21 @@ type AssistantToolInviteInviteCustomHeader struct {
}

// Returns the unmodified JSON received from the API
func (r AssistantToolInviteInviteCustomHeader) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInviteCustomHeader) UnmarshalJSON(data []byte) error {
func (r AssistantToolInviteInviteConfigCustomHeader) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInviteConfigCustomHeader) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// Configuration for voicemail detection (AMD - Answering Machine Detection) on the
// invited call.
type AssistantToolInviteInviteVoicemailDetection struct {
type AssistantToolInviteInviteConfigVoicemailDetection struct {
// The AMD detection mode to use. 'premium' enables premium answering machine
// detection. 'disabled' turns off AMD detection.
//
// Any of "disabled", "premium".
DetectionMode string `json:"detection_mode"`
// Action to take when voicemail is detected on the invited call.
OnVoicemailDetected AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetected `json:"on_voicemail_detected"`
OnVoicemailDetected AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetected `json:"on_voicemail_detected"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
DetectionMode respjson.Field
Expand All @@ -1003,13 +1003,13 @@ type AssistantToolInviteInviteVoicemailDetection struct {
}

// Returns the unmodified JSON received from the API
func (r AssistantToolInviteInviteVoicemailDetection) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInviteVoicemailDetection) UnmarshalJSON(data []byte) error {
func (r AssistantToolInviteInviteConfigVoicemailDetection) RawJSON() string { return r.JSON.raw }
func (r *AssistantToolInviteInviteConfigVoicemailDetection) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// Action to take when voicemail is detected on the invited call.
type AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetected struct {
type AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetected struct {
// The action to take when voicemail is detected.
//
// Any of "stop_invite".
Expand All @@ -1023,10 +1023,10 @@ type AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetected struct {
}

// Returns the unmodified JSON received from the API
func (r AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetected) RawJSON() string {
func (r AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetected) RawJSON() string {
return r.JSON.raw
}
func (r *AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetected) UnmarshalJSON(data []byte) error {
func (r *AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetected) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

Expand Down Expand Up @@ -1248,10 +1248,10 @@ func AssistantToolsItemsParamOfTransfer(transfer AssistantToolTransferTransferPa
return AssistantToolsItemsUnionParam{OfTransfer: &variant}
}

func AssistantToolsItemsParamOfInvite(invite AssistantToolInviteInviteParam) AssistantToolsItemsUnionParam {
var variant AssistantToolInviteParam
variant.Invite = invite
return AssistantToolsItemsUnionParam{OfInvite: &variant}
func AssistantToolsItemsParamOfInvite(inviteConfig AssistantToolInviteInviteConfigParam) AssistantToolsItemsUnionParam {
var invite AssistantToolInviteParam
invite.InviteConfig = inviteConfig
return AssistantToolsItemsUnionParam{OfInvite: &invite}
}

func AssistantToolsItemsParamOfRefer(refer AssistantToolReferReferParam) AssistantToolsItemsUnionParam {
Expand Down Expand Up @@ -1377,9 +1377,9 @@ func (u AssistantToolsItemsUnionParam) GetTransfer() *AssistantToolTransferTrans
}

// Returns a pointer to the underlying variant's property, if present.
func (u AssistantToolsItemsUnionParam) GetInvite() *AssistantToolInviteInviteParam {
func (u AssistantToolsItemsUnionParam) GetInviteConfig() *AssistantToolInviteInviteConfigParam {
if vt := u.OfInvite; vt != nil {
return &vt.Invite
return &vt.InviteConfig
}
return nil
}
Expand Down Expand Up @@ -1723,9 +1723,9 @@ func init() {
)
}

// The properties Invite, Type are required.
// The properties InviteConfig, Type are required.
type AssistantToolInviteParam struct {
Invite AssistantToolInviteInviteParam `json:"invite,omitzero" api:"required"`
InviteConfig AssistantToolInviteInviteConfigParam `json:"invite_config,omitzero" api:"required"`
// This field can be elided, and will marshal its zero value as "invite".
Type constant.Invite `json:"type" api:"required"`
paramObj
Expand All @@ -1739,26 +1739,26 @@ func (r *AssistantToolInviteParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type AssistantToolInviteInviteParam struct {
type AssistantToolInviteInviteConfigParam struct {
// Number or SIP URI placing the call.
From param.Opt[string] `json:"from,omitzero"`
// Custom headers to be added to the SIP INVITE for the invite command.
CustomHeaders []AssistantToolInviteInviteCustomHeaderParam `json:"custom_headers,omitzero"`
CustomHeaders []AssistantToolInviteInviteConfigCustomHeaderParam `json:"custom_headers,omitzero"`
// Configuration for voicemail detection (AMD - Answering Machine Detection) on the
// invited call.
VoicemailDetection AssistantToolInviteInviteVoicemailDetectionParam `json:"voicemail_detection,omitzero"`
VoicemailDetection AssistantToolInviteInviteConfigVoicemailDetectionParam `json:"voicemail_detection,omitzero"`
paramObj
}

func (r AssistantToolInviteInviteParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteParam
func (r AssistantToolInviteInviteConfigParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteConfigParam
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AssistantToolInviteInviteParam) UnmarshalJSON(data []byte) error {
func (r *AssistantToolInviteInviteConfigParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

type AssistantToolInviteInviteCustomHeaderParam struct {
type AssistantToolInviteInviteConfigCustomHeaderParam struct {
Name param.Opt[string] `json:"name,omitzero"`
// The value of the header. Note that we support mustache templating for the value.
// For example you can use
Expand All @@ -1768,60 +1768,60 @@ type AssistantToolInviteInviteCustomHeaderParam struct {
paramObj
}

func (r AssistantToolInviteInviteCustomHeaderParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteCustomHeaderParam
func (r AssistantToolInviteInviteConfigCustomHeaderParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteConfigCustomHeaderParam
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AssistantToolInviteInviteCustomHeaderParam) UnmarshalJSON(data []byte) error {
func (r *AssistantToolInviteInviteConfigCustomHeaderParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

// Configuration for voicemail detection (AMD - Answering Machine Detection) on the
// invited call.
type AssistantToolInviteInviteVoicemailDetectionParam struct {
type AssistantToolInviteInviteConfigVoicemailDetectionParam struct {
// The AMD detection mode to use. 'premium' enables premium answering machine
// detection. 'disabled' turns off AMD detection.
//
// Any of "disabled", "premium".
DetectionMode string `json:"detection_mode,omitzero"`
// Action to take when voicemail is detected on the invited call.
OnVoicemailDetected AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam `json:"on_voicemail_detected,omitzero"`
OnVoicemailDetected AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam `json:"on_voicemail_detected,omitzero"`
paramObj
}

func (r AssistantToolInviteInviteVoicemailDetectionParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteVoicemailDetectionParam
func (r AssistantToolInviteInviteConfigVoicemailDetectionParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteConfigVoicemailDetectionParam
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AssistantToolInviteInviteVoicemailDetectionParam) UnmarshalJSON(data []byte) error {
func (r *AssistantToolInviteInviteConfigVoicemailDetectionParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

func init() {
apijson.RegisterFieldValidator[AssistantToolInviteInviteVoicemailDetectionParam](
apijson.RegisterFieldValidator[AssistantToolInviteInviteConfigVoicemailDetectionParam](
"detection_mode", "disabled", "premium",
)
}

// Action to take when voicemail is detected on the invited call.
type AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam struct {
type AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam struct {
// The action to take when voicemail is detected.
//
// Any of "stop_invite".
Action string `json:"action,omitzero"`
paramObj
}

func (r AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam
func (r AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam) MarshalJSON() (data []byte, err error) {
type shadow AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam
return param.MarshalObject(r, (*shadow)(&r))
}
func (r *AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam) UnmarshalJSON(data []byte) error {
func (r *AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam) UnmarshalJSON(data []byte) error {
return apijson.UnmarshalRoot(data, r)
}

func init() {
apijson.RegisterFieldValidator[AssistantToolInviteInviteVoicemailDetectionOnVoicemailDetectedParam](
apijson.RegisterFieldValidator[AssistantToolInviteInviteConfigVoicemailDetectionOnVoicemailDetectedParam](
"action", "stop_invite",
)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/apiform/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -469,5 +469,5 @@ func WriteExtras(writer *multipart.Writer, extras map[string]any) (err error) {
break
}
}
return
return err
}
6 changes: 3 additions & 3 deletions internal/apiform/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func parseFormStructTag(field reflect.StructField) (tag parsedStructTag, ok bool
raw, ok = field.Tag.Lookup(jsonStructTag)
}
if !ok {
return
return tag, ok
}
parts := strings.Split(raw, ",")
if len(parts) == 0 {
Expand All @@ -45,7 +45,7 @@ func parseFormStructTag(field reflect.StructField) (tag parsedStructTag, ok bool
}

parseApiStructTag(field, &tag)
return
return tag, ok
}

func parseApiStructTag(field reflect.StructField, tag *parsedStructTag) {
Expand All @@ -68,5 +68,5 @@ func parseApiStructTag(field reflect.StructField, tag *parsedStructTag) {

func parseFormatStructTag(field reflect.StructField) (format string, ok bool) {
format, ok = field.Tag.Lookup(formatStructTag)
return
return format, ok
}
2 changes: 1 addition & 1 deletion internal/apijson/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func (e *encoder) newStructTypeEncoder(t reflect.Type) encoderFunc {
return nil, err
}
}
return
return json, err
}
}

Expand Down
2 changes: 1 addition & 1 deletion internal/apijson/json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ type MarshallingUnionStruct struct {
func (r *MarshallingUnionStruct) UnmarshalJSON(data []byte) (err error) {
*r = MarshallingUnionStruct{}
err = UnmarshalRoot(data, &r.Union)
return
return err
}

func (r MarshallingUnionStruct) MarshalJSON() (data []byte, err error) {
Expand Down
Loading