Class: Vapi::Org
- Inherits:
-
Object
- Object
- Vapi::Org
- Defined in:
- lib/vapi_server_sdk/types/org.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#billing_limit ⇒ Float
readonly
This is the monthly billing limit for the org.
-
#channel ⇒ Vapi::OrgChannel
readonly
This is the channel of the org.
-
#concurrency_limit ⇒ Float
readonly
This is the concurrency limit for the org.
-
#created_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the org was created.
-
#hipaa_enabled ⇒ Boolean
readonly
When this is enabled, no logs, recordings, or transcriptions will be stored.
-
#id ⇒ String
readonly
This is the unique identifier for the org.
-
#name ⇒ String
readonly
This is the name of the org.
-
#plan ⇒ Vapi::OrgPlan
readonly
This is the plan for the org.
-
#server ⇒ Vapi::Server
readonly
This is where Vapi will send webhooks.
-
#stripe_customer_id ⇒ String
readonly
This is the Stripe customer for the org.
-
#stripe_subscription_current_period_start ⇒ DateTime
readonly
This is the subscription's current period start.
-
#stripe_subscription_id ⇒ String
readonly
This is the subscription for the org.
-
#stripe_subscription_item_id ⇒ String
readonly
This is the subscription's subscription item.
-
#stripe_subscription_status ⇒ String
readonly
This is the subscription's status.
- #subscription ⇒ Vapi::Subscription readonly
-
#subscription_id ⇒ String
readonly
This is the ID of the subscription the org belongs to.
-
#updated_at ⇒ DateTime
readonly
This is the ISO 8601 date-time string of when the org was last updated.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::Org
Deserialize a JSON object to an instance of Org.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
Instance Method Summary collapse
- #initialize(id:, created_at:, updated_at:, hipaa_enabled: OMIT, subscription: OMIT, subscription_id: OMIT, 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, additional_properties: nil) ⇒ Vapi::Org constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of Org to a JSON object.
Constructor Details
#initialize(id:, created_at:, updated_at:, hipaa_enabled: OMIT, subscription: OMIT, subscription_id: OMIT, 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, additional_properties: nil) ⇒ Vapi::Org
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/vapi_server_sdk/types/org.rb', line 104 def initialize(id:, created_at:, updated_at:, hipaa_enabled: OMIT, subscription: OMIT, subscription_id: OMIT, 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, additional_properties: nil) @hipaa_enabled = hipaa_enabled if hipaa_enabled != OMIT @subscription = subscription if subscription != OMIT @subscription_id = subscription_id if subscription_id != OMIT @id = id @created_at = created_at @updated_at = updated_at @stripe_customer_id = stripe_customer_id if stripe_customer_id != OMIT @stripe_subscription_id = stripe_subscription_id if stripe_subscription_id != OMIT @stripe_subscription_item_id = stripe_subscription_item_id if stripe_subscription_item_id != OMIT if stripe_subscription_current_period_start != OMIT @stripe_subscription_current_period_start = stripe_subscription_current_period_start end @stripe_subscription_status = stripe_subscription_status if stripe_subscription_status != OMIT @plan = plan if plan != OMIT @name = name if name != OMIT @channel = channel if channel != OMIT @billing_limit = billing_limit if billing_limit != OMIT @server = server if server != OMIT @concurrency_limit = concurrency_limit if concurrency_limit != OMIT @additional_properties = additional_properties @_field_set = { "hipaaEnabled": hipaa_enabled, "subscription": subscription, "subscriptionId": subscription_id, "id": id, "createdAt": created_at, "updatedAt": updated_at, "stripeCustomerId": stripe_customer_id, "stripeSubscriptionId": stripe_subscription_id, "stripeSubscriptionItemId": stripe_subscription_item_id, "stripeSubscriptionCurrentPeriodStart": stripe_subscription_current_period_start, "stripeSubscriptionStatus": stripe_subscription_status, "plan": plan, "name": name, "channel": channel, "billingLimit": billing_limit, "server": server, "concurrencyLimit": concurrency_limit }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
63 64 65 |
# File 'lib/vapi_server_sdk/types/org.rb', line 63 def additional_properties @additional_properties end |
#billing_limit ⇒ Float (readonly)
Returns This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at [email protected].
50 51 52 |
# File 'lib/vapi_server_sdk/types/org.rb', line 50 def billing_limit @billing_limit end |
#channel ⇒ Vapi::OrgChannel (readonly)
Returns This is the channel of the org. There is the cluster the API traffic for the org will be directed.
47 48 49 |
# File 'lib/vapi_server_sdk/types/org.rb', line 47 def channel @channel end |
#concurrency_limit ⇒ Float (readonly)
Returns This is the concurrency limit for the org. This is the maximum number of calls that can be active at any given time. To go beyond 10, please contact us at [email protected].
61 62 63 |
# File 'lib/vapi_server_sdk/types/org.rb', line 61 def concurrency_limit @concurrency_limit end |
#created_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the org was created.
28 29 30 |
# File 'lib/vapi_server_sdk/types/org.rb', line 28 def created_at @created_at end |
#hipaa_enabled ⇒ Boolean (readonly)
Returns When this is enabled, no logs, recordings, or transcriptions will be stored. At the end of the call, you will still receive an end-of-call-report message to store on your server. Defaults to false. When HIPAA is enabled, only OpenAI/Custom LLM or Azure Providers will be available for LLM and Voice respectively. This is due to the compliance requirements of HIPAA. Other providers may not meet these requirements.
20 21 22 |
# File 'lib/vapi_server_sdk/types/org.rb', line 20 def hipaa_enabled @hipaa_enabled end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the org.
26 27 28 |
# File 'lib/vapi_server_sdk/types/org.rb', line 26 def id @id end |
#name ⇒ String (readonly)
Returns This is the name of the org. This is just for your own reference.
44 45 46 |
# File 'lib/vapi_server_sdk/types/org.rb', line 44 def name @name end |
#plan ⇒ Vapi::OrgPlan (readonly)
Returns This is the plan for the org.
42 43 44 |
# File 'lib/vapi_server_sdk/types/org.rb', line 42 def plan @plan end |
#server ⇒ Vapi::Server (readonly)
Returns This is where Vapi will send webhooks. You can find all webhooks available along with their shape in ServerMessage schema. The order of precedence is:
- assistant.server
- phoneNumber.server
- org.server.
57 58 59 |
# File 'lib/vapi_server_sdk/types/org.rb', line 57 def server @server end |
#stripe_customer_id ⇒ String (readonly)
Returns This is the Stripe customer for the org.
32 33 34 |
# File 'lib/vapi_server_sdk/types/org.rb', line 32 def stripe_customer_id @stripe_customer_id end |
#stripe_subscription_current_period_start ⇒ DateTime (readonly)
Returns This is the subscription's current period start.
38 39 40 |
# File 'lib/vapi_server_sdk/types/org.rb', line 38 def stripe_subscription_current_period_start @stripe_subscription_current_period_start end |
#stripe_subscription_id ⇒ String (readonly)
Returns This is the subscription for the org.
34 35 36 |
# File 'lib/vapi_server_sdk/types/org.rb', line 34 def stripe_subscription_id @stripe_subscription_id end |
#stripe_subscription_item_id ⇒ String (readonly)
Returns This is the subscription's subscription item.
36 37 38 |
# File 'lib/vapi_server_sdk/types/org.rb', line 36 def stripe_subscription_item_id @stripe_subscription_item_id end |
#stripe_subscription_status ⇒ String (readonly)
Returns This is the subscription's status.
40 41 42 |
# File 'lib/vapi_server_sdk/types/org.rb', line 40 def stripe_subscription_status @stripe_subscription_status end |
#subscription ⇒ Vapi::Subscription (readonly)
22 23 24 |
# File 'lib/vapi_server_sdk/types/org.rb', line 22 def subscription @subscription end |
#subscription_id ⇒ String (readonly)
Returns This is the ID of the subscription the org belongs to.
24 25 26 |
# File 'lib/vapi_server_sdk/types/org.rb', line 24 def subscription_id @subscription_id end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the org was last updated.
30 31 32 |
# File 'lib/vapi_server_sdk/types/org.rb', line 30 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Org
Deserialize a JSON object to an instance of Org
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/vapi_server_sdk/types/org.rb', line 153 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) hipaa_enabled = parsed_json["hipaaEnabled"] if parsed_json["subscription"].nil? subscription = nil else subscription = parsed_json["subscription"].to_json subscription = Vapi::Subscription.from_json(json_object: subscription) end subscription_id = parsed_json["subscriptionId"] id = parsed_json["id"] created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?) updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?) stripe_customer_id = parsed_json["stripeCustomerId"] stripe_subscription_id = parsed_json["stripeSubscriptionId"] stripe_subscription_item_id = parsed_json["stripeSubscriptionItemId"] stripe_subscription_current_period_start = unless parsed_json["stripeSubscriptionCurrentPeriodStart"].nil? DateTime.parse(parsed_json["stripeSubscriptionCurrentPeriodStart"]) end stripe_subscription_status = parsed_json["stripeSubscriptionStatus"] if parsed_json["plan"].nil? plan = nil else plan = parsed_json["plan"].to_json plan = Vapi::OrgPlan.from_json(json_object: plan) end name = parsed_json["name"] channel = parsed_json["channel"] billing_limit = parsed_json["billingLimit"] if parsed_json["server"].nil? server = nil else server = parsed_json["server"].to_json server = Vapi::Server.from_json(json_object: server) end concurrency_limit = parsed_json["concurrencyLimit"] new( hipaa_enabled: hipaa_enabled, subscription: subscription, subscription_id: subscription_id, id: id, created_at: created_at, updated_at: updated_at, stripe_customer_id: stripe_customer_id, stripe_subscription_id: stripe_subscription_id, stripe_subscription_item_id: stripe_subscription_item_id, stripe_subscription_current_period_start: stripe_subscription_current_period_start, stripe_subscription_status: stripe_subscription_status, plan: plan, name: name, channel: channel, billing_limit: billing_limit, server: server, concurrency_limit: concurrency_limit, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object's property definitions.
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/vapi_server_sdk/types/org.rb', line 225 def self.validate_raw(obj:) obj.hipaa_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.hipaa_enabled is not the expected type, validation failed.") obj.subscription.nil? || Vapi::Subscription.validate_raw(obj: obj.subscription) obj.subscription_id&.is_a?(String) != false || raise("Passed value for field obj.subscription_id is not the expected type, validation failed.") obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.created_at.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.updated_at.is_a?(DateTime) != false || raise("Passed value for field obj.updated_at is not the expected type, validation failed.") obj.stripe_customer_id&.is_a?(String) != false || raise("Passed value for field obj.stripe_customer_id is not the expected type, validation failed.") obj.stripe_subscription_id&.is_a?(String) != false || raise("Passed value for field obj.stripe_subscription_id is not the expected type, validation failed.") 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.") 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.") obj.stripe_subscription_status&.is_a?(String) != false || raise("Passed value for field obj.stripe_subscription_status is not the expected type, validation failed.") obj.plan.nil? || Vapi::OrgPlan.validate_raw(obj: obj.plan) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.channel&.is_a?(Vapi::OrgChannel) != false || raise("Passed value for field obj.channel is not the expected type, validation failed.") obj.billing_limit&.is_a?(Float) != false || raise("Passed value for field obj.billing_limit is not the expected type, validation failed.") obj.server.nil? || Vapi::Server.validate_raw(obj: obj.server) obj.concurrency_limit&.is_a?(Float) != false || raise("Passed value for field obj.concurrency_limit is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Org to a JSON object
215 216 217 |
# File 'lib/vapi_server_sdk/types/org.rb', line 215 def to_json(*_args) @_field_set&.to_json end |