Files
divkit/client/ios/DivKit/generated_sources/DivActionSetVariable.swift
T
pkurchatov 149b80a37f Sendable DivData
commit_hash:ae183ed8d06f2c89c8693f59bedba49752638377
2025-01-16 16:25:07 +03:00

48 lines
1.1 KiB
Swift

// Generated code. Do not modify.
import Foundation
import Serialization
import VGSL
public final class DivActionSetVariable: Sendable {
public static let type: String = "set_variable"
public let value: DivTypedValue
public let variableName: Expression<String>
public func resolveVariableName(_ resolver: ExpressionResolver) -> String? {
resolver.resolveString(variableName)
}
init(
value: DivTypedValue,
variableName: Expression<String>
) {
self.value = value
self.variableName = variableName
}
}
#if DEBUG
extension DivActionSetVariable: Equatable {
public static func ==(lhs: DivActionSetVariable, rhs: DivActionSetVariable) -> Bool {
guard
lhs.value == rhs.value,
lhs.variableName == rhs.variableName
else {
return false
}
return true
}
}
#endif
extension DivActionSetVariable: Serializable {
public func toDictionary() -> [String: ValidSerializationValue] {
var result: [String: ValidSerializationValue] = [:]
result["type"] = Self.type
result["value"] = value.toDictionary()
result["variable_name"] = variableName.toValidSerializationValue()
return result
}
}