Skip to content

chore: handle free form object using any #1090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions src/rest/accounts/v1/bulkConsents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function BulkConsentsListInstance(
interface BulkConsentsPayload extends BulkConsentsResource {}

interface BulkConsentsResource {
items: Record<string, object>;
items: Record<string, any>;
}

export class BulkConsentsInstance {
Expand All @@ -129,7 +129,7 @@ export class BulkConsentsInstance {
/**
* A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
*/
items: Record<string, object>;
items: Record<string, any>;

/**
* Provide a user-friendly representation
Expand Down
4 changes: 2 additions & 2 deletions src/rest/accounts/v1/bulkContacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export function BulkContactsListInstance(
interface BulkContactsPayload extends BulkContactsResource {}

interface BulkContactsResource {
items: Record<string, object>;
items: Record<string, any>;
}

export class BulkContactsInstance {
Expand All @@ -129,7 +129,7 @@ export class BulkContactsInstance {
/**
* A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty.
*/
items: Record<string, object>;
items: Record<string, any>;

/**
* Provide a user-friendly representation
Expand Down
8 changes: 4 additions & 4 deletions src/rest/api/v2010/account/call/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ interface EventPayload extends TwilioResponsePayload {
}

interface EventResource {
request: Record<string, object>;
response: Record<string, object>;
request: Record<string, any>;
response: Record<string, any>;
}

export class EventInstance {
Expand All @@ -258,11 +258,11 @@ export class EventInstance {
/**
* Contains a dictionary representing the request of the call.
*/
request: Record<string, object>;
request: Record<string, any>;
/**
* Contains a dictionary representing the call response, including a list of the call events.
*/
response: Record<string, object>;
response: Record<string, any>;

/**
* Provide a user-friendly representation
Expand Down
4 changes: 2 additions & 2 deletions src/rest/api/v2010/account/call/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ interface RecordingResource {
sid: string;
price: number;
uri: string;
encryption_details: Record<string, object>;
encryption_details: Record<string, any>;
price_unit: string;
status: RecordingStatus;
channels: number;
Expand Down Expand Up @@ -419,7 +419,7 @@ export class RecordingInstance {
/**
* How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature.
*/
encryptionDetails: Record<string, object>;
encryptionDetails: Record<string, any>;
/**
* The currency used in the `price` property. Example: `USD`.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/api/v2010/account/conference/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ interface RecordingResource {
channels: number;
source: RecordingSource;
error_code: number;
encryption_details: Record<string, object>;
encryption_details: Record<string, any>;
uri: string;
}

Expand Down Expand Up @@ -409,7 +409,7 @@ export class RecordingInstance {
/**
* How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature.
*/
encryptionDetails: Record<string, object>;
encryptionDetails: Record<string, any>;
/**
* The URI of the resource, relative to `https://api.twilio.com`.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ interface AssignedAddOnResource {
resource_sid: string;
friendly_name: string;
description: string;
configuration: Record<string, object>;
configuration: Record<string, any>;
unique_name: string;
date_created: Date;
date_updated: Date;
Expand Down Expand Up @@ -275,7 +275,7 @@ export class AssignedAddOnInstance {
/**
* A JSON string that represents the current configuration of this Add-on installation.
*/
configuration: Record<string, object>;
configuration: Record<string, any>;
/**
* An application-defined string that uniquely identifies the resource. It can be used in place of the resource\'s `sid` in the URL to address the resource.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/api/v2010/account/recording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ interface RecordingResource {
source: RecordingSource;
error_code: number;
uri: string;
encryption_details: Record<string, object>;
encryption_details: Record<string, any>;
subresource_uris: Record<string, string>;
media_url: string;
}
Expand Down Expand Up @@ -418,7 +418,7 @@ export class RecordingInstance {
/**
* How to decrypt the recording if it was encrypted using [Call Recording Encryption](https://www.twilio.com/docs/voice/tutorials/voice-recording-encryption) feature.
*/
encryptionDetails: Record<string, object>;
encryptionDetails: Record<string, any>;
/**
* A list of related resources identified by their relative URIs.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/rest/assistants/v1/assistant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class AssistantsV1ServiceKnowledge {
/**
* The details of the knowledge source based on the type.
*/
"knowledge_source_details"?: Record<string, object>;
"knowledge_source_details"?: Record<string, any>;
/**
* The name of the knowledge source.
*/
Expand Down Expand Up @@ -134,7 +134,7 @@ export class AssistantsV1ServiceTool {
/**
* The metadata related to method, url, input_schema to used with the Tool.
*/
"meta": Record<string, object>;
"meta": Record<string, any>;
/**
* The name of the tool.
*/
Expand Down Expand Up @@ -449,7 +449,7 @@ interface AssistantPayload extends TwilioResponsePayload {

interface AssistantResource {
account_sid: string;
customer_ai: Record<string, object>;
customer_ai: Record<string, any>;
id: string;
model: string;
name: string;
Expand Down Expand Up @@ -490,7 +490,7 @@ export class AssistantInstance {
/**
* The Personalization and Perception Engine settings.
*/
customerAi: Record<string, object>;
customerAi: Record<string, any>;
/**
* The Assistant ID.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/assistants/v1/assistant/assistantsKnowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ interface AssistantsKnowledgeResource {
description: string;
id: string;
account_sid: string;
knowledge_source_details: Record<string, object>;
knowledge_source_details: Record<string, any>;
name: string;
status: string;
type: string;
Expand Down Expand Up @@ -235,7 +235,7 @@ export class AssistantsKnowledgeInstance {
/**
* The details of the knowledge source based on the type.
*/
knowledgeSourceDetails: Record<string, object>;
knowledgeSourceDetails: Record<string, any>;
/**
* The name of the knowledge source.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/assistants/v1/assistant/assistantsTool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ interface AssistantsToolResource {
description: string;
enabled: boolean;
id: string;
meta: Record<string, object>;
meta: Record<string, any>;
name: string;
requires_auth: boolean;
type: string;
Expand Down Expand Up @@ -237,7 +237,7 @@ export class AssistantsToolInstance {
/**
* The metadata related to method, url, input_schema to used with the Tool.
*/
meta: Record<string, object>;
meta: Record<string, any>;
/**
* The name of the tool.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/rest/assistants/v1/knowledge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export class AssistantsV1ServiceCreateKnowledgeRequest {
/**
* The details of the knowledge source based on the type.
*/
"knowledge_source_details"?: Record<string, object>;
"knowledge_source_details"?: Record<string, any>;
/**
* The name of the tool.
*/
Expand Down Expand Up @@ -78,7 +78,7 @@ export class AssistantsV1ServiceUpdateKnowledgeRequest {
/**
* The details of the knowledge source based on the type.
*/
"knowledge_source_details"?: Record<string, object>;
"knowledge_source_details"?: Record<string, any>;
/**
* The name of the knowledge source.
*/
Expand Down Expand Up @@ -356,7 +356,7 @@ interface KnowledgeResource {
description: string;
id: string;
account_sid: string;
knowledge_source_details: Record<string, object>;
knowledge_source_details: Record<string, any>;
name: string;
status: string;
type: string;
Expand Down Expand Up @@ -401,7 +401,7 @@ export class KnowledgeInstance {
/**
* The details of the knowledge source based on the type.
*/
knowledgeSourceDetails: Record<string, object>;
knowledgeSourceDetails: Record<string, any>;
/**
* The name of the knowledge source.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/assistants/v1/knowledge/chunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ interface ChunkPayload extends TwilioResponsePayload {
interface ChunkResource {
account_sid: string;
content: string;
metadata: Record<string, object>;
metadata: Record<string, any>;
date_created: Date;
date_updated: Date;
}
Expand All @@ -258,7 +258,7 @@ export class ChunkInstance {
/**
* The metadata of the chunk.
*/
metadata: Record<string, object>;
metadata: Record<string, any>;
/**
* The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/assistants/v1/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ interface PolicyResource {
account_sid: string;
user_sid: string;
type: string;
policy_details: Record<string, object>;
policy_details: Record<string, any>;
date_created: Date;
date_updated: Date;
}
Expand Down Expand Up @@ -292,7 +292,7 @@ export class PolicyInstance {
/**
* The details of the policy based on the type.
*/
policyDetails: Record<string, object>;
policyDetails: Record<string, any>;
/**
* The date and time in GMT when the Policy was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand Down
8 changes: 4 additions & 4 deletions src/rest/assistants/v1/session/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ interface MessageResource {
session_id: string;
identity: string;
role: string;
content: Record<string, object>;
meta: Record<string, object>;
content: Record<string, any>;
meta: Record<string, any>;
date_created: Date;
date_updated: Date;
}
Expand Down Expand Up @@ -293,11 +293,11 @@ export class MessageInstance {
/**
* The content of the message.
*/
content: Record<string, object>;
content: Record<string, any>;
/**
* The metadata of the message.
*/
meta: Record<string, object>;
meta: Record<string, any>;
/**
* The date and time in GMT when the Message was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand Down
10 changes: 5 additions & 5 deletions src/rest/assistants/v1/tool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class AssistantsV1ServiceCreateToolRequest {
/**
* The metadata related to method, url, input_schema to used with the Tool.
*/
"meta"?: Record<string, object>;
"meta"?: Record<string, any>;
/**
* The name of the tool.
*/
Expand Down Expand Up @@ -96,7 +96,7 @@ export class AssistantsV1ServicePolicy {
/**
* The details of the policy based on the type.
*/
"policy_details": Record<string, object>;
"policy_details": Record<string, any>;
/**
* The date and time in GMT when the Policy was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
*/
Expand All @@ -123,7 +123,7 @@ export class AssistantsV1ServiceUpdateToolRequest {
/**
* The metadata related to method, url, input_schema to used with the Tool.
*/
"meta"?: Record<string, object>;
"meta"?: Record<string, any>;
/**
* The name of the tool.
*/
Expand Down Expand Up @@ -379,7 +379,7 @@ interface ToolResource {
description: string;
enabled: boolean;
id: string;
meta: Record<string, object>;
meta: Record<string, any>;
name: string;
requires_auth: boolean;
type: string;
Expand Down Expand Up @@ -429,7 +429,7 @@ export class ToolInstance {
/**
* The metadata related to method, url, input_schema to used with the Tool.
*/
meta: Record<string, object>;
meta: Record<string, any>;
/**
* The name of the tool.
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/bulkexports/v1/export/exportCustomJob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ interface ExportCustomJobResource {
webhook_method: string;
email: string;
job_sid: string;
details: Record<string, object>;
details: Record<string, any>;
job_queue_position: string;
estimated_completion_time: string;
}
Expand Down Expand Up @@ -406,7 +406,7 @@ export class ExportCustomJobInstance {
/**
* The details of a job which is an object that contains an array of status grouped by `status` state. Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days.
*/
details: Record<string, object>;
details: Record<string, any>;
/**
* This is the job position from the 1st in line. Your queue position will never increase. As jobs ahead of yours in the queue are processed, the queue position number will decrease
*/
Expand Down
4 changes: 2 additions & 2 deletions src/rest/bulkexports/v1/export/job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ interface JobPayload extends JobResource {}
interface JobResource {
resource_type: string;
friendly_name: string;
details: Record<string, object>;
details: Record<string, any>;
start_day: string;
end_day: string;
job_sid: string;
Expand Down Expand Up @@ -174,7 +174,7 @@ export class JobInstance {
/**
* The details of a job which is an object that contains an array of status grouped by `status` state. Each `status` object has a `status` string, a count which is the number of days in that `status`, and list of days in that `status`. The day strings are in the format yyyy-MM-dd. As an example, a currently running job may have a status object for COMPLETED and a `status` object for SUBMITTED each with its own count and list of days.
*/
details: Record<string, object>;
details: Record<string, any>;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be an array, Record<string, any>[]. Please see my original comment from when the breaking change was introduced: #1076 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have mentioned there that this particular field is a list but in our specification it is written as an object. I'll convey this to my team to fix this. It is still under process

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just checked with my team and I think what they want to send in this field is something of this sort:

{
   [
    {
      status: 'Submitted',
      count: 3,
      days: [ '2025-03-07', '2025-03-08', '2025-03-09' ]
    }
  ]
}

Thus it should be object and not list. Is this correct with your API call too?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API response that I received is an array of objects. The example where you show an array nested directly inside of an object is not valid JavaScript or JSON so that would not be possible to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you are right, let me get this fixed with my team. Thanks!

/**
* The start time for the export specified when creating the job
*/
Expand Down
Loading
Loading