Skip to content

Commit e0a5057

Browse files
committed
[Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 1852557f82faade033dbd5bd0615c9e1aa4d9fae
1 parent a8cce53 commit e0a5057

15 files changed

+723
-0
lines changed

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
twilio-go changelog
22
====================
3+
[2024-10-24] Version 1.23.5
4+
---------------------------
5+
**Conversations**
6+
- Expose ConversationWithParticipants resource that allows creating a conversation with participants
7+
8+
39
[2024-10-17] Version 1.23.4
410
---------------------------
511
**Api**

rest/assistants/v1/docs/AssistantsV1KnowledgeChunkWithScore.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
1010
**DateCreated** | [**time.Time**](time.Time.md) | The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. |[optional]
1111
**DateUpdated** | [**time.Time**](time.Time.md) | The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. |[optional]
1212
**Score** | **float32** | The score associated with the chunk. |[optional]
13+
**KnowledgeId** | **string** | The knowledge ID associated with the chunk. |[optional]
1314

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

rest/assistants/v1/model_assistants_v1_knowledge_chunk_with_score.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ type AssistantsV1KnowledgeChunkWithScore struct {
3535
DateUpdated time.Time `json:"date_updated,omitempty"`
3636
// The score associated with the chunk.
3737
Score float32 `json:"score,omitempty"`
38+
// The knowledge ID associated with the chunk.
39+
KnowledgeId string `json:"knowledge_id,omitempty"`
3840
}
3941

4042
func (response *AssistantsV1KnowledgeChunkWithScore) UnmarshalJSON(bytes []byte) (err error) {
@@ -45,6 +47,7 @@ func (response *AssistantsV1KnowledgeChunkWithScore) UnmarshalJSON(bytes []byte)
4547
DateCreated time.Time `json:"date_created"`
4648
DateUpdated time.Time `json:"date_updated"`
4749
Score interface{} `json:"score"`
50+
KnowledgeId string `json:"knowledge_id"`
4851
}{}
4952

5053
if err = json.Unmarshal(bytes, &raw); err != nil {
@@ -57,6 +60,7 @@ func (response *AssistantsV1KnowledgeChunkWithScore) UnmarshalJSON(bytes []byte)
5760
Metadata: raw.Metadata,
5861
DateCreated: raw.DateCreated,
5962
DateUpdated: raw.DateUpdated,
63+
KnowledgeId: raw.KnowledgeId,
6064
}
6165

6266
responseScore, err := client.UnmarshalFloat32(&raw.Score)

rest/conversations/v1/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Class | Method | HTTP request | Description
4040
*ConfigurationAddressesApi* | [**UpdateConfigurationAddress**](docs/ConfigurationAddressesApi.md#updateconfigurationaddress) | **Post** /v1/Configuration/Addresses/{Sid} |
4141
*ConfigurationWebhooksApi* | [**FetchConfigurationWebhook**](docs/ConfigurationWebhooksApi.md#fetchconfigurationwebhook) | **Get** /v1/Configuration/Webhooks |
4242
*ConfigurationWebhooksApi* | [**UpdateConfigurationWebhook**](docs/ConfigurationWebhooksApi.md#updateconfigurationwebhook) | **Post** /v1/Configuration/Webhooks |
43+
*ConversationWithParticipantsApi* | [**CreateConversationWithParticipants**](docs/ConversationWithParticipantsApi.md#createconversationwithparticipants) | **Post** /v1/ConversationWithParticipants |
4344
*ConversationsApi* | [**CreateConversation**](docs/ConversationsApi.md#createconversation) | **Post** /v1/Conversations |
4445
*ConversationsApi* | [**DeleteConversation**](docs/ConversationsApi.md#deleteconversation) | **Delete** /v1/Conversations/{Sid} |
4546
*ConversationsApi* | [**FetchConversation**](docs/ConversationsApi.md#fetchconversation) | **Get** /v1/Conversations/{Sid} |
@@ -86,6 +87,7 @@ Class | Method | HTTP request | Description
8687
*ServicesConfigurationNotificationsApi* | [**UpdateServiceNotification**](docs/ServicesConfigurationNotificationsApi.md#updateservicenotification) | **Post** /v1/Services/{ChatServiceSid}/Configuration/Notifications |
8788
*ServicesConfigurationWebhooksApi* | [**FetchServiceWebhookConfiguration**](docs/ServicesConfigurationWebhooksApi.md#fetchservicewebhookconfiguration) | **Get** /v1/Services/{ChatServiceSid}/Configuration/Webhooks |
8889
*ServicesConfigurationWebhooksApi* | [**UpdateServiceWebhookConfiguration**](docs/ServicesConfigurationWebhooksApi.md#updateservicewebhookconfiguration) | **Post** /v1/Services/{ChatServiceSid}/Configuration/Webhooks |
90+
*ServicesConversationWithParticipantsApi* | [**CreateServiceConversationWithParticipants**](docs/ServicesConversationWithParticipantsApi.md#createserviceconversationwithparticipants) | **Post** /v1/Services/{ChatServiceSid}/ConversationWithParticipants |
8991
*ServicesConversationsApi* | [**CreateServiceConversation**](docs/ServicesConversationsApi.md#createserviceconversation) | **Post** /v1/Services/{ChatServiceSid}/Conversations |
9092
*ServicesConversationsApi* | [**DeleteServiceConversation**](docs/ServicesConversationsApi.md#deleteserviceconversation) | **Delete** /v1/Services/{ChatServiceSid}/Conversations/{Sid} |
9193
*ServicesConversationsApi* | [**FetchServiceConversation**](docs/ServicesConversationsApi.md#fetchserviceconversation) | **Get** /v1/Services/{ChatServiceSid}/Conversations/{Sid} |
@@ -153,6 +155,7 @@ Class | Method | HTTP request | Description
153155
- [ListConversationMessageResponse](docs/ListConversationMessageResponse.md)
154156
- [ConversationsV1ConfigurationWebhook](docs/ConversationsV1ConfigurationWebhook.md)
155157
- [ConversationsV1Credential](docs/ConversationsV1Credential.md)
158+
- [ConversationsV1ConversationWithParticipants](docs/ConversationsV1ConversationWithParticipants.md)
156159
- [ConversationsV1UserConversation](docs/ConversationsV1UserConversation.md)
157160
- [ConversationsV1Conversation](docs/ConversationsV1Conversation.md)
158161
- [ConversationsV1ServiceConversationMessageReceipt](docs/ConversationsV1ServiceConversationMessageReceipt.md)
@@ -168,6 +171,7 @@ Class | Method | HTTP request | Description
168171
- [ConversationsV1ServiceUser](docs/ConversationsV1ServiceUser.md)
169172
- [ListConversationParticipantResponse](docs/ListConversationParticipantResponse.md)
170173
- [ListServiceConversationParticipantResponse](docs/ListServiceConversationParticipantResponse.md)
174+
- [ConversationsV1ServiceConversationWithParticipants](docs/ConversationsV1ServiceConversationWithParticipants.md)
171175
- [ListCredentialResponse](docs/ListCredentialResponse.md)
172176
- [ListServiceBindingResponse](docs/ListServiceBindingResponse.md)
173177
- [ListRoleResponse](docs/ListRoleResponse.md)
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/*
2+
* This code was generated by
3+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
4+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
5+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
6+
*
7+
* Twilio - Conversations
8+
* This is the public Twilio REST API.
9+
*
10+
* NOTE: This class is auto generated by OpenAPI Generator.
11+
* https://openapi-generator.tech
12+
* Do not edit the class manually.
13+
*/
14+
15+
package openapi
16+
17+
import (
18+
"encoding/json"
19+
"fmt"
20+
"net/url"
21+
"time"
22+
)
23+
24+
// Optional parameters for the method 'CreateConversationWithParticipants'
25+
type CreateConversationWithParticipantsParams struct {
26+
// The X-Twilio-Webhook-Enabled HTTP request header
27+
XTwilioWebhookEnabled *string `json:"X-Twilio-Webhook-Enabled,omitempty"`
28+
// The human-readable name of this conversation, limited to 256 characters. Optional.
29+
FriendlyName *string `json:"FriendlyName,omitempty"`
30+
// An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL.
31+
UniqueName *string `json:"UniqueName,omitempty"`
32+
// The date that this resource was created.
33+
DateCreated *time.Time `json:"DateCreated,omitempty"`
34+
// The date that this resource was last updated.
35+
DateUpdated *time.Time `json:"DateUpdated,omitempty"`
36+
// The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
37+
MessagingServiceSid *string `json:"MessagingServiceSid,omitempty"`
38+
// An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned.
39+
Attributes *string `json:"Attributes,omitempty"`
40+
//
41+
State *string `json:"State,omitempty"`
42+
// ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
43+
TimersInactive *string `json:"Timers.Inactive,omitempty"`
44+
// ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes.
45+
TimersClosed *string `json:"Timers.Closed,omitempty"`
46+
// The default email address that will be used when sending outbound emails in this conversation.
47+
BindingsEmailAddress *string `json:"Bindings.Email.Address,omitempty"`
48+
// The default name that will be used when sending outbound emails in this conversation.
49+
BindingsEmailName *string `json:"Bindings.Email.Name,omitempty"`
50+
// The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10.
51+
Participant *[]string `json:"Participant,omitempty"`
52+
}
53+
54+
func (params *CreateConversationWithParticipantsParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnabled string) *CreateConversationWithParticipantsParams {
55+
params.XTwilioWebhookEnabled = &XTwilioWebhookEnabled
56+
return params
57+
}
58+
func (params *CreateConversationWithParticipantsParams) SetFriendlyName(FriendlyName string) *CreateConversationWithParticipantsParams {
59+
params.FriendlyName = &FriendlyName
60+
return params
61+
}
62+
func (params *CreateConversationWithParticipantsParams) SetUniqueName(UniqueName string) *CreateConversationWithParticipantsParams {
63+
params.UniqueName = &UniqueName
64+
return params
65+
}
66+
func (params *CreateConversationWithParticipantsParams) SetDateCreated(DateCreated time.Time) *CreateConversationWithParticipantsParams {
67+
params.DateCreated = &DateCreated
68+
return params
69+
}
70+
func (params *CreateConversationWithParticipantsParams) SetDateUpdated(DateUpdated time.Time) *CreateConversationWithParticipantsParams {
71+
params.DateUpdated = &DateUpdated
72+
return params
73+
}
74+
func (params *CreateConversationWithParticipantsParams) SetMessagingServiceSid(MessagingServiceSid string) *CreateConversationWithParticipantsParams {
75+
params.MessagingServiceSid = &MessagingServiceSid
76+
return params
77+
}
78+
func (params *CreateConversationWithParticipantsParams) SetAttributes(Attributes string) *CreateConversationWithParticipantsParams {
79+
params.Attributes = &Attributes
80+
return params
81+
}
82+
func (params *CreateConversationWithParticipantsParams) SetState(State string) *CreateConversationWithParticipantsParams {
83+
params.State = &State
84+
return params
85+
}
86+
func (params *CreateConversationWithParticipantsParams) SetTimersInactive(TimersInactive string) *CreateConversationWithParticipantsParams {
87+
params.TimersInactive = &TimersInactive
88+
return params
89+
}
90+
func (params *CreateConversationWithParticipantsParams) SetTimersClosed(TimersClosed string) *CreateConversationWithParticipantsParams {
91+
params.TimersClosed = &TimersClosed
92+
return params
93+
}
94+
func (params *CreateConversationWithParticipantsParams) SetBindingsEmailAddress(BindingsEmailAddress string) *CreateConversationWithParticipantsParams {
95+
params.BindingsEmailAddress = &BindingsEmailAddress
96+
return params
97+
}
98+
func (params *CreateConversationWithParticipantsParams) SetBindingsEmailName(BindingsEmailName string) *CreateConversationWithParticipantsParams {
99+
params.BindingsEmailName = &BindingsEmailName
100+
return params
101+
}
102+
func (params *CreateConversationWithParticipantsParams) SetParticipant(Participant []string) *CreateConversationWithParticipantsParams {
103+
params.Participant = &Participant
104+
return params
105+
}
106+
107+
// Create a new conversation with the list of participants in your account's default service
108+
func (c *ApiService) CreateConversationWithParticipants(params *CreateConversationWithParticipantsParams) (*ConversationsV1ConversationWithParticipants, error) {
109+
path := "/v1/ConversationWithParticipants"
110+
111+
data := url.Values{}
112+
headers := map[string]interface{}{
113+
"Content-Type": "application/x-www-form-urlencoded",
114+
}
115+
116+
if params != nil && params.FriendlyName != nil {
117+
data.Set("FriendlyName", *params.FriendlyName)
118+
}
119+
if params != nil && params.UniqueName != nil {
120+
data.Set("UniqueName", *params.UniqueName)
121+
}
122+
if params != nil && params.DateCreated != nil {
123+
data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339)))
124+
}
125+
if params != nil && params.DateUpdated != nil {
126+
data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339)))
127+
}
128+
if params != nil && params.MessagingServiceSid != nil {
129+
data.Set("MessagingServiceSid", *params.MessagingServiceSid)
130+
}
131+
if params != nil && params.Attributes != nil {
132+
data.Set("Attributes", *params.Attributes)
133+
}
134+
if params != nil && params.State != nil {
135+
data.Set("State", *params.State)
136+
}
137+
if params != nil && params.TimersInactive != nil {
138+
data.Set("Timers.Inactive", *params.TimersInactive)
139+
}
140+
if params != nil && params.TimersClosed != nil {
141+
data.Set("Timers.Closed", *params.TimersClosed)
142+
}
143+
if params != nil && params.BindingsEmailAddress != nil {
144+
data.Set("Bindings.Email.Address", *params.BindingsEmailAddress)
145+
}
146+
if params != nil && params.BindingsEmailName != nil {
147+
data.Set("Bindings.Email.Name", *params.BindingsEmailName)
148+
}
149+
if params != nil && params.Participant != nil {
150+
for _, item := range *params.Participant {
151+
data.Add("Participant", item)
152+
}
153+
}
154+
155+
if params != nil && params.XTwilioWebhookEnabled != nil {
156+
headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled
157+
}
158+
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
159+
if err != nil {
160+
return nil, err
161+
}
162+
163+
defer resp.Body.Close()
164+
165+
ps := &ConversationsV1ConversationWithParticipants{}
166+
if err := json.NewDecoder(resp.Body).Decode(ps); err != nil {
167+
return nil, err
168+
}
169+
170+
return ps, err
171+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# ConversationWithParticipantsApi
2+
3+
All URIs are relative to *https://conversations.twilio.com*
4+
5+
Method | HTTP request | Description
6+
------------- | ------------- | -------------
7+
[**CreateConversationWithParticipants**](ConversationWithParticipantsApi.md#CreateConversationWithParticipants) | **Post** /v1/ConversationWithParticipants |
8+
9+
10+
11+
## CreateConversationWithParticipants
12+
13+
> ConversationsV1ConversationWithParticipants CreateConversationWithParticipants(ctx, optional)
14+
15+
16+
17+
Create a new conversation with the list of participants in your account's default service
18+
19+
### Path Parameters
20+
21+
This endpoint does not need any path parameter.
22+
23+
### Other Parameters
24+
25+
Other parameters are passed through a pointer to a CreateConversationWithParticipantsParams struct
26+
27+
28+
Name | Type | Description
29+
------------- | ------------- | -------------
30+
**XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header
31+
**FriendlyName** | **string** | The human-readable name of this conversation, limited to 256 characters. Optional.
32+
**UniqueName** | **string** | An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL.
33+
**DateCreated** | **time.Time** | The date that this resource was created.
34+
**DateUpdated** | **time.Time** | The date that this resource was last updated.
35+
**MessagingServiceSid** | **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
36+
**Attributes** | **string** | An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned.
37+
**State** | **string** |
38+
**TimersInactive** | **string** | ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
39+
**TimersClosed** | **string** | ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes.
40+
**BindingsEmailAddress** | **string** | The default email address that will be used when sending outbound emails in this conversation.
41+
**BindingsEmailName** | **string** | The default name that will be used when sending outbound emails in this conversation.
42+
**Participant** | **[]string** | The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10.
43+
44+
### Return type
45+
46+
[**ConversationsV1ConversationWithParticipants**](ConversationsV1ConversationWithParticipants.md)
47+
48+
### Authorization
49+
50+
[accountSid_authToken](../README.md#accountSid_authToken)
51+
52+
### HTTP request headers
53+
54+
- **Content-Type**: application/x-www-form-urlencoded
55+
- **Accept**: application/json
56+
57+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
58+
[[Back to Model list]](../README.md#documentation-for-models)
59+
[[Back to README]](../README.md)
60+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# ConversationsV1ConversationWithParticipants
2+
3+
## Properties
4+
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**AccountSid** | Pointer to **string** | The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. |
8+
**ChatServiceSid** | Pointer to **string** | The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. |
9+
**MessagingServiceSid** | Pointer to **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. |
10+
**Sid** | Pointer to **string** | A 34 character string that uniquely identifies this resource. |
11+
**FriendlyName** | Pointer to **string** | The human-readable name of this conversation, limited to 256 characters. Optional. |
12+
**UniqueName** | Pointer to **string** | An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. |
13+
**Attributes** | Pointer to **string** | An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. |
14+
**State** | Pointer to [**string**](ConversationWithParticipantsEnumState.md) | |
15+
**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date that this resource was created. |
16+
**DateUpdated** | Pointer to [**time.Time**](time.Time.md) | The date that this resource was last updated. |
17+
**Timers** | Pointer to **interface{}** | Timer date values representing state update for this conversation. |
18+
**Links** | Pointer to **map[string]interface{}** | Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation. |
19+
**Bindings** | Pointer to **interface{}** | |
20+
**Url** | Pointer to **string** | An absolute API resource URL for this conversation. |
21+
22+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
23+
24+

0 commit comments

Comments
 (0)