Class: Vapi::Org

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/org.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

Parameters:

  • hipaa_enabled (Boolean) (defaults to: OMIT)

    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.

  • subscription (Vapi::Subscription) (defaults to: OMIT)
  • subscription_id (String) (defaults to: OMIT)

    This is the ID of the subscription the org belongs to.

  • id (String)

    This is the unique identifier for the org.

  • created_at (DateTime)

    This is the ISO 8601 date-time string of when the org was created.

  • updated_at (DateTime)

    This is the ISO 8601 date-time string of when the org was last updated.

  • stripe_customer_id (String) (defaults to: OMIT)

    This is the Stripe customer for the org.

  • stripe_subscription_id (String) (defaults to: OMIT)

    This is the subscription for the org.

  • stripe_subscription_item_id (String) (defaults to: OMIT)

    This is the subscription’s subscription item.

  • stripe_subscription_current_period_start (DateTime) (defaults to: OMIT)

    This is the subscription’s current period start.

  • stripe_subscription_status (String) (defaults to: OMIT)

    This is the subscription’s status.

  • plan (Vapi::OrgPlan) (defaults to: OMIT)

    This is the plan for the org.

  • jwt_secret (String) (defaults to: OMIT)

    This is the secret key used for signing JWT tokens for the org.

  • minutes_used (Float) (defaults to: OMIT)

    This is the total number of call minutes used by this org across all time.

  • name (String) (defaults to: OMIT)

    This is the name of the org. This is just for your own reference.

  • channel (Vapi::OrgChannel) (defaults to: OMIT)

    This is the channel of the org. There is the cluster the API traffic for the org will be directed.

  • billing_limit (Float) (defaults to: OMIT)

    This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at [email protected].

  • server (Vapi::Server) (defaults to: OMIT)

    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:

    1. assistant.server

    2. phoneNumber.server

    3. org.server

  • concurrency_limit (Float) (defaults to: OMIT)

    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].

  • compliance_plan (Vapi::CompliancePlan) (defaults to: OMIT)

    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.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    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_limitFloat (readonly)

Returns This is the monthly billing limit for the org. To go beyond $1000/mo, please contact us at [email protected].

Returns:

  • (Float)

    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

#channelVapi::OrgChannel (readonly)

Returns This is the channel of the org. There is the cluster the API traffic for the org will be directed.

Returns:

  • (Vapi::OrgChannel)

    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_planVapi::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.

Returns:

  • (Vapi::CompliancePlan)

    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_limitFloat (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].

Returns:

  • (Float)

    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_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the org was created.

Returns:

  • (DateTime)

    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_enabledBoolean (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.

Returns:

  • (Boolean)

    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

#idString (readonly)

Returns This is the unique identifier for the org.

Returns:

  • (String)

    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_secretString (readonly)

Returns This is the secret key used for signing JWT tokens for the org.

Returns:

  • (String)

    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_usedFloat (readonly)

Returns This is the total number of call minutes used by this org across all time.

Returns:

  • (Float)

    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

#nameString (readonly)

Returns This is the name of the org. This is just for your own reference.

Returns:

  • (String)

    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

#planVapi::OrgPlan (readonly)

Returns This is the plan for the org.

Returns:



43
44
45
# File 'lib/vapi_server_sdk/types/org.rb', line 43

def plan
  @plan
end

#serverVapi::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:

  1. assistant.server

  2. phoneNumber.server

  3. org.server.

Returns:

  • (Vapi::Server)

    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:

    1. assistant.server

    2. phoneNumber.server

    3. org.server



62
63
64
# File 'lib/vapi_server_sdk/types/org.rb', line 62

def server
  @server
end

#stripe_customer_idString (readonly)

Returns This is the Stripe customer for the org.

Returns:

  • (String)

    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_startDateTime (readonly)

Returns This is the subscription’s current period start.

Returns:

  • (DateTime)

    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_idString (readonly)

Returns This is the subscription for the org.

Returns:

  • (String)

    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_idString (readonly)

Returns This is the subscription’s subscription item.

Returns:

  • (String)

    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_statusString (readonly)

Returns This is the subscription’s status.

Returns:

  • (String)

    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

#subscriptionVapi::Subscription (readonly)

Returns:



23
24
25
# File 'lib/vapi_server_sdk/types/org.rb', line 23

def subscription
  @subscription
end

#subscription_idString (readonly)

Returns This is the ID of the subscription the org belongs to.

Returns:

  • (String)

    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_atDateTime (readonly)

Returns This is the ISO 8601 date-time string of when the org was last updated.

Returns:

  • (DateTime)

    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

Parameters:

  • json_object (String)

Returns:



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.

Parameters:

  • obj (Object)

Returns:

  • (Void)


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

Returns:

  • (String)


262
263
264
# File 'lib/vapi_server_sdk/types/org.rb', line 262

def to_json(*_args)
  @_field_set&.to_json
end