Class: Vapi::CreateByoSipTrunkCredentialDto
- Inherits:
-
Object
- Object
- Vapi::CreateByoSipTrunkCredentialDto
- Defined in:
- lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#gateways ⇒ Array<Vapi::SipTrunkGateway>
readonly
This is the list of SIP trunk’s gateways.
-
#name ⇒ String
readonly
This is the name of the SIP trunk.
-
#outbound_authentication_plan ⇒ Vapi::SipTrunkOutboundAuthenticationPlan
readonly
This can be used to configure the outbound authentication if required by the SIP trunk.
-
#outbound_leading_plus_enabled ⇒ Boolean
readonly
This ensures the outbound origination attempts have a leading plus.
-
#provider ⇒ String
readonly
This can be used to bring your own SIP trunks or to connect to a Carrier.
-
#sbc_configuration ⇒ Vapi::SbcConfiguration
readonly
This is an advanced configuration for enterprise deployments.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Vapi::CreateByoSipTrunkCredentialDto
Deserialize a JSON object to an instance of CreateByoSipTrunkCredentialDto.
-
.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(gateways:, provider: OMIT, name: OMIT, outbound_authentication_plan: OMIT, outbound_leading_plus_enabled: OMIT, sbc_configuration: OMIT, additional_properties: nil) ⇒ Vapi::CreateByoSipTrunkCredentialDto constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CreateByoSipTrunkCredentialDto to a JSON object.
Constructor Details
#initialize(gateways:, provider: OMIT, name: OMIT, outbound_authentication_plan: OMIT, outbound_leading_plus_enabled: OMIT, sbc_configuration: OMIT, additional_properties: nil) ⇒ Vapi::CreateByoSipTrunkCredentialDto
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 53 def initialize(gateways:, provider: OMIT, name: OMIT, outbound_authentication_plan: OMIT, outbound_leading_plus_enabled: OMIT, sbc_configuration: OMIT, additional_properties: nil) @provider = provider if provider != OMIT @gateways = gateways @name = name if name != OMIT @outbound_authentication_plan = outbound_authentication_plan if outbound_authentication_plan != OMIT @outbound_leading_plus_enabled = outbound_leading_plus_enabled if outbound_leading_plus_enabled != OMIT @sbc_configuration = sbc_configuration if sbc_configuration != OMIT @additional_properties = additional_properties @_field_set = { "provider": provider, "gateways": gateways, "name": name, "outboundAuthenticationPlan": outbound_authentication_plan, "outboundLeadingPlusEnabled": outbound_leading_plus_enabled, "sbcConfiguration": sbc_configuration }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
31 32 33 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 31 def additional_properties @additional_properties end |
#gateways ⇒ Array<Vapi::SipTrunkGateway> (readonly)
Returns This is the list of SIP trunk’s gateways.
14 15 16 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 14 def gateways @gateways end |
#name ⇒ String (readonly)
Returns This is the name of the SIP trunk. This is just for your reference.
16 17 18 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 16 def name @name end |
#outbound_authentication_plan ⇒ Vapi::SipTrunkOutboundAuthenticationPlan (readonly)
Returns This can be used to configure the outbound authentication if required by the SIP trunk.
19 20 21 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 19 def outbound_authentication_plan @outbound_authentication_plan end |
#outbound_leading_plus_enabled ⇒ Boolean (readonly)
Returns This ensures the outbound origination attempts have a leading plus. Defaults to false to match conventional telecom behavior. Usage:
-
Vonage/Twilio requires leading plus for all outbound calls. Set this to true.
@default false.
25 26 27 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 25 def outbound_leading_plus_enabled @outbound_leading_plus_enabled end |
#provider ⇒ String (readonly)
Returns This can be used to bring your own SIP trunks or to connect to a Carrier.
12 13 14 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 12 def provider @provider end |
#sbc_configuration ⇒ Vapi::SbcConfiguration (readonly)
Returns This is an advanced configuration for enterprise deployments. This uses the onprem SBC to trunk into the SIP trunk’s ‘gateways`, rather than the managed SBC provided by Vapi.
29 30 31 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 29 def sbc_configuration @sbc_configuration end |
Class Method Details
.from_json(json_object:) ⇒ Vapi::CreateByoSipTrunkCredentialDto
Deserialize a JSON object to an instance of CreateByoSipTrunkCredentialDto
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 78 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) provider = parsed_json["provider"] gateways = parsed_json["gateways"]&.map do |item| item = item.to_json Vapi::SipTrunkGateway.from_json(json_object: item) end name = parsed_json["name"] if parsed_json["outboundAuthenticationPlan"].nil? outbound_authentication_plan = nil else outbound_authentication_plan = parsed_json["outboundAuthenticationPlan"].to_json outbound_authentication_plan = Vapi::SipTrunkOutboundAuthenticationPlan.from_json(json_object: outbound_authentication_plan) end outbound_leading_plus_enabled = parsed_json["outboundLeadingPlusEnabled"] if parsed_json["sbcConfiguration"].nil? sbc_configuration = nil else sbc_configuration = parsed_json["sbcConfiguration"].to_json sbc_configuration = Vapi::SbcConfiguration.from_json(json_object: sbc_configuration) end new( provider: provider, gateways: gateways, name: name, outbound_authentication_plan: outbound_authentication_plan, outbound_leading_plus_enabled: outbound_leading_plus_enabled, sbc_configuration: sbc_configuration, 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.
124 125 126 127 128 129 130 131 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 124 def self.validate_raw(obj:) obj.provider&.is_a?(String) != false || raise("Passed value for field obj.provider is not the expected type, validation failed.") obj.gateways.is_a?(Array) != false || raise("Passed value for field obj.gateways 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.outbound_authentication_plan.nil? || Vapi::SipTrunkOutboundAuthenticationPlan.validate_raw(obj: obj.outbound_authentication_plan) obj.outbound_leading_plus_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.outbound_leading_plus_enabled is not the expected type, validation failed.") obj.sbc_configuration.nil? || Vapi::SbcConfiguration.validate_raw(obj: obj.sbc_configuration) end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CreateByoSipTrunkCredentialDto to a JSON object
114 115 116 |
# File 'lib/vapi_server_sdk/types/create_byo_sip_trunk_credential_dto.rb', line 114 def to_json(*_args) @_field_set&.to_json end |