Class: Vapi::TestSuite

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

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, org_id:, created_at:, updated_at:, name: OMIT, phone_number_id: OMIT, tester_plan: OMIT, target_plan: OMIT, additional_properties: nil) ⇒ Vapi::TestSuite

Parameters:

  • id (String)

    This is the unique identifier for the test suite.

  • org_id (String)

    This is the unique identifier for the org that this test suite belongs to.

  • created_at (DateTime)

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

  • updated_at (DateTime)

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

  • name (String) (defaults to: OMIT)

    This is the name of the test suite.

  • phone_number_id (String) (defaults to: OMIT)

    This is the phone number ID associated with this test suite.

  • tester_plan (Vapi::TesterPlan) (defaults to: OMIT)

    Override the default tester plan by providing custom assistant configuration for the test agent. We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.

  • target_plan (Vapi::TargetPlan) (defaults to: OMIT)

    These are the configuration for the assistant / phone number that is being tested.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 53

def initialize(id:, org_id:, created_at:, updated_at:, name: OMIT, phone_number_id: OMIT, tester_plan: OMIT,
               target_plan: OMIT, additional_properties: nil)
  @id = id
  @org_id = org_id
  @created_at = created_at
  @updated_at = updated_at
  @name = name if name != OMIT
  @phone_number_id = phone_number_id if phone_number_id != OMIT
  @tester_plan = tester_plan if tester_plan != OMIT
  @target_plan = target_plan if target_plan != OMIT
  @additional_properties = additional_properties
  @_field_set = {
    "id": id,
    "orgId": org_id,
    "createdAt": created_at,
    "updatedAt": updated_at,
    "name": name,
    "phoneNumberId": phone_number_id,
    "testerPlan": tester_plan,
    "targetPlan": target_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



32
33
34
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 32

def additional_properties
  @additional_properties
end

#created_atDateTime (readonly)

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

Returns:

  • (DateTime)

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



16
17
18
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 16

def created_at
  @created_at
end

#idString (readonly)

Returns This is the unique identifier for the test suite.

Returns:

  • (String)

    This is the unique identifier for the test suite.



12
13
14
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 12

def id
  @id
end

#nameString (readonly)

Returns This is the name of the test suite.

Returns:

  • (String)

    This is the name of the test suite.



20
21
22
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 20

def name
  @name
end

#org_idString (readonly)

Returns This is the unique identifier for the org that this test suite belongs to.

Returns:

  • (String)

    This is the unique identifier for the org that this test suite belongs to.



14
15
16
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 14

def org_id
  @org_id
end

#phone_number_idString (readonly)

Returns This is the phone number ID associated with this test suite.

Returns:

  • (String)

    This is the phone number ID associated with this test suite.



22
23
24
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 22

def phone_number_id
  @phone_number_id
end

#target_planVapi::TargetPlan (readonly)

Returns These are the configuration for the assistant / phone number that is being tested.

Returns:

  • (Vapi::TargetPlan)

    These are the configuration for the assistant / phone number that is being tested.



30
31
32
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 30

def target_plan
  @target_plan
end

#tester_planVapi::TesterPlan (readonly)

Returns Override the default tester plan by providing custom assistant configuration for the test agent. We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.

Returns:

  • (Vapi::TesterPlan)

    Override the default tester plan by providing custom assistant configuration for the test agent. We recommend only using this if you are confident, as we have already set sensible defaults on the tester plan.



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

def tester_plan
  @tester_plan
end

#updated_atDateTime (readonly)

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

Returns:

  • (DateTime)

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



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

def updated_at
  @updated_at
end

Class Method Details

.from_json(json_object:) ⇒ Vapi::TestSuite

Deserialize a JSON object to an instance of TestSuite

Parameters:

  • json_object (String)

Returns:



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
110
111
112
113
114
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 82

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  org_id = parsed_json["orgId"]
  created_at = (DateTime.parse(parsed_json["createdAt"]) unless parsed_json["createdAt"].nil?)
  updated_at = (DateTime.parse(parsed_json["updatedAt"]) unless parsed_json["updatedAt"].nil?)
  name = parsed_json["name"]
  phone_number_id = parsed_json["phoneNumberId"]
  if parsed_json["testerPlan"].nil?
    tester_plan = nil
  else
    tester_plan = parsed_json["testerPlan"].to_json
    tester_plan = Vapi::TesterPlan.from_json(json_object: tester_plan)
  end
  if parsed_json["targetPlan"].nil?
    target_plan = nil
  else
    target_plan = parsed_json["targetPlan"].to_json
    target_plan = Vapi::TargetPlan.from_json(json_object: target_plan)
  end
  new(
    id: id,
    org_id: org_id,
    created_at: created_at,
    updated_at: updated_at,
    name: name,
    phone_number_id: phone_number_id,
    tester_plan: tester_plan,
    target_plan: target_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)


129
130
131
132
133
134
135
136
137
138
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 129

def self.validate_raw(obj:)
  obj.id.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.")
  obj.org_id.is_a?(String) != false || raise("Passed value for field obj.org_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.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.phone_number_id&.is_a?(String) != false || raise("Passed value for field obj.phone_number_id is not the expected type, validation failed.")
  obj.tester_plan.nil? || Vapi::TesterPlan.validate_raw(obj: obj.tester_plan)
  obj.target_plan.nil? || Vapi::TargetPlan.validate_raw(obj: obj.target_plan)
end

Instance Method Details

#to_json(*_args) ⇒ String

Serialize an instance of TestSuite to a JSON object

Returns:

  • (String)


119
120
121
# File 'lib/vapi_server_sdk/types/test_suite.rb', line 119

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