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.
-
#compliance_plan ⇒ Vapi::CompliancePlan
readonly
Stores the information about the compliance plan enforced at the organization level.
-
#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.
-
#jwt_secret ⇒ String
readonly
This is the secret key used for signing JWT tokens for the org.
-
#minutes_used ⇒ Float
readonly
This is the total number of call minutes used by this org across all time.
-
#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, jwt_secret: OMIT, minutes_used: OMIT, name: OMIT, channel: OMIT, billing_limit: OMIT, server: OMIT, concurrency_limit: OMIT, compliance_plan: 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, jwt_secret: OMIT, minutes_used: OMIT, name: OMIT, channel: OMIT, billing_limit: OMIT, server: OMIT, concurrency_limit: OMIT, compliance_plan: OMIT, additional_properties: nil) ⇒ Vapi::Org
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 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 |
# File 'lib/vapi_server_sdk/types/org.rb', line 134 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, jwt_secret: OMIT, minutes_used: OMIT, name: OMIT, channel: OMIT, billing_limit: OMIT, server: OMIT, concurrency_limit: OMIT, compliance_plan: 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 @jwt_secret = jwt_secret if jwt_secret != OMIT @minutes_used = minutes_used if minutes_used != 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 @compliance_plan = compliance_plan if compliance_plan != 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, "jwtSecret": jwt_secret, "minutesUsed": minutes_used, "name": name, "channel": channel, "billingLimit": billing_limit, "server": server, "concurrencyLimit": concurrency_limit, "compliancePlan": compliance_plan }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
80 81 82 |
# File 'lib/vapi_server_sdk/types/org.rb', line 80 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].
55 56 57 |
# File 'lib/vapi_server_sdk/types/org.rb', line 55 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.
52 53 54 |
# File 'lib/vapi_server_sdk/types/org.rb', line 52 def channel @channel end |
#compliance_plan ⇒ Vapi::CompliancePlan (readonly)
Returns Stores the information about the compliance plan enforced at the organization level. Currently pciEnabled is supported through this field. When this is enabled, any logs, recordings, or transcriptions will be shipped to the customer endpoints if provided else lost. At the end of the call, you will receive an end-of-call-report message to store on your server, if webhook is provided. Defaults to false. When PCI is enabled, only PCI-compliant Providers will be available for LLM, Voice and transcribers. This is due to the compliance requirements of PCI. Other providers may not meet these requirements.
78 79 80 |
# File 'lib/vapi_server_sdk/types/org.rb', line 78 def compliance_plan @compliance_plan 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].
66 67 68 |
# File 'lib/vapi_server_sdk/types/org.rb', line 66 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.
29 30 31 |
# File 'lib/vapi_server_sdk/types/org.rb', line 29 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.
21 22 23 |
# File 'lib/vapi_server_sdk/types/org.rb', line 21 def hipaa_enabled @hipaa_enabled end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the org.
27 28 29 |
# File 'lib/vapi_server_sdk/types/org.rb', line 27 def id @id end |
#jwt_secret ⇒ String (readonly)
Returns This is the secret key used for signing JWT tokens for the org.
45 46 47 |
# File 'lib/vapi_server_sdk/types/org.rb', line 45 def jwt_secret @jwt_secret end |
#minutes_used ⇒ Float (readonly)
Returns This is the total number of call minutes used by this org across all time.
47 48 49 |
# File 'lib/vapi_server_sdk/types/org.rb', line 47 def minutes_used @minutes_used end |
#name ⇒ String (readonly)
Returns This is the name of the org. This is just for your own reference.
49 50 51 |
# File 'lib/vapi_server_sdk/types/org.rb', line 49 def name @name end |
#plan ⇒ Vapi::OrgPlan (readonly)
Returns This is the plan for the org.
43 44 45 |
# File 'lib/vapi_server_sdk/types/org.rb', line 43 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.
62 63 64 |
# File 'lib/vapi_server_sdk/types/org.rb', line 62 def server @server end |
#stripe_customer_id ⇒ String (readonly)
Returns This is the Stripe customer for the org.
33 34 35 |
# File 'lib/vapi_server_sdk/types/org.rb', line 33 def stripe_customer_id @stripe_customer_id end |
#stripe_subscription_current_period_start ⇒ DateTime (readonly)
Returns This is the subscription’s current period start.
39 40 41 |
# File 'lib/vapi_server_sdk/types/org.rb', line 39 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.
35 36 37 |
# File 'lib/vapi_server_sdk/types/org.rb', line 35 def stripe_subscription_id @stripe_subscription_id end |
#stripe_subscription_item_id ⇒ String (readonly)
Returns This is the subscription’s subscription item.
37 38 39 |
# File 'lib/vapi_server_sdk/types/org.rb', line 37 def stripe_subscription_item_id @stripe_subscription_item_id end |
#stripe_subscription_status ⇒ String (readonly)
Returns This is the subscription’s status.
41 42 43 |
# File 'lib/vapi_server_sdk/types/org.rb', line 41 def stripe_subscription_status @stripe_subscription_status end |
#subscription ⇒ Vapi::Subscription (readonly)
23 24 25 |
# File 'lib/vapi_server_sdk/types/org.rb', line 23 def subscription @subscription end |
#subscription_id ⇒ String (readonly)
Returns This is the ID of the subscription the org belongs to.
25 26 27 |
# File 'lib/vapi_server_sdk/types/org.rb', line 25 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.
31 32 33 |
# File 'lib/vapi_server_sdk/types/org.rb', line 31 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Org
Deserialize a JSON object to an instance of Org
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
# File 'lib/vapi_server_sdk/types/org.rb', line 189 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 jwt_secret = parsed_json["jwtSecret"] minutes_used = parsed_json["minutesUsed"] 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"] if parsed_json["compliancePlan"].nil? compliance_plan = nil else compliance_plan = parsed_json["compliancePlan"].to_json compliance_plan = Vapi::CompliancePlan.from_json(json_object: compliance_plan) end 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, jwt_secret: jwt_secret, minutes_used: minutes_used, name: name, channel: channel, billing_limit: billing_limit, server: server, concurrency_limit: concurrency_limit, compliance_plan: compliance_plan, 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.
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/vapi_server_sdk/types/org.rb', line 272 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.jwt_secret&.is_a?(String) != false || raise("Passed value for field obj.jwt_secret is not the expected type, validation failed.") obj.minutes_used&.is_a?(Float) != false || raise("Passed value for field obj.minutes_used is not the expected type, validation failed.") 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.") obj.compliance_plan.nil? || Vapi::CompliancePlan.validate_raw(obj: obj.compliance_plan) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of Org to a JSON object
262 263 264 |
# File 'lib/vapi_server_sdk/types/org.rb', line 262 def to_json(*_args) @_field_set&.to_json end |