Skip to content

Commit

Permalink
Merge branch 'main' into pass_query_param_in_delete
Browse files Browse the repository at this point in the history
  • Loading branch information
tiwarishubham635 authored Dec 6, 2024
2 parents ff519a2 + ea68910 commit 7761727
Show file tree
Hide file tree
Showing 10 changed files with 341 additions and 1 deletion.
16 changes: 16 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
twilio-go changelog
====================
[2024-12-05] Version 1.23.7
---------------------------
**Api**
- Add optional parameter `intelligence_service` to `transcription`
- Updated `phone_number_sid` to be populated for sip trunking terminating calls.

**Numbers**
- Add Update Hosted Number Order V2 API endpoint
- Update Port in docs

**Twiml**
- Add optional parameter `intelligence_service` to `<Transcription>`
- Add support for new `<ConversationRelay>` and `<Assistant>` noun
- Add `events` attribute to `<Dial>` verb


[2024-11-15] Version 1.23.6
---------------------------
**Api**
Expand Down
2 changes: 1 addition & 1 deletion client/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
package client

// LibraryVersion specifies the current version of twilio-go.
const LibraryVersion = "1.23.6"
const LibraryVersion = "1.23.7"
9 changes: 9 additions & 0 deletions rest/api/v2010/accounts_calls_transcriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ type CreateRealtimeTranscriptionParams struct {
Hints *string `json:"Hints,omitempty"`
// The provider will add punctuation to recognition result
EnableAutomaticPunctuation *bool `json:"EnableAutomaticPunctuation,omitempty"`
// The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription.
IntelligenceService *string `json:"IntelligenceService,omitempty"`
}

func (params *CreateRealtimeTranscriptionParams) SetPathAccountSid(PathAccountSid string) *CreateRealtimeTranscriptionParams {
Expand Down Expand Up @@ -109,6 +111,10 @@ func (params *CreateRealtimeTranscriptionParams) SetEnableAutomaticPunctuation(E
params.EnableAutomaticPunctuation = &EnableAutomaticPunctuation
return params
}
func (params *CreateRealtimeTranscriptionParams) SetIntelligenceService(IntelligenceService string) *CreateRealtimeTranscriptionParams {
params.IntelligenceService = &IntelligenceService
return params
}

// Create a Transcription
func (c *ApiService) CreateRealtimeTranscription(CallSid string, params *CreateRealtimeTranscriptionParams) (*ApiV2010RealtimeTranscription, error) {
Expand Down Expand Up @@ -164,6 +170,9 @@ func (c *ApiService) CreateRealtimeTranscription(CallSid string, params *CreateR
if params != nil && params.EnableAutomaticPunctuation != nil {
data.Set("EnableAutomaticPunctuation", fmt.Sprint(*params.EnableAutomaticPunctuation))
}
if params != nil && params.IntelligenceService != nil {
data.Set("IntelligenceService", *params.IntelligenceService)
}

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions rest/api/v2010/docs/AccountsCallsTranscriptionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Name | Type | Description
**SpeechModel** | **string** | Recognition model used by the transcription engine, among those supported by the provider
**Hints** | **string** | A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them.
**EnableAutomaticPunctuation** | **bool** | The provider will add punctuation to recognition result
**IntelligenceService** | **string** | The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription.

### Return type

Expand Down
1 change: 1 addition & 0 deletions rest/numbers/v2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Class | Method | HTTP request | Description
*HostedNumberOrdersApi* | [**DeleteHostedNumberOrder**](docs/HostedNumberOrdersApi.md#deletehostednumberorder) | **Delete** /v2/HostedNumber/Orders/{Sid} |
*HostedNumberOrdersApi* | [**FetchHostedNumberOrder**](docs/HostedNumberOrdersApi.md#fetchhostednumberorder) | **Get** /v2/HostedNumber/Orders/{Sid} |
*HostedNumberOrdersApi* | [**ListHostedNumberOrder**](docs/HostedNumberOrdersApi.md#listhostednumberorder) | **Get** /v2/HostedNumber/Orders |
*HostedNumberOrdersApi* | [**UpdateHostedNumberOrder**](docs/HostedNumberOrdersApi.md#updatehostednumberorder) | **Post** /v2/HostedNumber/Orders/{Sid} |
*HostedNumberOrdersBulkApi* | [**CreateBulkHostedNumberOrder**](docs/HostedNumberOrdersBulkApi.md#createbulkhostednumberorder) | **Post** /v2/HostedNumber/Orders/Bulk |
*HostedNumberOrdersBulkApi* | [**FetchBulkHostedNumberOrder**](docs/HostedNumberOrdersBulkApi.md#fetchbulkhostednumberorder) | **Get** /v2/HostedNumber/Orders/Bulk/{BulkHostingSid} |
*RegulatoryComplianceBundlesApi* | [**CreateBundle**](docs/RegulatoryComplianceBundlesApi.md#createbundle) | **Post** /v2/RegulatoryCompliance/Bundles |
Expand Down
46 changes: 46 additions & 0 deletions rest/numbers/v2/docs/HostedNumberOrdersApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Method | HTTP request | Description
[**DeleteHostedNumberOrder**](HostedNumberOrdersApi.md#DeleteHostedNumberOrder) | **Delete** /v2/HostedNumber/Orders/{Sid} |
[**FetchHostedNumberOrder**](HostedNumberOrdersApi.md#FetchHostedNumberOrder) | **Get** /v2/HostedNumber/Orders/{Sid} |
[**ListHostedNumberOrder**](HostedNumberOrdersApi.md#ListHostedNumberOrder) | **Get** /v2/HostedNumber/Orders |
[**UpdateHostedNumberOrder**](HostedNumberOrdersApi.md#UpdateHostedNumberOrder) | **Post** /v2/HostedNumber/Orders/{Sid} |



Expand Down Expand Up @@ -193,3 +194,48 @@ Name | Type | Description
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)


## UpdateHostedNumberOrder

> NumbersV2HostedNumberOrder UpdateHostedNumberOrder(ctx, Sidoptional)


Updates a specific HostedNumberOrder.

### Path Parameters


Name | Type | Description
------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**Sid** | **string** | The SID of the HostedNumberOrder resource to update.

### Other Parameters

Other parameters are passed through a pointer to a UpdateHostedNumberOrderParams struct


Name | Type | Description
------------- | ------------- | -------------
**Status** | **string** |
**VerificationCallDelay** | **int** | The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
**VerificationCallExtension** | **string** | The numerical extension to dial when making the ownership verification call.

### Return type

[**NumbersV2HostedNumberOrder**](NumbersV2HostedNumberOrder.md)

### Authorization

[accountSid_authToken](../README.md#accountSid_authToken)

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: application/json

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
[[Back to Model list]](../README.md#documentation-for-models)
[[Back to README]](../README.md)

6 changes: 6 additions & 0 deletions rest/numbers/v2/docs/NumbersV2HostedNumberOrder.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Name | Type | Description | Notes
**ContactPhoneNumber** | Pointer to **string** | The contact phone number of the person authorized to sign the Authorization Document. |
**BulkHostingRequestSid** | Pointer to **string** | A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder. |
**NextStep** | Pointer to **string** | The next step you need to take to complete the hosted number order and request it successfully. |
**VerificationAttempts** | **int** | The number of attempts made to verify ownership via a call for the hosted phone number. |[optional] [default to 0]
**VerificationCallSids** | Pointer to **[]string** | The Call SIDs that identify the calls placed to verify ownership. |
**VerificationCallDelay** | **int** | The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. |[optional] [default to 0]
**VerificationCallExtension** | Pointer to **string** | The numerical extension to dial when making the ownership verification call. |
**VerificationCode** | Pointer to **string** | The digits the user must pass in the ownership verification call. |
**VerificationType** | Pointer to [**string**](HostedNumberOrderEnumVerificationType.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
58 changes: 58 additions & 0 deletions rest/numbers/v2/hosted_number_orders.go
Original file line number Diff line number Diff line change
Expand Up @@ -426,3 +426,61 @@ func (c *ApiService) getNextListHostedNumberOrderResponse(nextPageUrl string) (i
}
return ps, nil
}

// Optional parameters for the method 'UpdateHostedNumberOrder'
type UpdateHostedNumberOrderParams struct {
//
Status *string `json:"Status,omitempty"`
// The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
VerificationCallDelay *int `json:"VerificationCallDelay,omitempty"`
// The numerical extension to dial when making the ownership verification call.
VerificationCallExtension *string `json:"VerificationCallExtension,omitempty"`
}

func (params *UpdateHostedNumberOrderParams) SetStatus(Status string) *UpdateHostedNumberOrderParams {
params.Status = &Status
return params
}
func (params *UpdateHostedNumberOrderParams) SetVerificationCallDelay(VerificationCallDelay int) *UpdateHostedNumberOrderParams {
params.VerificationCallDelay = &VerificationCallDelay
return params
}
func (params *UpdateHostedNumberOrderParams) SetVerificationCallExtension(VerificationCallExtension string) *UpdateHostedNumberOrderParams {
params.VerificationCallExtension = &VerificationCallExtension
return params
}

// Updates a specific HostedNumberOrder.
func (c *ApiService) UpdateHostedNumberOrder(Sid string, params *UpdateHostedNumberOrderParams) (*NumbersV2HostedNumberOrder, error) {
path := "/v2/HostedNumber/Orders/{Sid}"
path = strings.Replace(path, "{"+"Sid"+"}", Sid, -1)

data := url.Values{}
headers := map[string]interface{}{
"Content-Type": "application/x-www-form-urlencoded",
}

if params != nil && params.Status != nil {
data.Set("Status", *params.Status)
}
if params != nil && params.VerificationCallDelay != nil {
data.Set("VerificationCallDelay", fmt.Sprint(*params.VerificationCallDelay))
}
if params != nil && params.VerificationCallExtension != nil {
data.Set("VerificationCallExtension", *params.VerificationCallExtension)
}

resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()

ps := &NumbersV2HostedNumberOrder{}
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
return nil, err
}

return ps, err
}
11 changes: 11 additions & 0 deletions rest/numbers/v2/model_numbers_v2_hosted_number_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,15 @@ type NumbersV2HostedNumberOrder struct {
BulkHostingRequestSid *string `json:"bulk_hosting_request_sid,omitempty"`
// The next step you need to take to complete the hosted number order and request it successfully.
NextStep *string `json:"next_step,omitempty"`
// The number of attempts made to verify ownership via a call for the hosted phone number.
VerificationAttempts int `json:"verification_attempts,omitempty"`
// The Call SIDs that identify the calls placed to verify ownership.
VerificationCallSids *[]string `json:"verification_call_sids,omitempty"`
// The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive.
VerificationCallDelay int `json:"verification_call_delay,omitempty"`
// The numerical extension to dial when making the ownership verification call.
VerificationCallExtension *string `json:"verification_call_extension,omitempty"`
// The digits the user must pass in the ownership verification call.
VerificationCode *string `json:"verification_code,omitempty"`
VerificationType *string `json:"verification_type,omitempty"`
}
Loading

0 comments on commit 7761727

Please sign in to comment.