Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/Twilio/Rest/Assistants/V1/Assistant/FeedbackModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,19 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'message_id' => $this->messageId,
'score' => $this->score,
'session_id' => $this->sessionId,
'text' => $this->text
$jsonString = [
'session_id' => $this->sessionId
];
if (isset($this->messageId)) {
$jsonString['message_id'] = $this->messageId;
}
if (isset($this->score)) {
$jsonString['score'] = $this->score;
}
if (isset($this->text)) {
$jsonString['text'] = $this->text;
}
return $jsonString;
}
}

17 changes: 12 additions & 5 deletions src/Twilio/Rest/Assistants/V1/Assistant/MessageModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,20 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
$jsonString = [
'identity' => $this->identity,
'session_id' => $this->sessionId,
'body' => $this->body,
'webhook' => $this->webhook,
'mode' => $this->mode
'body' => $this->body
];
if (isset($this->sessionId)) {
$jsonString['session_id'] = $this->sessionId;
}
if (isset($this->webhook)) {
$jsonString['webhook'] = $this->webhook;
}
if (isset($this->mode)) {
$jsonString['mode'] = $this->mode;
}
return $jsonString;
}
}

62 changes: 45 additions & 17 deletions src/Twilio/Rest/Assistants/V1/AssistantModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,11 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
$jsonString = [
'perception_engine_enabled' => $this->perceptionEngineEnabled,
'personalization_engine_enabled' => $this->personalizationEngineEnabled
];
return $jsonString;
}
}

Expand All @@ -113,11 +114,18 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'profile_api_key' => $this->profileApiKey,
'space_id' => $this->spaceId,
'write_key' => $this->writeKey
$jsonString = [
];
if (isset($this->profileApiKey)) {
$jsonString['profile_api_key'] = $this->profileApiKey;
}
if (isset($this->spaceId)) {
$jsonString['space_id'] = $this->spaceId;
}
if (isset($this->writeKey)) {
$jsonString['write_key'] = $this->writeKey;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -150,13 +158,22 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'customer_ai' => $this->customerAi,
'name' => $this->name,
'owner' => $this->owner,
'personality_prompt' => $this->personalityPrompt,
'segment_credential' => $this->segmentCredential
$jsonString = [
'name' => $this->name
];
if (isset($this->customerAi)) {
$jsonString['customer_ai'] = $this->customerAi;
}
if (isset($this->owner)) {
$jsonString['owner'] = $this->owner;
}
if (isset($this->personalityPrompt)) {
$jsonString['personality_prompt'] = $this->personalityPrompt;
}
if (isset($this->segmentCredential)) {
$jsonString['segment_credential'] = $this->segmentCredential;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -189,13 +206,24 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'customer_ai' => $this->customerAi,
'name' => $this->name,
'owner' => $this->owner,
'personality_prompt' => $this->personalityPrompt,
'segment_credential' => $this->segmentCredential
$jsonString = [
];
if (isset($this->customerAi)) {
$jsonString['customer_ai'] = $this->customerAi;
}
if (isset($this->name)) {
$jsonString['name'] = $this->name;
}
if (isset($this->owner)) {
$jsonString['owner'] = $this->owner;
}
if (isset($this->personalityPrompt)) {
$jsonString['personality_prompt'] = $this->personalityPrompt;
}
if (isset($this->segmentCredential)) {
$jsonString['segment_credential'] = $this->segmentCredential;
}
return $jsonString;
}
}

73 changes: 53 additions & 20 deletions src/Twilio/Rest/Assistants/V1/KnowledgeModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,22 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'description' => $this->description,
'id' => $this->id,
'name' => $this->name,
'policy_details' => $this->policyDetails,
'type' => $this->type
$jsonString = [
'policy_details' => $this->policyDetails
];
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->id)) {
$jsonString['id'] = $this->id;
}
if (isset($this->name)) {
$jsonString['name'] = $this->name;
}
if (isset($this->type)) {
$jsonString['type'] = $this->type;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -133,15 +142,26 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'assistant_id' => $this->assistantId,
'description' => $this->description,
'knowledge_source_details' => $this->knowledgeSourceDetails,
$jsonString = [
'name' => $this->name,
'policy' => $this->policy,
'type' => $this->type,
'embedding_model' => $this->embeddingModel
'type' => $this->type
];
if (isset($this->assistantId)) {
$jsonString['assistant_id'] = $this->assistantId;
}
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->knowledgeSourceDetails)) {
$jsonString['knowledge_source_details'] = $this->knowledgeSourceDetails;
}
if (isset($this->policy)) {
$jsonString['policy'] = $this->policy;
}
if (isset($this->embeddingModel)) {
$jsonString['embedding_model'] = $this->embeddingModel;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -177,14 +197,27 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'description' => $this->description,
'knowledge_source_details' => $this->knowledgeSourceDetails,
'name' => $this->name,
'policy' => $this->policy,
'type' => $this->type,
'embedding_model' => $this->embeddingModel
$jsonString = [
];
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->knowledgeSourceDetails)) {
$jsonString['knowledge_source_details'] = $this->knowledgeSourceDetails;
}
if (isset($this->name)) {
$jsonString['name'] = $this->name;
}
if (isset($this->policy)) {
$jsonString['policy'] = $this->policy;
}
if (isset($this->type)) {
$jsonString['type'] = $this->type;
}
if (isset($this->embeddingModel)) {
$jsonString['embedding_model'] = $this->embeddingModel;
}
return $jsonString;
}
}

71 changes: 52 additions & 19 deletions src/Twilio/Rest/Assistants/V1/ToolModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,22 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'description' => $this->description,
'id' => $this->id,
'name' => $this->name,
'policy_details' => $this->policyDetails,
'type' => $this->type
$jsonString = [
'policy_details' => $this->policyDetails
];
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->id)) {
$jsonString['id'] = $this->id;
}
if (isset($this->name)) {
$jsonString['name'] = $this->name;
}
if (isset($this->type)) {
$jsonString['type'] = $this->type;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -134,15 +143,24 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'assistant_id' => $this->assistantId,
'description' => $this->description,
$jsonString = [
'enabled' => $this->enabled,
'meta' => $this->meta,
'name' => $this->name,
'policy' => $this->policy,
'type' => $this->type
];
if (isset($this->assistantId)) {
$jsonString['assistant_id'] = $this->assistantId;
}
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->meta)) {
$jsonString['meta'] = $this->meta;
}
if (isset($this->policy)) {
$jsonString['policy'] = $this->policy;
}
return $jsonString;
}
}

Expand Down Expand Up @@ -181,15 +199,30 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
'assistant_id' => $this->assistantId,
'description' => $this->description,
'enabled' => $this->enabled,
'meta' => $this->meta,
'name' => $this->name,
'policy' => $this->policy,
'type' => $this->type
$jsonString = [
];
if (isset($this->assistantId)) {
$jsonString['assistant_id'] = $this->assistantId;
}
if (isset($this->description)) {
$jsonString['description'] = $this->description;
}
if (isset($this->enabled)) {
$jsonString['enabled'] = $this->enabled;
}
if (isset($this->meta)) {
$jsonString['meta'] = $this->meta;
}
if (isset($this->name)) {
$jsonString['name'] = $this->name;
}
if (isset($this->policy)) {
$jsonString['policy'] = $this->policy;
}
if (isset($this->type)) {
$jsonString['type'] = $this->type;
}
return $jsonString;
}
}

3 changes: 2 additions & 1 deletion src/Twilio/Rest/Content/V1/Content/ApprovalCreateModels.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ public function toArray(): array

public function jsonSerialize(): array
{
return [
$jsonString = [
'name' => $this->name,
'category' => $this->category
];
return $jsonString;
}
}

Loading
Loading