-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 18…
…52557f82faade033dbd5bd0615c9e1aa4d9fae
- Loading branch information
Showing
15 changed files
with
723 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
171 changes: 171 additions & 0 deletions
171
rest/conversations/v1/conversation_with_participants.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
60
rest/conversations/v1/docs/ConversationWithParticipantsApi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
24 changes: 24 additions & 0 deletions
24
rest/conversations/v1/docs/ConversationsV1ConversationWithParticipants.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
|
||
|
Oops, something went wrong.