Class: Vellum::SlimIntegrationAuthConfigRead

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

Overview

A slim representation of an Integration Auth Config.

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, integration:, auth_type: OMIT, integration_credentials: OMIT, system_credential_eligible: OMIT, default_access_type: OMIT, additional_properties: nil) ⇒ Vellum::SlimIntegrationAuthConfigRead

Parameters:

  • default_access_type (Vellum::IntegrationCredentialAccessType) (defaults to: OMIT)
  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 42

def initialize(id:, integration:, auth_type: OMIT, integration_credentials: OMIT, system_credential_eligible: OMIT, default_access_type: OMIT, additional_properties: nil)
  @id = id
  @integration = integration
  @auth_type = auth_type if auth_type != OMIT
  @integration_credentials = integration_credentials if integration_credentials != OMIT
  @system_credential_eligible = system_credential_eligible if system_credential_eligible != OMIT
  @default_access_type = default_access_type if default_access_type != OMIT
  @additional_properties = additional_properties
  @_field_set = { "id": id, "integration": integration, "auth_type": auth_type, "integration_credentials": integration_credentials, "system_credential_eligible": system_credential_eligible, "default_access_type": default_access_type }.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



26
27
28
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 26

def additional_properties
  @additional_properties
end

#auth_typeVellum::AuthTypeEnum (readonly)



17
18
19
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 17

def auth_type
  @auth_type
end

#default_access_typeVellum::IntegrationCredentialAccessType (readonly)



24
25
26
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 24

def default_access_type
  @default_access_type
end

#idString (readonly)

Returns:

  • (String)


13
14
15
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 13

def id
  @id
end

#integrationVellum::IntegrationAuthConfigIntegration (readonly)



15
16
17
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 15

def integration
  @integration
end

#integration_credentialsArray<Vellum::IntegrationAuthConfigIntegrationCredential> (readonly)



19
20
21
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 19

def integration_credentials
  @integration_credentials
end

#system_credential_eligibleObject (readonly)

credentials to authenticate.



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

def system_credential_eligible
  @system_credential_eligible
end

Class Method Details

.from_json(json_object:) ⇒ Vellum::SlimIntegrationAuthConfigRead

Parameters:

  • json_object (String)

Returns:



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 58

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  id = parsed_json["id"]
  unless parsed_json["integration"].nil?
    integration = parsed_json["integration"].to_json
    integration = Vellum::IntegrationAuthConfigIntegration.from_json(json_object: integration)
  else
    integration = nil
  end
  auth_type = parsed_json["auth_type"]
  integration_credentials = parsed_json["integration_credentials"]&.map do | item |
  item = item.to_json
  Vellum::IntegrationAuthConfigIntegrationCredential.from_json(json_object: item)
end
  system_credential_eligible = parsed_json["system_credential_eligible"]
  default_access_type = parsed_json["default_access_type"]
  new(
    id: id,
    integration: integration,
    auth_type: auth_type,
    integration_credentials: integration_credentials,
    system_credential_eligible: system_credential_eligible,
    default_access_type: default_access_type,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


97
98
99
100
101
102
103
104
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 97

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.")
  Vellum::IntegrationAuthConfigIntegration.validate_raw(obj: obj.integration)
  obj.auth_type&.is_a?(Vellum::AuthTypeEnum) != false || raise("Passed value for field obj.auth_type is not the expected type, validation failed.")
  obj.integration_credentials&.is_a?(Array) != false || raise("Passed value for field obj.integration_credentials is not the expected type, validation failed.")
  obj.system_credential_eligible&.is_a?(Boolean) != false || raise("Passed value for field obj.system_credential_eligible is not the expected type, validation failed.")
  obj.default_access_type&.is_a?(Vellum::IntegrationCredentialAccessType) != false || raise("Passed value for field obj.default_access_type is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


88
89
90
# File 'lib/vellum_ai/types/slim_integration_auth_config_read.rb', line 88

def to_json
  @_field_set&.to_json
end