Class: Dinie::Credential

Inherits:
Internal::Model show all
Defined in:
lib/dinie/generated/types/credential.rb,
sig/dinie/generated/types/credential.rbs

Direct Known Subclasses

CredentialWithSecret

Constant Summary

Constants inherited from Internal::Model

Internal::Model::REDACTED_ATTRIBUTES

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Internal::Model

#==, attribute, attributes, #deconstruct_keys, #hash, inherited, #initialize, #inspect, #to_h

Constructor Details

This class inherits a constructor from Dinie::Internal::Model

Instance Attribute Details

#client_id ⇒ api_client_id (readonly)

Returns the value of attribute client_id.

Returns:

  • (api_client_id)


6
7
8
# File 'sig/dinie/generated/types/credential.rbs', line 6

def client_id
  @client_id
end

#created_at ⇒ Integer (readonly)

Returns the value of attribute created_at.

Returns:

  • (Integer)


7
8
9
# File 'sig/dinie/generated/types/credential.rbs', line 7

def created_at
  @created_at
end

#expires_at ⇒ Integer? (readonly)

Returns the value of attribute expires_at.

Returns:

  • (Integer, nil)


8
9
10
# File 'sig/dinie/generated/types/credential.rbs', line 8

def expires_at
  @expires_at
end

#id ⇒ api_client_id (readonly)

Returns the value of attribute id.

Returns:

  • (api_client_id)


9
10
11
# File 'sig/dinie/generated/types/credential.rbs', line 9

def id
  @id
end

#last_used_at ⇒ Integer? (readonly)

Returns the value of attribute last_used_at.

Returns:

  • (Integer, nil)


10
11
12
# File 'sig/dinie/generated/types/credential.rbs', line 10

def last_used_at
  @last_used_at
end

#name ⇒ String (readonly)

Returns the value of attribute name.

Returns:

  • (String)


11
12
13
# File 'sig/dinie/generated/types/credential.rbs', line 11

def name
  @name
end

#status ⇒ credential_status (readonly)

Returns the value of attribute status.

Returns:

  • (credential_status)


12
13
14
# File 'sig/dinie/generated/types/credential.rbs', line 12

def status
  @status
end

#updated_at ⇒ Integer (readonly)

Returns the value of attribute updated_at.

Returns:

  • (Integer)


13
14
15
# File 'sig/dinie/generated/types/credential.rbs', line 13

def updated_at
  @updated_at
end

Class Method Details

.deserialize(raw) ⇒ Credential

Parameters:

  • raw (Hash[Symbol, untyped])

Returns:



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/dinie/generated/types/credential.rb', line 15

def self.deserialize(raw)
  new(
    client_id: raw[:client_id],
    created_at: raw[:created_at],
    description: raw[:description],
    expires_at: raw[:expires_at],
    id: raw[:id],
    last_used_at: raw[:last_used_at],
    name: raw[:name],
    status: raw[:status],
    updated_at: raw[:updated_at]
  )
end

.serialize_create(name:, expires_at: Internal::OMIT) ⇒ Hash[Symbol, untyped]

Parameters:

  • name: (String)
  • expires_at: (Integer, nil) (defaults to: Internal::OMIT)

Returns:

  • (Hash[Symbol, untyped])


29
30
31
# File 'lib/dinie/generated/types/credential.rb', line 29

def self.serialize_create(name:, expires_at: Internal::OMIT)
  { expires_at:, name: }.reject { |_key, value| Internal.omitted?(value) }
end