Class: Vapi::OrgWithOrgUser

Inherits:
Object
  • Object
show all
Defined in:
lib/vapi_server_sdk/types/org_with_org_user.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, name: OMIT, channel: OMIT, billing_limit: OMIT, server: OMIT, concurrency_limit: OMIT, invited_by_user_id: OMIT, role: OMIT, additional_properties: nil) ⇒ Vapi::OrgWithOrgUser

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.

  • name (String) (defaults to: OMIT)

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

  • channel (Vapi::OrgWithOrgUserChannel) (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].

  • invited_by_user_id (String) (defaults to: OMIT)
  • role (Vapi::OrgWithOrgUserRole) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



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
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 111

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, invited_by_user_id: OMIT, role: 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
  @invited_by_user_id = invited_by_user_id if invited_by_user_id != OMIT
  @role = role if role != 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,
    "invitedByUserId": invited_by_user_id,
    "role": role
  }.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



68
69
70
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 68

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



51
52
53
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 51

def billing_limit
  @billing_limit
end

#channelVapi::OrgWithOrgUserChannel (readonly)

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

Returns:



48
49
50
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 48

def channel
  @channel
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].



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

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_with_org_user.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_with_org_user.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_with_org_user.rb', line 27

def id
  @id
end

#invited_by_user_idString (readonly)

Returns:

  • (String)


64
65
66
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 64

def invited_by_user_id
  @invited_by_user_id
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.



45
46
47
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 45

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_with_org_user.rb', line 43

def plan
  @plan
end

#roleVapi::OrgWithOrgUserRole (readonly)



66
67
68
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 66

def role
  @role
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



58
59
60
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 58

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_with_org_user.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_with_org_user.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_with_org_user.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_with_org_user.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_with_org_user.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_with_org_user.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_with_org_user.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_with_org_user.rb', line 31

def updated_at
  @updated_at
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::OrgWithOrgUser

Deserialize a JSON object to an instance of OrgWithOrgUser

Parameters:

  • json_object (String)

Returns:



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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 164

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"]
  invited_by_user_id = parsed_json["invitedByUserId"]
  role = parsed_json["role"]
  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,
    invited_by_user_id: invited_by_user_id,
    role: role,
    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)


240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 240

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::OrgWithOrgUserChannel) != 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.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.")
  obj.role&.is_a?(Vapi::OrgWithOrgUserRole) != false || raise("Passed value for field obj.role is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of OrgWithOrgUser to a JSON object

Returns:

  • (String)


230
231
232
# File 'lib/vapi_server_sdk/types/org_with_org_user.rb', line 230

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