Class: Vapi::ArtifactPlan

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(recording_enabled: OMIT, video_recording_enabled: OMIT, transcript_plan: OMIT, recording_path: OMIT, additional_properties: nil) ⇒ Vapi::ArtifactPlan

Parameters:

  • recording_enabled (Boolean) (defaults to: OMIT)

    This determines whether assistant’s calls are recorded. Defaults to true. Usage:

    • If you don’t want to record the calls, set this to false.

    • If you want to record the calls when ‘assistant.hipaaEnabled`, explicity set

    this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at ‘call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true

  • video_recording_enabled (Boolean) (defaults to: OMIT)

    This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false

  • transcript_plan (Vapi::TranscriptPlan) (defaults to: OMIT)

    This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.

  • recording_path (String) (defaults to: OMIT)

    This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the recording to a specific path, set this to the path.

    Example: ‘/my-assistant-recordings`.

    • If you want to upload the recording to the root of the bucket, set this to

    ‘/`. @default ’/‘

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 77

def initialize(recording_enabled: OMIT, video_recording_enabled: OMIT, transcript_plan: OMIT, recording_path: OMIT,
               additional_properties: nil)
  @recording_enabled = recording_enabled if recording_enabled != OMIT
  @video_recording_enabled = video_recording_enabled if video_recording_enabled != OMIT
  @transcript_plan = transcript_plan if transcript_plan != OMIT
  @recording_path = recording_path if recording_path != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "recordingEnabled": recording_enabled,
    "videoRecordingEnabled": video_recording_enabled,
    "transcriptPlan": transcript_plan,
    "recordingPath": recording_path
  }.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



41
42
43
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 41

def additional_properties
  @additional_properties
end

#recording_enabledBoolean (readonly)

Returns This determines whether assistant’s calls are recorded. Defaults to true. Usage:

  • If you don’t want to record the calls, set this to false.

  • If you want to record the calls when ‘assistant.hipaaEnabled`, explicity set

this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at ‘call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true.

Returns:

  • (Boolean)

    This determines whether assistant’s calls are recorded. Defaults to true. Usage:

    • If you don’t want to record the calls, set this to false.

    • If you want to record the calls when ‘assistant.hipaaEnabled`, explicity set

    this to true and make sure to provide S3 or GCP credentials on the Provider Credentials page in the Dashboard. You can find the recording at ‘call.artifact.recordingUrl` and `call.artifact.stereoRecordingUrl` after the call is ended. @default true



18
19
20
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 18

def recording_enabled
  @recording_enabled
end

#recording_pathString (readonly)

Returns This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

  • If you want to upload the recording to a specific path, set this to the path.

Example: ‘/my-assistant-recordings`.

  • If you want to upload the recording to the root of the bucket, set this to

‘/`. @default ’/‘.

Returns:

  • (String)

    This is the path where the recording will be uploaded. This is only used if you have provided S3 or GCP credentials on the Provider Credentials page in the Dashboard. If credential.s3PathPrefix or credential.bucketPlan.path is set, this will append to it. Usage:

    • If you want to upload the recording to a specific path, set this to the path.

    Example: ‘/my-assistant-recordings`.

    • If you want to upload the recording to the root of the bucket, set this to

    ‘/`. @default ’/‘



39
40
41
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 39

def recording_path
  @recording_path
end

#transcript_planVapi::TranscriptPlan (readonly)

Returns This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.

Returns:

  • (Vapi::TranscriptPlan)

    This is the plan for ‘call.artifact.transcript`. To disable, set `transcriptPlan.enabled` to false.



27
28
29
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 27

def transcript_plan
  @transcript_plan
end

#video_recording_enabledBoolean (readonly)

Returns This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false.

Returns:

  • (Boolean)

    This determines whether the video is recorded during the call. Defaults to false. Only relevant for ‘webCall` type. You can find the video recording at `call.artifact.videoRecordingUrl` after the call is ended. @default false



24
25
26
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 24

def video_recording_enabled
  @video_recording_enabled
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::ArtifactPlan

Deserialize a JSON object to an instance of ArtifactPlan

Parameters:

  • json_object (String)

Returns:



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 98

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  recording_enabled = parsed_json["recordingEnabled"]
  video_recording_enabled = parsed_json["videoRecordingEnabled"]
  if parsed_json["transcriptPlan"].nil?
    transcript_plan = nil
  else
    transcript_plan = parsed_json["transcriptPlan"].to_json
    transcript_plan = Vapi::TranscriptPlan.from_json(json_object: transcript_plan)
  end
  recording_path = parsed_json["recordingPath"]
  new(
    recording_enabled: recording_enabled,
    video_recording_enabled: video_recording_enabled,
    transcript_plan: transcript_plan,
    recording_path: recording_path,
    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)


132
133
134
135
136
137
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 132

def self.validate_raw(obj:)
  obj.recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.recording_enabled is not the expected type, validation failed.")
  obj.video_recording_enabled&.is_a?(Boolean) != false || raise("Passed value for field obj.video_recording_enabled is not the expected type, validation failed.")
  obj.transcript_plan.nil? || Vapi::TranscriptPlan.validate_raw(obj: obj.transcript_plan)
  obj.recording_path&.is_a?(String) != false || raise("Passed value for field obj.recording_path is not the expected type, validation failed.")
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of ArtifactPlan to a JSON object

Returns:

  • (String)


122
123
124
# File 'lib/vapi_server_sdk/types/artifact_plan.rb', line 122

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