vapi_server_sdk 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/requests.rb +2 -2
- data/lib/types_export.rb +60 -14
- data/lib/vapi_server_sdk/analytics/client.rb +41 -12
- data/lib/vapi_server_sdk/assistants/client.rb +80 -14
- data/lib/vapi_server_sdk/assistants/types/update_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/calls/client.rb +104 -6
- data/lib/vapi_server_sdk/logs/client.rb +2 -2
- data/lib/vapi_server_sdk/squads/client.rb +128 -8
- data/lib/vapi_server_sdk/test_suite_runs/client.rb +328 -0
- data/lib/vapi_server_sdk/test_suite_runs/types/test_suite_run_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/client.rb +331 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_create_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_remove_response.rb +82 -0
- data/lib/vapi_server_sdk/test_suite_tests/types/test_suite_test_controller_update_request.rb +81 -0
- data/lib/vapi_server_sdk/test_suites/client.rb +338 -0
- data/lib/vapi_server_sdk/test_suites/types/test_suite_controller_find_all_paginated_request_sort_order.rb +10 -0
- data/lib/vapi_server_sdk/types/{semantic_edge_condition.rb → ai_edge_condition.rb} +9 -11
- data/lib/vapi_server_sdk/types/analytics_operation_column.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_operation_operation.rb +1 -0
- data/lib/vapi_server_sdk/types/analytics_query.rb +4 -3
- data/lib/vapi_server_sdk/types/analytics_query_table.rb +9 -0
- data/lib/vapi_server_sdk/types/api_request.rb +165 -0
- data/lib/vapi_server_sdk/types/api_request_method.rb +8 -0
- data/lib/vapi_server_sdk/types/api_request_mode.rb +10 -0
- data/lib/vapi_server_sdk/types/artifact.rb +12 -2
- data/lib/vapi_server_sdk/types/artifact_plan.rb +56 -8
- data/lib/vapi_server_sdk/types/assistant.rb +27 -13
- data/lib/vapi_server_sdk/types/assistant_hook_action_base.rb +47 -0
- data/lib/vapi_server_sdk/types/assistant_hook_filter.rb +72 -0
- data/lib/vapi_server_sdk/types/assistant_hooks.rb +82 -0
- data/lib/vapi_server_sdk/types/assistant_overrides.rb +28 -14
- data/lib/vapi_server_sdk/types/assistant_overrides_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/assistant_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/azure_open_ai_credential_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/backoff_plan.rb +80 -0
- data/lib/vapi_server_sdk/types/byo_phone_number.rb +10 -1
- data/lib/vapi_server_sdk/types/byo_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/call_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls.rb +69 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_emotion.rb +26 -0
- data/lib/vapi_server_sdk/types/cartesia_experimental_controls_speed.rb +11 -0
- data/lib/vapi_server_sdk/types/cartesia_voice.rb +24 -10
- data/lib/vapi_server_sdk/types/chat_completion_message.rb +80 -0
- data/lib/vapi_server_sdk/types/chat_completion_message_metadata.rb +94 -0
- data/lib/vapi_server_sdk/types/chat_completions_dto.rb +84 -0
- data/lib/vapi_server_sdk/types/client_inbound_message_transfer.rb +13 -3
- data/lib/vapi_server_sdk/types/client_message_conversation_update.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_hang.rb +22 -4
- data/lib/vapi_server_sdk/types/client_message_language_change_detected.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_message.rb +165 -181
- data/lib/vapi_server_sdk/types/client_message_metadata.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_model_output.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_speech_update.rb +11 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls.rb +15 -2
- data/lib/vapi_server_sdk/types/client_message_tool_calls_result.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_transcript.rb +12 -2
- data/lib/vapi_server_sdk/types/client_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/client_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/client_message_user_interrupted.rb +14 -4
- data/lib/vapi_server_sdk/types/client_message_voice_input.rb +15 -3
- data/lib/vapi_server_sdk/types/client_message_workflow_node_started.rb +67 -0
- data/lib/vapi_server_sdk/types/compliance_plan.rb +77 -0
- data/lib/vapi_server_sdk/types/create_assistant_dto.rb +28 -14
- data/lib/vapi_server_sdk/types/create_assistant_dto_server_messages_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/create_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/create_vapi_phone_number_dto.rb +12 -4
- data/lib/vapi_server_sdk/types/create_workflow_dto.rb +2 -9
- data/lib/vapi_server_sdk/types/create_workflow_dto_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/deep_seek_model.rb +4 -3
- data/lib/vapi_server_sdk/types/deep_seek_model_model.rb +9 -0
- data/lib/vapi_server_sdk/types/deepgram_transcriber.rb +28 -2
- data/lib/vapi_server_sdk/types/deepgram_voice.rb +22 -2
- data/lib/vapi_server_sdk/types/edge.rb +9 -2
- data/lib/vapi_server_sdk/types/edge_condition.rb +32 -19
- data/lib/vapi_server_sdk/types/failed_edge_condition.rb +47 -0
- data/lib/vapi_server_sdk/types/fallback_cartesia_voice.rb +24 -9
- data/lib/vapi_server_sdk/types/fallback_deepgram_voice.rb +17 -2
- data/lib/vapi_server_sdk/types/fallback_play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/fallback_rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/format_plan.rb +22 -2
- data/lib/vapi_server_sdk/types/format_plan_formatters_enabled_item.rb +22 -0
- data/lib/vapi_server_sdk/types/gather.rb +81 -25
- data/lib/vapi_server_sdk/types/google_model_model.rb +4 -0
- data/lib/vapi_server_sdk/types/groq_model_model.rb +1 -0
- data/lib/vapi_server_sdk/types/hangup.rb +67 -0
- data/lib/vapi_server_sdk/types/hook.rb +70 -0
- data/lib/vapi_server_sdk/types/hook_on.rb +9 -0
- data/lib/vapi_server_sdk/types/invite_user_dto.rb +11 -2
- data/lib/vapi_server_sdk/types/json_schema.rb +26 -2
- data/lib/vapi_server_sdk/types/{programmatic_edge_condition.rb → logic_edge_condition.rb} +13 -15
- data/lib/vapi_server_sdk/types/message_plan.rb +12 -2
- data/lib/vapi_server_sdk/types/open_ai_model.rb +1 -9
- data/lib/vapi_server_sdk/types/open_ai_model_fallback_models_item.rb +2 -0
- data/lib/vapi_server_sdk/types/open_ai_model_model.rb +2 -0
- data/lib/vapi_server_sdk/types/play_ht_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/rime_ai_voice_id_enum.rb +22 -20
- data/lib/vapi_server_sdk/types/rime_ai_voice_model.rb +1 -0
- data/lib/vapi_server_sdk/types/say.rb +23 -14
- data/lib/vapi_server_sdk/types/say_hook.rb +81 -0
- data/lib/vapi_server_sdk/types/server.rb +17 -2
- data/lib/vapi_server_sdk/types/server_message_assistant_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_conversation_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_end_of_call_report_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_hang.rb +20 -2
- data/lib/vapi_server_sdk/types/server_message_knowledge_base_request.rb +14 -2
- data/lib/vapi_server_sdk/types/server_message_language_change_detected.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_message.rb +212 -237
- data/lib/vapi_server_sdk/types/server_message_model_output.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_phone_call_control.rb +18 -2
- data/lib/vapi_server_sdk/types/server_message_speech_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_status_update.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_status_update_ended_reason.rb +10 -1
- data/lib/vapi_server_sdk/types/server_message_tool_calls.rb +10 -2
- data/lib/vapi_server_sdk/types/server_message_transcript.rb +13 -2
- data/lib/vapi_server_sdk/types/server_message_transcript_type.rb +10 -0
- data/lib/vapi_server_sdk/types/server_message_transfer_destination_request.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_transfer_update.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_user_interrupted.rb +12 -2
- data/lib/vapi_server_sdk/types/server_message_voice_input.rb +11 -1
- data/lib/vapi_server_sdk/types/server_message_voice_request.rb +50 -2
- data/lib/vapi_server_sdk/types/stop_speaking_plan.rb +27 -2
- data/lib/vapi_server_sdk/types/subscription.rb +33 -5
- data/lib/vapi_server_sdk/types/sync_voice_library_dto_providers_item.rb +1 -0
- data/lib/vapi_server_sdk/types/test_suite.rb +104 -0
- data/lib/vapi_server_sdk/types/test_suite_run.rb +127 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai.rb +80 -0
- data/lib/vapi_server_sdk/types/test_suite_run_scorer_ai_result.rb +9 -0
- data/lib/vapi_server_sdk/types/test_suite_run_status.rb +10 -0
- data/lib/vapi_server_sdk/types/test_suite_run_test_attempt.rb +75 -0
- data/lib/vapi_server_sdk/types/{analytics_query_dto.rb → test_suite_run_test_attempt_call.rb} +19 -17
- data/lib/vapi_server_sdk/types/test_suite_run_test_result.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_runs_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suite_test_scorer_ai.rb +65 -0
- data/lib/vapi_server_sdk/types/test_suite_test_voice.rb +132 -0
- data/lib/vapi_server_sdk/types/test_suite_tests_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/test_suites_paginated_response.rb +75 -0
- data/lib/vapi_server_sdk/types/time_range_step.rb +1 -0
- data/lib/vapi_server_sdk/types/tool_message_start.rb +18 -2
- data/lib/vapi_server_sdk/types/transfer.rb +74 -0
- data/lib/vapi_server_sdk/types/transfer_assistant_hook_action.rb +75 -0
- data/lib/vapi_server_sdk/types/{buy_phone_number_dto_fallback_destination.rb → transfer_assistant_hook_action_destination.rb} +9 -12
- data/lib/vapi_server_sdk/types/transfer_destination_assistant.rb +46 -0
- data/lib/vapi_server_sdk/types/transfer_plan.rb +37 -1
- data/lib/vapi_server_sdk/types/transfer_plan_mode.rb +4 -0
- data/lib/vapi_server_sdk/types/trieve_knowledge_base_search_plan.rb +12 -1
- data/lib/vapi_server_sdk/types/twilio_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/twilio_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/update_azure_open_ai_credential_dto_models_item.rb +1 -0
- data/lib/vapi_server_sdk/types/update_test_suite_test_voice_dto.rb +90 -0
- data/lib/vapi_server_sdk/types/vapi_phone_number.rb +29 -4
- data/lib/vapi_server_sdk/types/vapi_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/vonage_phone_number.rb +11 -2
- data/lib/vapi_server_sdk/types/vonage_phone_number_status.rb +10 -0
- data/lib/vapi_server_sdk/types/workflow.rb +1 -9
- data/lib/vapi_server_sdk/types/workflow_nodes_item.rb +104 -52
- data/lib/vapi_server_sdk/types/xai_model.rb +4 -3
- data/lib/vapi_server_sdk/types/xai_model_model.rb +10 -0
- data/lib/vapi_server_sdk.rb +21 -0
- metadata +61 -12
- data/lib/vapi_server_sdk/types/buy_phone_number_dto.rb +0 -147
- data/lib/vapi_server_sdk/types/org_with_org_user.rb +0 -262
- data/lib/vapi_server_sdk/types/org_with_org_user_channel.rb +0 -10
- data/lib/vapi_server_sdk/types/org_with_org_user_role.rb +0 -9
- data/lib/vapi_server_sdk/types/update_workflow_dto.rb +0 -82
- data/lib/vapi_server_sdk/types/update_workflow_dto_nodes_item.rb +0 -81
@@ -1,262 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "subscription"
|
4
|
-
require "date"
|
5
|
-
require_relative "org_plan"
|
6
|
-
require_relative "org_with_org_user_channel"
|
7
|
-
require_relative "server"
|
8
|
-
require_relative "org_with_org_user_role"
|
9
|
-
require "ostruct"
|
10
|
-
require "json"
|
11
|
-
|
12
|
-
module Vapi
|
13
|
-
class OrgWithOrgUser
|
14
|
-
# @return [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
|
15
|
-
# the end of the call, you will still receive an end-of-call-report message to
|
16
|
-
# store on your server. Defaults to false.
|
17
|
-
# When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be
|
18
|
-
# available for LLM and Voice respectively.
|
19
|
-
# This is due to the compliance requirements of HIPAA. Other providers may not
|
20
|
-
# meet these requirements.
|
21
|
-
attr_reader :hipaa_enabled
|
22
|
-
# @return [Vapi::Subscription]
|
23
|
-
attr_reader :subscription
|
24
|
-
# @return [String] This is the ID of the subscription the org belongs to.
|
25
|
-
attr_reader :subscription_id
|
26
|
-
# @return [String] This is the unique identifier for the org.
|
27
|
-
attr_reader :id
|
28
|
-
# @return [DateTime] This is the ISO 8601 date-time string of when the org was created.
|
29
|
-
attr_reader :created_at
|
30
|
-
# @return [DateTime] This is the ISO 8601 date-time string of when the org was last updated.
|
31
|
-
attr_reader :updated_at
|
32
|
-
# @return [String] This is the Stripe customer for the org.
|
33
|
-
attr_reader :stripe_customer_id
|
34
|
-
# @return [String] This is the subscription for the org.
|
35
|
-
attr_reader :stripe_subscription_id
|
36
|
-
# @return [String] This is the subscription's subscription item.
|
37
|
-
attr_reader :stripe_subscription_item_id
|
38
|
-
# @return [DateTime] This is the subscription's current period start.
|
39
|
-
attr_reader :stripe_subscription_current_period_start
|
40
|
-
# @return [String] This is the subscription's status.
|
41
|
-
attr_reader :stripe_subscription_status
|
42
|
-
# @return [Vapi::OrgPlan] This is the plan for the org.
|
43
|
-
attr_reader :plan
|
44
|
-
# @return [String] This is the name of the org. This is just for your own reference.
|
45
|
-
attr_reader :name
|
46
|
-
# @return [Vapi::OrgWithOrgUserChannel] This is the channel of the org. There is the cluster the API traffic for the org
|
47
|
-
# will be directed.
|
48
|
-
attr_reader :channel
|
49
|
-
# @return [Float] This is the monthly billing limit for the org. To go beyond $1000/mo, please
|
50
|
-
# contact us at support@vapi.ai.
|
51
|
-
attr_reader :billing_limit
|
52
|
-
# @return [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
53
|
-
# with their shape in ServerMessage schema.
|
54
|
-
# The order of precedence is:
|
55
|
-
# 1. assistant.server
|
56
|
-
# 2. phoneNumber.server
|
57
|
-
# 3. org.server
|
58
|
-
attr_reader :server
|
59
|
-
# @return [Float] This is the concurrency limit for the org. This is the maximum number of calls
|
60
|
-
# that can be active at any given time. To go beyond 10, please contact us at
|
61
|
-
# support@vapi.ai.
|
62
|
-
attr_reader :concurrency_limit
|
63
|
-
# @return [String]
|
64
|
-
attr_reader :invited_by_user_id
|
65
|
-
# @return [Vapi::OrgWithOrgUserRole]
|
66
|
-
attr_reader :role
|
67
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
68
|
-
attr_reader :additional_properties
|
69
|
-
# @return [Object]
|
70
|
-
attr_reader :_field_set
|
71
|
-
protected :_field_set
|
72
|
-
|
73
|
-
OMIT = Object.new
|
74
|
-
|
75
|
-
# @param hipaa_enabled [Boolean] When this is enabled, no logs, recordings, or transcriptions will be stored. At
|
76
|
-
# the end of the call, you will still receive an end-of-call-report message to
|
77
|
-
# store on your server. Defaults to false.
|
78
|
-
# When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be
|
79
|
-
# available for LLM and Voice respectively.
|
80
|
-
# This is due to the compliance requirements of HIPAA. Other providers may not
|
81
|
-
# meet these requirements.
|
82
|
-
# @param subscription [Vapi::Subscription]
|
83
|
-
# @param subscription_id [String] This is the ID of the subscription the org belongs to.
|
84
|
-
# @param id [String] This is the unique identifier for the org.
|
85
|
-
# @param created_at [DateTime] This is the ISO 8601 date-time string of when the org was created.
|
86
|
-
# @param updated_at [DateTime] This is the ISO 8601 date-time string of when the org was last updated.
|
87
|
-
# @param stripe_customer_id [String] This is the Stripe customer for the org.
|
88
|
-
# @param stripe_subscription_id [String] This is the subscription for the org.
|
89
|
-
# @param stripe_subscription_item_id [String] This is the subscription's subscription item.
|
90
|
-
# @param stripe_subscription_current_period_start [DateTime] This is the subscription's current period start.
|
91
|
-
# @param stripe_subscription_status [String] This is the subscription's status.
|
92
|
-
# @param plan [Vapi::OrgPlan] This is the plan for the org.
|
93
|
-
# @param name [String] This is the name of the org. This is just for your own reference.
|
94
|
-
# @param channel [Vapi::OrgWithOrgUserChannel] This is the channel of the org. There is the cluster the API traffic for the org
|
95
|
-
# will be directed.
|
96
|
-
# @param billing_limit [Float] This is the monthly billing limit for the org. To go beyond $1000/mo, please
|
97
|
-
# contact us at support@vapi.ai.
|
98
|
-
# @param server [Vapi::Server] This is where Vapi will send webhooks. You can find all webhooks available along
|
99
|
-
# with their shape in ServerMessage schema.
|
100
|
-
# The order of precedence is:
|
101
|
-
# 1. assistant.server
|
102
|
-
# 2. phoneNumber.server
|
103
|
-
# 3. org.server
|
104
|
-
# @param concurrency_limit [Float] This is the concurrency limit for the org. This is the maximum number of calls
|
105
|
-
# that can be active at any given time. To go beyond 10, please contact us at
|
106
|
-
# support@vapi.ai.
|
107
|
-
# @param invited_by_user_id [String]
|
108
|
-
# @param role [Vapi::OrgWithOrgUserRole]
|
109
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
110
|
-
# @return [Vapi::OrgWithOrgUser]
|
111
|
-
def initialize(id:, created_at:, updated_at:, hipaa_enabled: OMIT, subscription: OMIT, subscription_id: OMIT,
|
112
|
-
stripe_customer_id: OMIT, stripe_subscription_id: OMIT, stripe_subscription_item_id: OMIT, stripe_subscription_current_period_start: OMIT, stripe_subscription_status: OMIT, plan: OMIT, name: OMIT, channel: OMIT, billing_limit: OMIT, server: OMIT, concurrency_limit: OMIT, invited_by_user_id: OMIT, role: OMIT, additional_properties: nil)
|
113
|
-
@hipaa_enabled = hipaa_enabled if hipaa_enabled != OMIT
|
114
|
-
@subscription = subscription if subscription != OMIT
|
115
|
-
@subscription_id = subscription_id if subscription_id != OMIT
|
116
|
-
@id = id
|
117
|
-
@created_at = created_at
|
118
|
-
@updated_at = updated_at
|
119
|
-
@stripe_customer_id = stripe_customer_id if stripe_customer_id != OMIT
|
120
|
-
@stripe_subscription_id = stripe_subscription_id if stripe_subscription_id != OMIT
|
121
|
-
@stripe_subscription_item_id = stripe_subscription_item_id if stripe_subscription_item_id != OMIT
|
122
|
-
if stripe_subscription_current_period_start != OMIT
|
123
|
-
@stripe_subscription_current_period_start = stripe_subscription_current_period_start
|
124
|
-
end
|
125
|
-
@stripe_subscription_status = stripe_subscription_status if stripe_subscription_status != OMIT
|
126
|
-
@plan = plan if plan != OMIT
|
127
|
-
@name = name if name != OMIT
|
128
|
-
@channel = channel if channel != OMIT
|
129
|
-
@billing_limit = billing_limit if billing_limit != OMIT
|
130
|
-
@server = server if server != OMIT
|
131
|
-
@concurrency_limit = concurrency_limit if concurrency_limit != OMIT
|
132
|
-
@invited_by_user_id = invited_by_user_id if invited_by_user_id != OMIT
|
133
|
-
@role = role if role != OMIT
|
134
|
-
@additional_properties = additional_properties
|
135
|
-
@_field_set = {
|
136
|
-
"hipaaEnabled": hipaa_enabled,
|
137
|
-
"subscription": subscription,
|
138
|
-
"subscriptionId": subscription_id,
|
139
|
-
"id": id,
|
140
|
-
"createdAt": created_at,
|
141
|
-
"updatedAt": updated_at,
|
142
|
-
"stripeCustomerId": stripe_customer_id,
|
143
|
-
"stripeSubscriptionId": stripe_subscription_id,
|
144
|
-
"stripeSubscriptionItemId": stripe_subscription_item_id,
|
145
|
-
"stripeSubscriptionCurrentPeriodStart": stripe_subscription_current_period_start,
|
146
|
-
"stripeSubscriptionStatus": stripe_subscription_status,
|
147
|
-
"plan": plan,
|
148
|
-
"name": name,
|
149
|
-
"channel": channel,
|
150
|
-
"billingLimit": billing_limit,
|
151
|
-
"server": server,
|
152
|
-
"concurrencyLimit": concurrency_limit,
|
153
|
-
"invitedByUserId": invited_by_user_id,
|
154
|
-
"role": role
|
155
|
-
}.reject do |_k, v|
|
156
|
-
v == OMIT
|
157
|
-
end
|
158
|
-
end
|
159
|
-
|
160
|
-
# Deserialize a JSON object to an instance of OrgWithOrgUser
|
161
|
-
#
|
162
|
-
# @param json_object [String]
|
163
|
-
# @return [Vapi::OrgWithOrgUser]
|
164
|
-
def self.from_json(json_object:)
|
165
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
166
|
-
parsed_json = JSON.parse(json_object)
|
167
|
-
hipaa_enabled = parsed_json["hipaaEnabled"]
|
168
|
-
if parsed_json["subscription"].nil?
|
169
|
-
subscription = nil
|
170
|
-
else
|
171
|
-
subscription = parsed_json["subscription"].to_json
|
172
|
-
subscription = Vapi::Subscription.from_json(json_object: subscription)
|
173
|
-
end
|
174
|
-
subscription_id = parsed_json["subscriptionId"]
|
175
|
-
id = parsed_json["id"]
|
176
|
-
created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
|
177
|
-
updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
|
178
|
-
stripe_customer_id = parsed_json["stripeCustomerId"]
|
179
|
-
stripe_subscription_id = parsed_json["stripeSubscriptionId"]
|
180
|
-
stripe_subscription_item_id = parsed_json["stripeSubscriptionItemId"]
|
181
|
-
stripe_subscription_current_period_start = unless parsed_json["stripeSubscriptionCurrentPeriodStart"].nil?
|
182
|
-
DateTime.parse(parsed_json["stripeSubscriptionCurrentPeriodStart"])
|
183
|
-
end
|
184
|
-
stripe_subscription_status = parsed_json["stripeSubscriptionStatus"]
|
185
|
-
if parsed_json["plan"].nil?
|
186
|
-
plan = nil
|
187
|
-
else
|
188
|
-
plan = parsed_json["plan"].to_json
|
189
|
-
plan = Vapi::OrgPlan.from_json(json_object: plan)
|
190
|
-
end
|
191
|
-
name = parsed_json["name"]
|
192
|
-
channel = parsed_json["channel"]
|
193
|
-
billing_limit = parsed_json["billingLimit"]
|
194
|
-
if parsed_json["server"].nil?
|
195
|
-
server = nil
|
196
|
-
else
|
197
|
-
server = parsed_json["server"].to_json
|
198
|
-
server = Vapi::Server.from_json(json_object: server)
|
199
|
-
end
|
200
|
-
concurrency_limit = parsed_json["concurrencyLimit"]
|
201
|
-
invited_by_user_id = parsed_json["invitedByUserId"]
|
202
|
-
role = parsed_json["role"]
|
203
|
-
new(
|
204
|
-
hipaa_enabled: hipaa_enabled,
|
205
|
-
subscription: subscription,
|
206
|
-
subscription_id: subscription_id,
|
207
|
-
id: id,
|
208
|
-
created_at: created_at,
|
209
|
-
updated_at: updated_at,
|
210
|
-
stripe_customer_id: stripe_customer_id,
|
211
|
-
stripe_subscription_id: stripe_subscription_id,
|
212
|
-
stripe_subscription_item_id: stripe_subscription_item_id,
|
213
|
-
stripe_subscription_current_period_start: stripe_subscription_current_period_start,
|
214
|
-
stripe_subscription_status: stripe_subscription_status,
|
215
|
-
plan: plan,
|
216
|
-
name: name,
|
217
|
-
channel: channel,
|
218
|
-
billing_limit: billing_limit,
|
219
|
-
server: server,
|
220
|
-
concurrency_limit: concurrency_limit,
|
221
|
-
invited_by_user_id: invited_by_user_id,
|
222
|
-
role: role,
|
223
|
-
additional_properties: struct
|
224
|
-
)
|
225
|
-
end
|
226
|
-
|
227
|
-
# Serialize an instance of OrgWithOrgUser to a JSON object
|
228
|
-
#
|
229
|
-
# @return [String]
|
230
|
-
def to_json(*_args)
|
231
|
-
@_field_set&.to_json
|
232
|
-
end
|
233
|
-
|
234
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
235
|
-
# hash and check each fields type against the current object's property
|
236
|
-
# definitions.
|
237
|
-
#
|
238
|
-
# @param obj [Object]
|
239
|
-
# @return [Void]
|
240
|
-
def self.validate_raw(obj:)
|
241
|
-
obj.hipaa_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.hipaa_enabled is not the expected type, validation failed.")
|
242
|
-
obj.subscription.nil? || Vapi::Subscription.validate_raw(obj: obj.subscription)
|
243
|
-
obj.subscription_id&.is_a?(String) != false || raise("Passed value for field obj.subscription_id is not the expected type, validation failed.")
|
244
|
-
obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
|
245
|
-
obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.")
|
246
|
-
obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.")
|
247
|
-
obj.stripe_customer_id&.is_a?(String) != false || raise("Passed value for field obj.stripe_customer_id is not the expected type, validation failed.")
|
248
|
-
obj.stripe_subscription_id&.is_a?(String) != false || raise("Passed value for field obj.stripe_subscription_id is not the expected type, validation failed.")
|
249
|
-
obj.stripe_subscription_item_id&.is_a?(String) != false || raise("Passed value for field obj.stripe_subscription_item_id is not the expected type, validation failed.")
|
250
|
-
obj.stripe_subscription_current_period_start&.is_a?(DateTime) != false || raise("Passed value for field obj.stripe_subscription_current_period_start is not the expected type, validation failed.")
|
251
|
-
obj.stripe_subscription_status&.is_a?(String) != false || raise("Passed value for field obj.stripe_subscription_status is not the expected type, validation failed.")
|
252
|
-
obj.plan.nil? || Vapi::OrgPlan.validate_raw(obj: obj.plan)
|
253
|
-
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
254
|
-
obj.channel&.is_a?(Vapi::OrgWithOrgUserChannel) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.")
|
255
|
-
obj.billing_limit&.is_a?(Float) != false || raise("Passed value for field obj.billing_limit is not the expected type, validation failed.")
|
256
|
-
obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server)
|
257
|
-
obj.concurrency_limit&.is_a?(Float) != false || raise("Passed value for field obj.concurrency_limit is not the expected type, validation failed.")
|
258
|
-
obj.invited_by_user_id&.is_a?(String) != false || raise("Passed value for field obj.invited_by_user_id is not the expected type, validation failed.")
|
259
|
-
obj.role&.is_a?(Vapi::OrgWithOrgUserRole) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
|
260
|
-
end
|
261
|
-
end
|
262
|
-
end
|
@@ -1,82 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative "update_workflow_dto_nodes_item"
|
4
|
-
require_relative "edge"
|
5
|
-
require "ostruct"
|
6
|
-
require "json"
|
7
|
-
|
8
|
-
module Vapi
|
9
|
-
class UpdateWorkflowDto
|
10
|
-
# @return [Array<Vapi::UpdateWorkflowDtoNodesItem>]
|
11
|
-
attr_reader :nodes
|
12
|
-
# @return [String]
|
13
|
-
attr_reader :name
|
14
|
-
# @return [Array<Vapi::Edge>]
|
15
|
-
attr_reader :edges
|
16
|
-
# @return [OpenStruct] Additional properties unmapped to the current class definition
|
17
|
-
attr_reader :additional_properties
|
18
|
-
# @return [Object]
|
19
|
-
attr_reader :_field_set
|
20
|
-
protected :_field_set
|
21
|
-
|
22
|
-
OMIT = Object.new
|
23
|
-
|
24
|
-
# @param nodes [Array<Vapi::UpdateWorkflowDtoNodesItem>]
|
25
|
-
# @param name [String]
|
26
|
-
# @param edges [Array<Vapi::Edge>]
|
27
|
-
# @param additional_properties [OpenStruct] Additional properties unmapped to the current class definition
|
28
|
-
# @return [Vapi::UpdateWorkflowDto]
|
29
|
-
def initialize(nodes: OMIT, name: OMIT, edges: OMIT, additional_properties: nil)
|
30
|
-
@nodes = nodes if nodes != OMIT
|
31
|
-
@name = name if name != OMIT
|
32
|
-
@edges = edges if edges != OMIT
|
33
|
-
@additional_properties = additional_properties
|
34
|
-
@_field_set = { "nodes": nodes, "name": name, "edges": edges }.reject do |_k, v|
|
35
|
-
v == OMIT
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
# Deserialize a JSON object to an instance of UpdateWorkflowDto
|
40
|
-
#
|
41
|
-
# @param json_object [String]
|
42
|
-
# @return [Vapi::UpdateWorkflowDto]
|
43
|
-
def self.from_json(json_object:)
|
44
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
45
|
-
parsed_json = JSON.parse(json_object)
|
46
|
-
nodes = parsed_json["nodes"]&.map do |item|
|
47
|
-
item = item.to_json
|
48
|
-
Vapi::UpdateWorkflowDtoNodesItem.from_json(json_object: item)
|
49
|
-
end
|
50
|
-
name = parsed_json["name"]
|
51
|
-
edges = parsed_json["edges"]&.map do |item|
|
52
|
-
item = item.to_json
|
53
|
-
Vapi::Edge.from_json(json_object: item)
|
54
|
-
end
|
55
|
-
new(
|
56
|
-
nodes: nodes,
|
57
|
-
name: name,
|
58
|
-
edges: edges,
|
59
|
-
additional_properties: struct
|
60
|
-
)
|
61
|
-
end
|
62
|
-
|
63
|
-
# Serialize an instance of UpdateWorkflowDto to a JSON object
|
64
|
-
#
|
65
|
-
# @return [String]
|
66
|
-
def to_json(*_args)
|
67
|
-
@_field_set&.to_json
|
68
|
-
end
|
69
|
-
|
70
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
71
|
-
# hash and check each fields type against the current object's property
|
72
|
-
# definitions.
|
73
|
-
#
|
74
|
-
# @param obj [Object]
|
75
|
-
# @return [Void]
|
76
|
-
def self.validate_raw(obj:)
|
77
|
-
obj.nodes&.is_a?(Array) != false || raise("Passed value for field obj.nodes is not the expected type, validation failed.")
|
78
|
-
obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
|
79
|
-
obj.edges&.is_a?(Array) != false || raise("Passed value for field obj.edges is not the expected type, validation failed.")
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,81 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "json"
|
4
|
-
require_relative "say"
|
5
|
-
require_relative "gather"
|
6
|
-
require_relative "create_workflow_dto"
|
7
|
-
|
8
|
-
module Vapi
|
9
|
-
class UpdateWorkflowDtoNodesItem
|
10
|
-
# Deserialize a JSON object to an instance of UpdateWorkflowDtoNodesItem
|
11
|
-
#
|
12
|
-
# @param json_object [String]
|
13
|
-
# @return [Vapi::UpdateWorkflowDtoNodesItem]
|
14
|
-
def self.from_json(json_object:)
|
15
|
-
struct = JSON.parse(json_object, object_class: OpenStruct)
|
16
|
-
begin
|
17
|
-
Vapi::Say.validate_raw(obj: struct)
|
18
|
-
return Vapi::Say.from_json(json_object: struct) unless struct.nil?
|
19
|
-
|
20
|
-
return nil
|
21
|
-
rescue StandardError
|
22
|
-
# noop
|
23
|
-
end
|
24
|
-
begin
|
25
|
-
Vapi::Gather.validate_raw(obj: struct)
|
26
|
-
return Vapi::Gather.from_json(json_object: struct) unless struct.nil?
|
27
|
-
|
28
|
-
return nil
|
29
|
-
rescue StandardError
|
30
|
-
# noop
|
31
|
-
end
|
32
|
-
begin
|
33
|
-
struct.is_a?(Object) != false || raise("Passed value for field struct is not the expected type, validation failed.")
|
34
|
-
return struct unless struct.nil?
|
35
|
-
|
36
|
-
return nil
|
37
|
-
rescue StandardError
|
38
|
-
# noop
|
39
|
-
end
|
40
|
-
begin
|
41
|
-
Vapi::CreateWorkflowDto.validate_raw(obj: struct)
|
42
|
-
return Vapi::CreateWorkflowDto.from_json(json_object: struct) unless struct.nil?
|
43
|
-
|
44
|
-
return nil
|
45
|
-
rescue StandardError
|
46
|
-
# noop
|
47
|
-
end
|
48
|
-
struct
|
49
|
-
end
|
50
|
-
|
51
|
-
# Leveraged for Union-type generation, validate_raw attempts to parse the given
|
52
|
-
# hash and check each fields type against the current object's property
|
53
|
-
# definitions.
|
54
|
-
#
|
55
|
-
# @param obj [Object]
|
56
|
-
# @return [Void]
|
57
|
-
def self.validate_raw(obj:)
|
58
|
-
begin
|
59
|
-
return Vapi::Say.validate_raw(obj: obj)
|
60
|
-
rescue StandardError
|
61
|
-
# noop
|
62
|
-
end
|
63
|
-
begin
|
64
|
-
return Vapi::Gather.validate_raw(obj: obj)
|
65
|
-
rescue StandardError
|
66
|
-
# noop
|
67
|
-
end
|
68
|
-
begin
|
69
|
-
return obj.is_a?(Object) != false || raise("Passed value for field obj is not the expected type, validation failed.")
|
70
|
-
rescue StandardError
|
71
|
-
# noop
|
72
|
-
end
|
73
|
-
begin
|
74
|
-
return Vapi::CreateWorkflowDto.validate_raw(obj: obj)
|
75
|
-
rescue StandardError
|
76
|
-
# noop
|
77
|
-
end
|
78
|
-
raise("Passed value matched no type within the union, validation failed.")
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|