Skip to content

Commit 14b620f

Browse files
committed
Release v0.6.0
1 parent a7a2fe5 commit 14b620f

File tree

5 files changed

+718
-206
lines changed

5 files changed

+718
-206
lines changed

calls.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1606,6 +1606,8 @@ const (
16061606
CallEndedReasonPhoneCallProviderClosedWebsocket CallEndedReason = "phone-call-provider-closed-websocket"
16071607
CallEndedReasonSilenceTimedOut CallEndedReason = "silence-timed-out"
16081608
CallEndedReasonCallInProgressErrorSipTelephonyProviderFailedToConnectCall CallEndedReason = "call.in-progress.error-sip-telephony-provider-failed-to-connect-call"
1609+
CallEndedReasonCallRingingHookExecutedSay CallEndedReason = "call.ringing.hook-executed-say"
1610+
CallEndedReasonCallRingingHookExecutedTransfer CallEndedReason = "call.ringing.hook-executed-transfer"
16091611
CallEndedReasonTwilioFailedToConnectCall CallEndedReason = "twilio-failed-to-connect-call"
16101612
CallEndedReasonTwilioReportedCustomerMisdialed CallEndedReason = "twilio-reported-customer-misdialed"
16111613
CallEndedReasonVonageRejected CallEndedReason = "vonage-rejected"
@@ -2570,6 +2572,10 @@ func NewCallEndedReasonFromString(s string) (CallEndedReason, error) {
25702572
return CallEndedReasonSilenceTimedOut, nil
25712573
case "call.in-progress.error-sip-telephony-provider-failed-to-connect-call":
25722574
return CallEndedReasonCallInProgressErrorSipTelephonyProviderFailedToConnectCall, nil
2575+
case "call.ringing.hook-executed-say":
2576+
return CallEndedReasonCallRingingHookExecutedSay, nil
2577+
case "call.ringing.hook-executed-transfer":
2578+
return CallEndedReasonCallRingingHookExecutedTransfer, nil
25732579
case "twilio-failed-to-connect-call":
25742580
return CallEndedReasonTwilioFailedToConnectCall, nil
25752581
case "twilio-reported-customer-misdialed":
@@ -3071,6 +3077,8 @@ type ImportTwilioPhoneNumberDto struct {
30713077
//
30723078
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
30733079
FallbackDestination *ImportTwilioPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
3080+
// This is the hooks that will be used for incoming calls to this phone number.
3081+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
30743082
// These are the digits of the phone number you own on your Twilio.
30753083
TwilioPhoneNumber string `json:"twilioPhoneNumber" url:"twilioPhoneNumber"`
30763084
// This is your Twilio Account SID that will be used to handle this phone number.
@@ -3107,6 +3115,13 @@ func (i *ImportTwilioPhoneNumberDto) GetFallbackDestination() *ImportTwilioPhone
31073115
return i.FallbackDestination
31083116
}
31093117

3118+
func (i *ImportTwilioPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
3119+
if i == nil {
3120+
return nil
3121+
}
3122+
return i.Hooks
3123+
}
3124+
31103125
func (i *ImportTwilioPhoneNumberDto) GetTwilioPhoneNumber() string {
31113126
if i == nil {
31123127
return ""

core/request_option.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ func (r *RequestOptions) cloneHeader() http.Header {
5656
headers := r.HTTPHeader.Clone()
5757
headers.Set("X-Fern-Language", "Go")
5858
headers.Set("X-Fern-SDK-Name", "github.com/VapiAI/server-sdk-go")
59-
headers.Set("X-Fern-SDK-Version", "v0.5.1")
60-
headers.Set("User-Agent", "github.com/VapiAI/server-sdk-go/v0.5.1")
59+
headers.Set("X-Fern-SDK-Version", "v0.6.0")
60+
headers.Set("User-Agent", "github.com/VapiAI/server-sdk-go/v0.6.0")
6161
return headers
6262
}
6363

phone_numbers.go

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ type ByoPhoneNumber struct {
3838
//
3939
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
4040
FallbackDestination *ByoPhoneNumberFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
41+
// This is the hooks that will be used for incoming calls to this phone number.
42+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
4143
// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.
4244
//
4345
// Use cases:
@@ -95,6 +97,13 @@ func (b *ByoPhoneNumber) GetFallbackDestination() *ByoPhoneNumberFallbackDestina
9597
return b.FallbackDestination
9698
}
9799

100+
func (b *ByoPhoneNumber) GetHooks() []*PhoneNumberHookCallRinging {
101+
if b == nil {
102+
return nil
103+
}
104+
return b.Hooks
105+
}
106+
98107
func (b *ByoPhoneNumber) GetNumberE164CheckEnabled() *bool {
99108
if b == nil {
100109
return nil
@@ -346,6 +355,8 @@ type CreateByoPhoneNumberDto struct {
346355
//
347356
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
348357
FallbackDestination *CreateByoPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
358+
// This is the hooks that will be used for incoming calls to this phone number.
359+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
349360
// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.
350361
//
351362
// Use cases:
@@ -393,6 +404,13 @@ func (c *CreateByoPhoneNumberDto) GetFallbackDestination() *CreateByoPhoneNumber
393404
return c.FallbackDestination
394405
}
395406

407+
func (c *CreateByoPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
408+
if c == nil {
409+
return nil
410+
}
411+
return c.Hooks
412+
}
413+
396414
func (c *CreateByoPhoneNumberDto) GetNumberE164CheckEnabled() *bool {
397415
if c == nil {
398416
return nil
@@ -575,6 +593,8 @@ type CreateTelnyxPhoneNumberDto struct {
575593
//
576594
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
577595
FallbackDestination *CreateTelnyxPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
596+
// This is the hooks that will be used for incoming calls to this phone number.
597+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
578598
// These are the digits of the phone number you own on your Telnyx.
579599
Number string `json:"number" url:"number"`
580600
// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups.
@@ -610,6 +630,13 @@ func (c *CreateTelnyxPhoneNumberDto) GetFallbackDestination() *CreateTelnyxPhone
610630
return c.FallbackDestination
611631
}
612632

633+
func (c *CreateTelnyxPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
634+
if c == nil {
635+
return nil
636+
}
637+
return c.Hooks
638+
}
639+
613640
func (c *CreateTelnyxPhoneNumberDto) GetNumber() string {
614641
if c == nil {
615642
return ""
@@ -785,6 +812,8 @@ type CreateTwilioPhoneNumberDto struct {
785812
//
786813
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
787814
FallbackDestination *CreateTwilioPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
815+
// This is the hooks that will be used for incoming calls to this phone number.
816+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
788817
// These are the digits of the phone number you own on your Twilio.
789818
Number string `json:"number" url:"number"`
790819
// This is the Twilio Account SID for the phone number.
@@ -822,6 +851,13 @@ func (c *CreateTwilioPhoneNumberDto) GetFallbackDestination() *CreateTwilioPhone
822851
return c.FallbackDestination
823852
}
824853

854+
func (c *CreateTwilioPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
855+
if c == nil {
856+
return nil
857+
}
858+
return c.Hooks
859+
}
860+
825861
func (c *CreateTwilioPhoneNumberDto) GetNumber() string {
826862
if c == nil {
827863
return ""
@@ -1004,6 +1040,8 @@ type CreateVapiPhoneNumberDto struct {
10041040
//
10051041
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
10061042
FallbackDestination *CreateVapiPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
1043+
// This is the hooks that will be used for incoming calls to this phone number.
1044+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
10071045
// This is the area code of the phone number to purchase.
10081046
NumberDesiredAreaCode *string `json:"numberDesiredAreaCode,omitempty" url:"numberDesiredAreaCode,omitempty"`
10091047
// This is the SIP URI of the phone number. You can SIP INVITE this. The assistant attached to this number will answer.
@@ -1045,6 +1083,13 @@ func (c *CreateVapiPhoneNumberDto) GetFallbackDestination() *CreateVapiPhoneNumb
10451083
return c.FallbackDestination
10461084
}
10471085

1086+
func (c *CreateVapiPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
1087+
if c == nil {
1088+
return nil
1089+
}
1090+
return c.Hooks
1091+
}
1092+
10481093
func (c *CreateVapiPhoneNumberDto) GetNumberDesiredAreaCode() *string {
10491094
if c == nil {
10501095
return nil
@@ -1227,6 +1272,8 @@ type CreateVonagePhoneNumberDto struct {
12271272
//
12281273
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
12291274
FallbackDestination *CreateVonagePhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
1275+
// This is the hooks that will be used for incoming calls to this phone number.
1276+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
12301277
// These are the digits of the phone number you own on your Vonage.
12311278
Number string `json:"number" url:"number"`
12321279
// This is the credential you added in dashboard.vapi.ai/keys. This is used to configure the number to send inbound calls to Vapi, make outbound calls and do live call updates like transfers and hangups.
@@ -1262,6 +1309,13 @@ func (c *CreateVonagePhoneNumberDto) GetFallbackDestination() *CreateVonagePhone
12621309
return c.FallbackDestination
12631310
}
12641311

1312+
func (c *CreateVonagePhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
1313+
if c == nil {
1314+
return nil
1315+
}
1316+
return c.Hooks
1317+
}
1318+
12651319
func (c *CreateVonagePhoneNumberDto) GetNumber() string {
12661320
if c == nil {
12671321
return ""
@@ -1502,6 +1556,8 @@ type TelnyxPhoneNumber struct {
15021556
//
15031557
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
15041558
FallbackDestination *TelnyxPhoneNumberFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
1559+
// This is the hooks that will be used for incoming calls to this phone number.
1560+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
15051561
// This is the unique identifier for the phone number.
15061562
Id string `json:"id" url:"id"`
15071563
// This is the unique identifier for the org that this phone number belongs to.
@@ -1547,6 +1603,13 @@ func (t *TelnyxPhoneNumber) GetFallbackDestination() *TelnyxPhoneNumberFallbackD
15471603
return t.FallbackDestination
15481604
}
15491605

1606+
func (t *TelnyxPhoneNumber) GetHooks() []*PhoneNumberHookCallRinging {
1607+
if t == nil {
1608+
return nil
1609+
}
1610+
return t.Hooks
1611+
}
1612+
15501613
func (t *TelnyxPhoneNumber) GetId() string {
15511614
if t == nil {
15521615
return ""
@@ -1791,6 +1854,8 @@ type TwilioPhoneNumber struct {
17911854
//
17921855
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
17931856
FallbackDestination *TwilioPhoneNumberFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
1857+
// This is the hooks that will be used for incoming calls to this phone number.
1858+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
17941859
// This is the unique identifier for the phone number.
17951860
Id string `json:"id" url:"id"`
17961861
// This is the unique identifier for the org that this phone number belongs to.
@@ -1838,6 +1903,13 @@ func (t *TwilioPhoneNumber) GetFallbackDestination() *TwilioPhoneNumberFallbackD
18381903
return t.FallbackDestination
18391904
}
18401905

1906+
func (t *TwilioPhoneNumber) GetHooks() []*PhoneNumberHookCallRinging {
1907+
if t == nil {
1908+
return nil
1909+
}
1910+
return t.Hooks
1911+
}
1912+
18411913
func (t *TwilioPhoneNumber) GetId() string {
18421914
if t == nil {
18431915
return ""
@@ -2089,6 +2161,8 @@ type UpdateByoPhoneNumberDto struct {
20892161
//
20902162
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
20912163
FallbackDestination *UpdateByoPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
2164+
// This is the hooks that will be used for incoming calls to this phone number.
2165+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
20922166
// This is the flag to toggle the E164 check for the `number` field. This is an advanced property which should be used if you know your use case requires it.
20932167
//
20942168
// Use cases:
@@ -2135,6 +2209,13 @@ func (u *UpdateByoPhoneNumberDto) GetFallbackDestination() *UpdateByoPhoneNumber
21352209
return u.FallbackDestination
21362210
}
21372211

2212+
func (u *UpdateByoPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
2213+
if u == nil {
2214+
return nil
2215+
}
2216+
return u.Hooks
2217+
}
2218+
21382219
func (u *UpdateByoPhoneNumberDto) GetNumberE164CheckEnabled() *bool {
21392220
if u == nil {
21402221
return nil
@@ -2292,6 +2373,8 @@ type UpdateTelnyxPhoneNumberDto struct {
22922373
//
22932374
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
22942375
FallbackDestination *UpdateTelnyxPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
2376+
// This is the hooks that will be used for incoming calls to this phone number.
2377+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
22952378
// This is the name of the phone number. This is just for your own reference.
22962379
Name *string `json:"name,omitempty" url:"name,omitempty"`
22972380
// This is the assistant that will be used for incoming calls to this phone number.
@@ -2326,6 +2409,13 @@ func (u *UpdateTelnyxPhoneNumberDto) GetFallbackDestination() *UpdateTelnyxPhone
23262409
return u.FallbackDestination
23272410
}
23282411

2412+
func (u *UpdateTelnyxPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
2413+
if u == nil {
2414+
return nil
2415+
}
2416+
return u.Hooks
2417+
}
2418+
23292419
func (u *UpdateTelnyxPhoneNumberDto) GetName() *string {
23302420
if u == nil {
23312421
return nil
@@ -2476,6 +2566,8 @@ type UpdateTwilioPhoneNumberDto struct {
24762566
//
24772567
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
24782568
FallbackDestination *UpdateTwilioPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
2569+
// This is the hooks that will be used for incoming calls to this phone number.
2570+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
24792571
// This is the name of the phone number. This is just for your own reference.
24802572
Name *string `json:"name,omitempty" url:"name,omitempty"`
24812573
// This is the assistant that will be used for incoming calls to this phone number.
@@ -2512,6 +2604,13 @@ func (u *UpdateTwilioPhoneNumberDto) GetFallbackDestination() *UpdateTwilioPhone
25122604
return u.FallbackDestination
25132605
}
25142606

2607+
func (u *UpdateTwilioPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
2608+
if u == nil {
2609+
return nil
2610+
}
2611+
return u.Hooks
2612+
}
2613+
25152614
func (u *UpdateTwilioPhoneNumberDto) GetName() *string {
25162615
if u == nil {
25172616
return nil
@@ -2669,6 +2768,8 @@ type UpdateVapiPhoneNumberDto struct {
26692768
//
26702769
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
26712770
FallbackDestination *UpdateVapiPhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
2771+
// This is the hooks that will be used for incoming calls to this phone number.
2772+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
26722773
// This is the name of the phone number. This is just for your own reference.
26732774
Name *string `json:"name,omitempty" url:"name,omitempty"`
26742775
// This is the assistant that will be used for incoming calls to this phone number.
@@ -2707,6 +2808,13 @@ func (u *UpdateVapiPhoneNumberDto) GetFallbackDestination() *UpdateVapiPhoneNumb
27072808
return u.FallbackDestination
27082809
}
27092810

2811+
func (u *UpdateVapiPhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
2812+
if u == nil {
2813+
return nil
2814+
}
2815+
return u.Hooks
2816+
}
2817+
27102818
func (u *UpdateVapiPhoneNumberDto) GetName() *string {
27112819
if u == nil {
27122820
return nil
@@ -2857,6 +2965,8 @@ type UpdateVonagePhoneNumberDto struct {
28572965
//
28582966
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
28592967
FallbackDestination *UpdateVonagePhoneNumberDtoFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
2968+
// This is the hooks that will be used for incoming calls to this phone number.
2969+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
28602970
// This is the name of the phone number. This is just for your own reference.
28612971
Name *string `json:"name,omitempty" url:"name,omitempty"`
28622972
// This is the assistant that will be used for incoming calls to this phone number.
@@ -2891,6 +3001,13 @@ func (u *UpdateVonagePhoneNumberDto) GetFallbackDestination() *UpdateVonagePhone
28913001
return u.FallbackDestination
28923002
}
28933003

3004+
func (u *UpdateVonagePhoneNumberDto) GetHooks() []*PhoneNumberHookCallRinging {
3005+
if u == nil {
3006+
return nil
3007+
}
3008+
return u.Hooks
3009+
}
3010+
28943011
func (u *UpdateVonagePhoneNumberDto) GetName() *string {
28953012
if u == nil {
28963013
return nil
@@ -3041,6 +3158,8 @@ type VapiPhoneNumber struct {
30413158
//
30423159
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
30433160
FallbackDestination *VapiPhoneNumberFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
3161+
// This is the hooks that will be used for incoming calls to this phone number.
3162+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
30443163
// This is the unique identifier for the phone number.
30453164
Id string `json:"id" url:"id"`
30463165
// This is the unique identifier for the org that this phone number belongs to.
@@ -3094,6 +3213,13 @@ func (v *VapiPhoneNumber) GetFallbackDestination() *VapiPhoneNumberFallbackDesti
30943213
return v.FallbackDestination
30953214
}
30963215

3216+
func (v *VapiPhoneNumber) GetHooks() []*PhoneNumberHookCallRinging {
3217+
if v == nil {
3218+
return nil
3219+
}
3220+
return v.Hooks
3221+
}
3222+
30973223
func (v *VapiPhoneNumber) GetId() string {
30983224
if v == nil {
30993225
return ""
@@ -3352,6 +3478,8 @@ type VonagePhoneNumber struct {
33523478
//
33533479
// If this is not set and above conditions are met, the inbound call is hung up with an error message.
33543480
FallbackDestination *VonagePhoneNumberFallbackDestination `json:"fallbackDestination,omitempty" url:"fallbackDestination,omitempty"`
3481+
// This is the hooks that will be used for incoming calls to this phone number.
3482+
Hooks []*PhoneNumberHookCallRinging `json:"hooks,omitempty" url:"hooks,omitempty"`
33553483
// This is the unique identifier for the phone number.
33563484
Id string `json:"id" url:"id"`
33573485
// This is the unique identifier for the org that this phone number belongs to.
@@ -3397,6 +3525,13 @@ func (v *VonagePhoneNumber) GetFallbackDestination() *VonagePhoneNumberFallbackD
33973525
return v.FallbackDestination
33983526
}
33993527

3528+
func (v *VonagePhoneNumber) GetHooks() []*PhoneNumberHookCallRinging {
3529+
if v == nil {
3530+
return nil
3531+
}
3532+
return v.Hooks
3533+
}
3534+
34003535
func (v *VonagePhoneNumber) GetId() string {
34013536
if v == nil {
34023537
return ""

0 commit comments

Comments
 (0)