Skip to content

Commit

Permalink
[Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 18…
Browse files Browse the repository at this point in the history
…52557f82faade033dbd5bd0615c9e1aa4d9fae
  • Loading branch information
twilio-dx committed Oct 24, 2024
1 parent a8cce53 commit e0a5057
Show file tree
Hide file tree
Showing 15 changed files with 723 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
twilio-go changelog
====================
[2024-10-24] Version 1.23.5
---------------------------
**Conversations**
- Expose ConversationWithParticipants resource that allows creating a conversation with participants


[2024-10-17] Version 1.23.4
---------------------------
**Api**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Name | Type | Description | Notes
**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]
**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]
**Score** | **float32** | The score associated with the chunk. |[optional]
**KnowledgeId** | **string** | The knowledge ID associated with the chunk. |[optional]

[[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
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ type AssistantsV1KnowledgeChunkWithScore struct {
DateUpdated time.Time `json:"date_updated,omitempty"`
// The score associated with the chunk.
Score float32 `json:"score,omitempty"`
// The knowledge ID associated with the chunk.
KnowledgeId string `json:"knowledge_id,omitempty"`
}

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

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

responseScore, err := client.UnmarshalFloat32(&raw.Score)
Expand Down
4 changes: 4 additions & 0 deletions rest/conversations/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Class | Method | HTTP request | Description
*ConfigurationAddressesApi* | [**UpdateConfigurationAddress**](docs/ConfigurationAddressesApi.md#updateconfigurationaddress) | **Post** /v1/Configuration/Addresses/{Sid} |
*ConfigurationWebhooksApi* | [**FetchConfigurationWebhook**](docs/ConfigurationWebhooksApi.md#fetchconfigurationwebhook) | **Get** /v1/Configuration/Webhooks |
*ConfigurationWebhooksApi* | [**UpdateConfigurationWebhook**](docs/ConfigurationWebhooksApi.md#updateconfigurationwebhook) | **Post** /v1/Configuration/Webhooks |
*ConversationWithParticipantsApi* | [**CreateConversationWithParticipants**](docs/ConversationWithParticipantsApi.md#createconversationwithparticipants) | **Post** /v1/ConversationWithParticipants |
*ConversationsApi* | [**CreateConversation**](docs/ConversationsApi.md#createconversation) | **Post** /v1/Conversations |
*ConversationsApi* | [**DeleteConversation**](docs/ConversationsApi.md#deleteconversation) | **Delete** /v1/Conversations/{Sid} |
*ConversationsApi* | [**FetchConversation**](docs/ConversationsApi.md#fetchconversation) | **Get** /v1/Conversations/{Sid} |
Expand Down Expand Up @@ -86,6 +87,7 @@ Class | Method | HTTP request | Description
*ServicesConfigurationNotificationsApi* | [**UpdateServiceNotification**](docs/ServicesConfigurationNotificationsApi.md#updateservicenotification) | **Post** /v1/Services/{ChatServiceSid}/Configuration/Notifications |
*ServicesConfigurationWebhooksApi* | [**FetchServiceWebhookConfiguration**](docs/ServicesConfigurationWebhooksApi.md#fetchservicewebhookconfiguration) | **Get** /v1/Services/{ChatServiceSid}/Configuration/Webhooks |
*ServicesConfigurationWebhooksApi* | [**UpdateServiceWebhookConfiguration**](docs/ServicesConfigurationWebhooksApi.md#updateservicewebhookconfiguration) | **Post** /v1/Services/{ChatServiceSid}/Configuration/Webhooks |
*ServicesConversationWithParticipantsApi* | [**CreateServiceConversationWithParticipants**](docs/ServicesConversationWithParticipantsApi.md#createserviceconversationwithparticipants) | **Post** /v1/Services/{ChatServiceSid}/ConversationWithParticipants |
*ServicesConversationsApi* | [**CreateServiceConversation**](docs/ServicesConversationsApi.md#createserviceconversation) | **Post** /v1/Services/{ChatServiceSid}/Conversations |
*ServicesConversationsApi* | [**DeleteServiceConversation**](docs/ServicesConversationsApi.md#deleteserviceconversation) | **Delete** /v1/Services/{ChatServiceSid}/Conversations/{Sid} |
*ServicesConversationsApi* | [**FetchServiceConversation**](docs/ServicesConversationsApi.md#fetchserviceconversation) | **Get** /v1/Services/{ChatServiceSid}/Conversations/{Sid} |
Expand Down Expand Up @@ -153,6 +155,7 @@ Class | Method | HTTP request | Description
- [ListConversationMessageResponse](docs/ListConversationMessageResponse.md)
- [ConversationsV1ConfigurationWebhook](docs/ConversationsV1ConfigurationWebhook.md)
- [ConversationsV1Credential](docs/ConversationsV1Credential.md)
- [ConversationsV1ConversationWithParticipants](docs/ConversationsV1ConversationWithParticipants.md)
- [ConversationsV1UserConversation](docs/ConversationsV1UserConversation.md)
- [ConversationsV1Conversation](docs/ConversationsV1Conversation.md)
- [ConversationsV1ServiceConversationMessageReceipt](docs/ConversationsV1ServiceConversationMessageReceipt.md)
Expand All @@ -168,6 +171,7 @@ Class | Method | HTTP request | Description
- [ConversationsV1ServiceUser](docs/ConversationsV1ServiceUser.md)
- [ListConversationParticipantResponse](docs/ListConversationParticipantResponse.md)
- [ListServiceConversationParticipantResponse](docs/ListServiceConversationParticipantResponse.md)
- [ConversationsV1ServiceConversationWithParticipants](docs/ConversationsV1ServiceConversationWithParticipants.md)
- [ListCredentialResponse](docs/ListCredentialResponse.md)
- [ListServiceBindingResponse](docs/ListServiceBindingResponse.md)
- [ListRoleResponse](docs/ListRoleResponse.md)
Expand Down
171 changes: 171 additions & 0 deletions rest/conversations/v1/conversation_with_participants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
/*
* This code was generated by
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
*
* Twilio - Conversations
* This is the public Twilio REST API.
*
* NOTE: This class is auto generated by OpenAPI Generator.
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package openapi

import (
"encoding/json"
"fmt"
"net/url"
"time"
)

// Optional parameters for the method 'CreateConversationWithParticipants'
type CreateConversationWithParticipantsParams struct {
// The X-Twilio-Webhook-Enabled HTTP request header
XTwilioWebhookEnabled *string `json:"X-Twilio-Webhook-Enabled,omitempty"`
// The human-readable name of this conversation, limited to 256 characters. Optional.
FriendlyName *string `json:"FriendlyName,omitempty"`
// 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.
UniqueName *string `json:"UniqueName,omitempty"`
// The date that this resource was created.
DateCreated *time.Time `json:"DateCreated,omitempty"`
// The date that this resource was last updated.
DateUpdated *time.Time `json:"DateUpdated,omitempty"`
// The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
MessagingServiceSid *string `json:"MessagingServiceSid,omitempty"`
// 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.
Attributes *string `json:"Attributes,omitempty"`
//
State *string `json:"State,omitempty"`
// ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
TimersInactive *string `json:"Timers.Inactive,omitempty"`
// ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes.
TimersClosed *string `json:"Timers.Closed,omitempty"`
// The default email address that will be used when sending outbound emails in this conversation.
BindingsEmailAddress *string `json:"Bindings.Email.Address,omitempty"`
// The default name that will be used when sending outbound emails in this conversation.
BindingsEmailName *string `json:"Bindings.Email.Name,omitempty"`
// 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.
Participant *[]string `json:"Participant,omitempty"`
}

func (params *CreateConversationWithParticipantsParams) SetXTwilioWebhookEnabled(XTwilioWebhookEnabled string) *CreateConversationWithParticipantsParams {
params.XTwilioWebhookEnabled = &XTwilioWebhookEnabled
return params
}
func (params *CreateConversationWithParticipantsParams) SetFriendlyName(FriendlyName string) *CreateConversationWithParticipantsParams {
params.FriendlyName = &FriendlyName
return params
}
func (params *CreateConversationWithParticipantsParams) SetUniqueName(UniqueName string) *CreateConversationWithParticipantsParams {
params.UniqueName = &UniqueName
return params
}
func (params *CreateConversationWithParticipantsParams) SetDateCreated(DateCreated time.Time) *CreateConversationWithParticipantsParams {
params.DateCreated = &DateCreated
return params
}
func (params *CreateConversationWithParticipantsParams) SetDateUpdated(DateUpdated time.Time) *CreateConversationWithParticipantsParams {
params.DateUpdated = &DateUpdated
return params
}
func (params *CreateConversationWithParticipantsParams) SetMessagingServiceSid(MessagingServiceSid string) *CreateConversationWithParticipantsParams {
params.MessagingServiceSid = &MessagingServiceSid
return params
}
func (params *CreateConversationWithParticipantsParams) SetAttributes(Attributes string) *CreateConversationWithParticipantsParams {
params.Attributes = &Attributes
return params
}
func (params *CreateConversationWithParticipantsParams) SetState(State string) *CreateConversationWithParticipantsParams {
params.State = &State
return params
}
func (params *CreateConversationWithParticipantsParams) SetTimersInactive(TimersInactive string) *CreateConversationWithParticipantsParams {
params.TimersInactive = &TimersInactive
return params
}
func (params *CreateConversationWithParticipantsParams) SetTimersClosed(TimersClosed string) *CreateConversationWithParticipantsParams {
params.TimersClosed = &TimersClosed
return params
}
func (params *CreateConversationWithParticipantsParams) SetBindingsEmailAddress(BindingsEmailAddress string) *CreateConversationWithParticipantsParams {
params.BindingsEmailAddress = &BindingsEmailAddress
return params
}
func (params *CreateConversationWithParticipantsParams) SetBindingsEmailName(BindingsEmailName string) *CreateConversationWithParticipantsParams {
params.BindingsEmailName = &BindingsEmailName
return params
}
func (params *CreateConversationWithParticipantsParams) SetParticipant(Participant []string) *CreateConversationWithParticipantsParams {
params.Participant = &Participant
return params
}

// Create a new conversation with the list of participants in your account's default service
func (c *ApiService) CreateConversationWithParticipants(params *CreateConversationWithParticipantsParams) (*ConversationsV1ConversationWithParticipants, error) {
path := "/v1/ConversationWithParticipants"

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

if params != nil && params.FriendlyName != nil {
data.Set("FriendlyName", *params.FriendlyName)
}
if params != nil && params.UniqueName != nil {
data.Set("UniqueName", *params.UniqueName)
}
if params != nil && params.DateCreated != nil {
data.Set("DateCreated", fmt.Sprint((*params.DateCreated).Format(time.RFC3339)))
}
if params != nil && params.DateUpdated != nil {
data.Set("DateUpdated", fmt.Sprint((*params.DateUpdated).Format(time.RFC3339)))
}
if params != nil && params.MessagingServiceSid != nil {
data.Set("MessagingServiceSid", *params.MessagingServiceSid)
}
if params != nil && params.Attributes != nil {
data.Set("Attributes", *params.Attributes)
}
if params != nil && params.State != nil {
data.Set("State", *params.State)
}
if params != nil && params.TimersInactive != nil {
data.Set("Timers.Inactive", *params.TimersInactive)
}
if params != nil && params.TimersClosed != nil {
data.Set("Timers.Closed", *params.TimersClosed)
}
if params != nil && params.BindingsEmailAddress != nil {
data.Set("Bindings.Email.Address", *params.BindingsEmailAddress)
}
if params != nil && params.BindingsEmailName != nil {
data.Set("Bindings.Email.Name", *params.BindingsEmailName)
}
if params != nil && params.Participant != nil {
for _, item := range *params.Participant {
data.Add("Participant", item)
}
}

if params != nil && params.XTwilioWebhookEnabled != nil {
headers["X-Twilio-Webhook-Enabled"] = *params.XTwilioWebhookEnabled
}
resp, err := c.requestHandler.Post(c.baseURL+path, data, headers)
if err != nil {
return nil, err
}

defer resp.Body.Close()

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

return ps, err
}
60 changes: 60 additions & 0 deletions rest/conversations/v1/docs/ConversationWithParticipantsApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ConversationWithParticipantsApi

All URIs are relative to *https://conversations.twilio.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**CreateConversationWithParticipants**](ConversationWithParticipantsApi.md#CreateConversationWithParticipants) | **Post** /v1/ConversationWithParticipants |



## CreateConversationWithParticipants

> ConversationsV1ConversationWithParticipants CreateConversationWithParticipants(ctx, optional)


Create a new conversation with the list of participants in your account's default service

### Path Parameters

This endpoint does not need any path parameter.

### Other Parameters

Other parameters are passed through a pointer to a CreateConversationWithParticipantsParams struct


Name | Type | Description
------------- | ------------- | -------------
**XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header
**FriendlyName** | **string** | The human-readable name of this conversation, limited to 256 characters. Optional.
**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.
**DateCreated** | **time.Time** | The date that this resource was created.
**DateUpdated** | **time.Time** | The date that this resource was last updated.
**MessagingServiceSid** | **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to.
**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.
**State** | **string** |
**TimersInactive** | **string** | ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute.
**TimersClosed** | **string** | ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes.
**BindingsEmailAddress** | **string** | The default email address that will be used when sending outbound emails in this conversation.
**BindingsEmailName** | **string** | The default name that will be used when sending outbound emails in this conversation.
**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.

### Return type

[**ConversationsV1ConversationWithParticipants**](ConversationsV1ConversationWithParticipants.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)

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ConversationsV1ConversationWithParticipants

## Properties

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**AccountSid** | Pointer to **string** | The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. |
**ChatServiceSid** | Pointer to **string** | The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. |
**MessagingServiceSid** | Pointer to **string** | The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. |
**Sid** | Pointer to **string** | A 34 character string that uniquely identifies this resource. |
**FriendlyName** | Pointer to **string** | The human-readable name of this conversation, limited to 256 characters. Optional. |
**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. |
**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. |
**State** | Pointer to [**string**](ConversationWithParticipantsEnumState.md) | |
**DateCreated** | Pointer to [**time.Time**](time.Time.md) | The date that this resource was created. |
**DateUpdated** | Pointer to [**time.Time**](time.Time.md) | The date that this resource was last updated. |
**Timers** | Pointer to **interface{}** | Timer date values representing state update for this conversation. |
**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. |
**Bindings** | Pointer to **interface{}** | |
**Url** | Pointer to **string** | An absolute API resource URL for this conversation. |

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


Loading

0 comments on commit e0a5057

Please sign in to comment.