Class: PutDetectedSecretsSecretIDResponse

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



31893
31894
31895
31896
31897
31898
31899
31900
31901
# File 'lib/schemas.rb', line 31893

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    history:      d["history"]&.map { |x| PutDetectedSecretsSecretIDResponseHistoryItem.from_dynamic!(x) },
    resolution:   d["resolution"],
    secret_hash:  d["secretHash"],
    workspace_id: d["workspaceId"],
  )
end

.from_json!(json) ⇒ Object



31903
31904
31905
# File 'lib/schemas.rb', line 31903

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



31907
31908
31909
31910
31911
31912
31913
31914
# File 'lib/schemas.rb', line 31907

def to_dynamic
  {
    "history"     => history&.map { |x| x.to_dynamic },
    "resolution"  => resolution,
    "secretHash"  => secret_hash,
    "workspaceId" => workspace_id,
  }
end

#to_json(options = nil) ⇒ Object



31916
31917
31918
# File 'lib/schemas.rb', line 31916

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end