Class: Vellum::OrganizationRead

Inherits:
Object
  • Object
show all
Defined in:
lib/vellum_ai/types/organization_read.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, name:, created: OMIT, allow_staff_access: OMIT, new_member_join_behavior:, limit_config: OMIT, additional_properties: nil) ⇒ Vellum::OrganizationRead

Parameters:

  • id (String)
  • name (String)
  • created (DateTime) (defaults to: OMIT)
  • allow_staff_access (Boolean) (defaults to: OMIT)
  • new_member_join_behavior (Vellum::NewMemberJoinBehaviorEnum)
  • limit_config (Hash{String => Object}) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/vellum_ai/types/organization_read.rb', line 37

def initialize(id:, name:, created: OMIT, allow_staff_access: OMIT, new_member_join_behavior:, limit_config: OMIT, additional_properties: nil)
  @id = id
  @name = name
  @created = created if created != OMIT
  @allow_staff_access = allow_staff_access if allow_staff_access != OMIT
  @new_member_join_behavior = new_member_join_behavior
  @limit_config = limit_config if limit_config != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "name": name, "created": created, "allow_staff_access": allow_staff_access, "new_member_join_behavior": new_member_join_behavior, "limit_config": limit_config }.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



22
23
24
# File 'lib/vellum_ai/types/organization_read.rb', line 22

def additional_properties
  @additional_properties
end

#allow_staff_accessBoolean (readonly)

Returns:

  • (Boolean)


16
17
18
# File 'lib/vellum_ai/types/organization_read.rb', line 16

def allow_staff_access
  @allow_staff_access
end

#createdDateTime (readonly)

Returns:

  • (DateTime)


14
15
16
# File 'lib/vellum_ai/types/organization_read.rb', line 14

def created
  @created
end

#idString (readonly)

Returns:

  • (String)


10
11
12
# File 'lib/vellum_ai/types/organization_read.rb', line 10

def id
  @id
end

#limit_configHash{String => Object} (readonly)

Returns:

  • (Hash{String => Object})


20
21
22
# File 'lib/vellum_ai/types/organization_read.rb', line 20

def limit_config
  @limit_config
end

#nameString (readonly)

Returns:

  • (String)


12
13
14
# File 'lib/vellum_ai/types/organization_read.rb', line 12

def name
  @name
end

#new_member_join_behaviorVellum::NewMemberJoinBehaviorEnum (readonly)



18
19
20
# File 'lib/vellum_ai/types/organization_read.rb', line 18

def new_member_join_behavior
  @new_member_join_behavior
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::OrganizationRead

Parameters:

  • json_object (String)

Returns:



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

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  name = parsed_json["name"]
  created = unless parsed_json["created"].nil?
  DateTime.parse(parsed_json["created"])
else
  nil
end
  allow_staff_access = parsed_json["allow_staff_access"]
  new_member_join_behavior = parsed_json["new_member_join_behavior"]
  limit_config = parsed_json["limit_config"]
  new(
    id: id,
    name: name,
    created: created,
    allow_staff_access: allow_staff_access,
    new_member_join_behavior: new_member_join_behavior,
    limit_config: limit_config,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


88
89
90
91
92
93
94
95
# File 'lib/vellum_ai/types/organization_read.rb', line 88

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.name.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.")
  obj.created&.is_a?(DateTime) != false || raise("Passed value for field obj.created is not the expected type, validation failed.")
  obj.allow_staff_access&.is_a?(Boolean) != false || raise("Passed value for field obj.allow_staff_access is not the expected type, validation failed.")
  obj.new_member_join_behavior.is_a?(Vellum::NewMemberJoinBehaviorEnum) != false || raise("Passed value for field obj.new_member_join_behavior is not the expected type, validation failed.")
  obj.limit_config&.is_a?(Hash) != false || raise("Passed value for field obj.limit_config is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


79
80
81
# File 'lib/vellum_ai/types/organization_read.rb', line 79

def to_json
  @_field_set&.to_json
end