Class: Cadenya::Types::AIProviderCredential_Headers

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, headers: nil) ⇒ AIProviderCredential_Headers

Returns a new instance of AIProviderCredential_Headers.



9279
9280
9281
9282
# File 'lib/cadenya/types.rb', line 9279

def initialize(type: nil, headers: nil)
  @type = type
  @headers = headers
end

Instance Attribute Details

#headersObject (readonly)

Returns the value of attribute headers.



9277
9278
9279
# File 'lib/cadenya/types.rb', line 9277

def headers
  @headers
end

#typeObject (readonly)

Returns the value of attribute type.



9277
9278
9279
# File 'lib/cadenya/types.rb', line 9277

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



9284
9285
9286
9287
9288
9289
# File 'lib/cadenya/types.rb', line 9284

def self.from_json(data)
  new(
    type: data["type"],
    headers: data["headers"].nil? ? nil : Types::CredentialHeaders.from_json(data["headers"]),
  )
end

Instance Method Details

#to_hObject



9291
9292
9293
9294
9295
9296
# File 'lib/cadenya/types.rb', line 9291

def to_h
  {
    type: Util.plain(@type),
    headers: Util.plain(@headers),
  }.reject { |_k, v| v.nil? }
end