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.
-
#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_url ⇒ String
readonly
This is the URL Vapi will communicate with via HTTP GET and POST Requests.
-
#server_url_secret ⇒ String
readonly
This is the secret you can set that Vapi will send with every request to your server.
-
#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.
-
#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, 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, billing_limit: OMIT, server_url: OMIT, server_url_secret: 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, 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, billing_limit: OMIT, server_url: OMIT, server_url_secret: OMIT, concurrency_limit: OMIT, additional_properties: nil) ⇒ Vapi::Org
91 92 93 94 95 96 97 98 99 100 101 102 103 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 |
# File 'lib/vapi_server_sdk/types/org.rb', line 91 def initialize(id:, created_at:, updated_at:, hipaa_enabled: 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, billing_limit: OMIT, server_url: OMIT, server_url_secret: OMIT, concurrency_limit: OMIT, additional_properties: nil) @hipaa_enabled = hipaa_enabled if hipaa_enabled != 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 @billing_limit = billing_limit if billing_limit != OMIT @server_url = server_url if server_url != OMIT @server_url_secret = server_url_secret if server_url_secret != OMIT @concurrency_limit = concurrency_limit if concurrency_limit != OMIT @additional_properties = additional_properties @_field_set = { "hipaaEnabled": hipaa_enabled, "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, "billingLimit": billing_limit, "serverUrl": server_url, "serverUrlSecret": server_url_secret, "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.
54 55 56 |
# File 'lib/vapi_server_sdk/types/org.rb', line 54 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].
40 41 42 |
# File 'lib/vapi_server_sdk/types/org.rb', line 40 def billing_limit @billing_limit 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].
52 53 54 |
# File 'lib/vapi_server_sdk/types/org.rb', line 52 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.
21 22 23 |
# File 'lib/vapi_server_sdk/types/org.rb', line 21 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.
17 18 19 |
# File 'lib/vapi_server_sdk/types/org.rb', line 17 def hipaa_enabled @hipaa_enabled end |
#id ⇒ String (readonly)
Returns This is the unique identifier for the org.
19 20 21 |
# File 'lib/vapi_server_sdk/types/org.rb', line 19 def id @id end |
#name ⇒ String (readonly)
Returns This is the name of the org. This is just for your own reference.
37 38 39 |
# File 'lib/vapi_server_sdk/types/org.rb', line 37 def name @name end |
#plan ⇒ Vapi::OrgPlan (readonly)
Returns This is the plan for the org.
35 36 37 |
# File 'lib/vapi_server_sdk/types/org.rb', line 35 def plan @plan end |
#server_url ⇒ String (readonly)
Returns This is the URL Vapi will communicate with via HTTP GET and POST Requests. This is used for retrieving context, function calling, and end-of-call reports. All requests will be sent with the call object among other things relevant to that message. You can find more details in the Server URL documentation.
45 46 47 |
# File 'lib/vapi_server_sdk/types/org.rb', line 45 def server_url @server_url end |
#server_url_secret ⇒ String (readonly)
Returns This is the secret you can set that Vapi will send with every request to your server. Will be sent as a header called x-vapi-secret.
48 49 50 |
# File 'lib/vapi_server_sdk/types/org.rb', line 48 def server_url_secret @server_url_secret end |
#stripe_customer_id ⇒ String (readonly)
Returns This is the Stripe customer for the org.
25 26 27 |
# File 'lib/vapi_server_sdk/types/org.rb', line 25 def stripe_customer_id @stripe_customer_id end |
#stripe_subscription_current_period_start ⇒ DateTime (readonly)
Returns This is the subscription’s current period start.
31 32 33 |
# File 'lib/vapi_server_sdk/types/org.rb', line 31 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.
27 28 29 |
# File 'lib/vapi_server_sdk/types/org.rb', line 27 def stripe_subscription_id @stripe_subscription_id end |
#stripe_subscription_item_id ⇒ String (readonly)
Returns This is the subscription’s subscription item.
29 30 31 |
# File 'lib/vapi_server_sdk/types/org.rb', line 29 def stripe_subscription_item_id @stripe_subscription_item_id end |
#stripe_subscription_status ⇒ String (readonly)
Returns This is the subscription’s status.
33 34 35 |
# File 'lib/vapi_server_sdk/types/org.rb', line 33 def stripe_subscription_status @stripe_subscription_status end |
#updated_at ⇒ DateTime (readonly)
Returns This is the ISO 8601 date-time string of when the org was last updated.
23 24 25 |
# File 'lib/vapi_server_sdk/types/org.rb', line 23 def updated_at @updated_at end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::Org
Deserialize a JSON object to an instance of Org
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 |
# File 'lib/vapi_server_sdk/types/org.rb', line 136 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"] 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"] billing_limit = parsed_json["billingLimit"] server_url = parsed_json["serverUrl"] server_url_secret = parsed_json["serverUrlSecret"] concurrency_limit = parsed_json["concurrencyLimit"] new( hipaa_enabled: hipaa_enabled, 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, billing_limit: billing_limit, server_url: server_url, server_url_secret: server_url_secret, 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.
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 194 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.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.billing_limit&.is_a?(Float) != false || raise("Passed value for field obj.billing_limit is not the expected type, validation failed.") obj.server_url&.is_a?(String) != false || raise("Passed value for field obj.server_url is not the expected type, validation failed.") obj.server_url_secret&.is_a?(String) != false || raise("Passed value for field obj.server_url_secret is not the expected type, validation failed.") 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
184 185 186 |
# File 'lib/vapi_server_sdk/types/org.rb', line 184 def to_json(*_args) @_field_set&.to_json end |