Skip to content

Commit

Permalink
Refactor K8s meta.v1.Time and meta.v1.MicroTime properties to Date type
Browse files Browse the repository at this point in the history
  • Loading branch information
iabudiab committed Nov 13, 2020
1 parent fecef12 commit aac4c74
Show file tree
Hide file tree
Showing 42 changed files with 168 additions and 168 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apiextensions.v1 {
///
/// lastTransitionTime last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// message is a human-readable message indicating details about last transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apiextensions.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apiextensions.v1.CustomResourceDefinitionCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apiextensions.v1beta1 {
///
/// lastTransitionTime last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// message is a human-readable message indicating details about last transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apiextensions.v1beta1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apiextensions.v1beta1.CustomResourceDefinitionCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apiregistration.v1 {
///
/// Last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// Human-readable message indicating details about last transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apiregistration.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apiregistration.v1.APIServiceCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apiregistration.v1beta1 {
///
/// Last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// Human-readable message indicating details about last transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apiregistration.v1beta1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apiregistration.v1beta1.APIServiceCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Model/apps/v1/DaemonSetCondition+apps.v1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apps.v1 {
///
/// Last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// A human readable message indicating details about the transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apps.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apps.v1.DaemonSetCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
12 changes: 6 additions & 6 deletions Sources/Model/apps/v1/DeploymentCondition+apps.v1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public extension apps.v1 {
///
/// Last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// The last time this condition was updated.
///
public var lastUpdateTime: String?
public var lastUpdateTime: Date?
///
/// A human readable message indicating details about the transition.
///
Expand All @@ -56,8 +56,8 @@ public extension apps.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastUpdateTime: String? = nil,
lastTransitionTime: Date? = nil,
lastUpdateTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -90,8 +90,8 @@ extension apps.v1.DeploymentCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastUpdateTime = try container.decodeIfPresent(String.self, forKey: .lastUpdateTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.lastUpdateTime = try container.decodeIfPresent(Date.self, forKey: .lastUpdateTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Model/apps/v1/ReplicaSetCondition+apps.v1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apps.v1 {
///
/// The last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// A human readable message indicating details about the transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apps.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apps.v1.ReplicaSetCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Model/apps/v1/StatefulSetCondition+apps.v1.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension apps.v1 {
///
/// Last time the condition transitioned from one status to another.
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// A human readable message indicating details about the transition.
///
Expand All @@ -52,7 +52,7 @@ public extension apps.v1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension apps.v1.StatefulSetCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension authentication.v1 {
///
/// ExpirationTimestamp is the time of expiration of the returned token.
///
public var expirationTimestamp: String
public var expirationTimestamp: Date
///
/// Token is the opaque bearer token.
///
Expand All @@ -40,7 +40,7 @@ public extension authentication.v1 {
/// Default memberwise initializer
///
public init(
expirationTimestamp: String,
expirationTimestamp: Date,
token: String
) {
self.expirationTimestamp = expirationTimestamp
Expand All @@ -62,7 +62,7 @@ extension authentication.v1.TokenRequestStatus {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.expirationTimestamp = try container.decode(String.self, forKey: .expirationTimestamp)
self.expirationTimestamp = try container.decode(Date.self, forKey: .expirationTimestamp)
self.token = try container.decode(String.self, forKey: .token)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public extension autoscaling.v1 {
///
/// last time the HorizontalPodAutoscaler scaled the number of pods; used by the autoscaler to control how often the number of pods is changed.
///
public var lastScaleTime: String?
public var lastScaleTime: Date?
///
/// most recent generation observed by this autoscaler.
///
Expand All @@ -55,7 +55,7 @@ public extension autoscaling.v1 {
currentCPUUtilizationPercentage: Int32? = nil,
currentReplicas: Int32,
desiredReplicas: Int32,
lastScaleTime: String? = nil,
lastScaleTime: Date? = nil,
observedGeneration: Int64? = nil
) {
self.currentCPUUtilizationPercentage = currentCPUUtilizationPercentage
Expand Down Expand Up @@ -86,7 +86,7 @@ extension autoscaling.v1.HorizontalPodAutoscalerStatus {
self.currentCPUUtilizationPercentage = try container.decodeIfPresent(Int32.self, forKey: .currentCPUUtilizationPercentage)
self.currentReplicas = try container.decode(Int32.self, forKey: .currentReplicas)
self.desiredReplicas = try container.decode(Int32.self, forKey: .desiredReplicas)
self.lastScaleTime = try container.decodeIfPresent(String.self, forKey: .lastScaleTime)
self.lastScaleTime = try container.decodeIfPresent(Date.self, forKey: .lastScaleTime)
self.observedGeneration = try container.decodeIfPresent(Int64.self, forKey: .observedGeneration)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension autoscaling.v2beta1 {
///
/// lastTransitionTime is the last time the condition transitioned from one status to another
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// message is a human-readable explanation containing details about the transition
///
Expand All @@ -52,7 +52,7 @@ public extension autoscaling.v2beta1 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension autoscaling.v2beta1.HorizontalPodAutoscalerCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public extension autoscaling.v2beta1 {
///
/// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed.
///
public var lastScaleTime: String?
public var lastScaleTime: Date?
///
/// observedGeneration is the most recent generation observed by this autoscaler.
///
Expand All @@ -60,7 +60,7 @@ public extension autoscaling.v2beta1 {
currentMetrics: [autoscaling.v2beta1.MetricStatus]? = nil,
currentReplicas: Int32,
desiredReplicas: Int32,
lastScaleTime: String? = nil,
lastScaleTime: Date? = nil,
observedGeneration: Int64? = nil
) {
self.conditions = conditions
Expand Down Expand Up @@ -94,7 +94,7 @@ extension autoscaling.v2beta1.HorizontalPodAutoscalerStatus {
self.currentMetrics = try container.decodeIfPresent([autoscaling.v2beta1.MetricStatus].self, forKey: .currentMetrics)
self.currentReplicas = try container.decode(Int32.self, forKey: .currentReplicas)
self.desiredReplicas = try container.decode(Int32.self, forKey: .desiredReplicas)
self.lastScaleTime = try container.decodeIfPresent(String.self, forKey: .lastScaleTime)
self.lastScaleTime = try container.decodeIfPresent(Date.self, forKey: .lastScaleTime)
self.observedGeneration = try container.decodeIfPresent(Int64.self, forKey: .observedGeneration)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public extension autoscaling.v2beta2 {
///
/// lastTransitionTime is the last time the condition transitioned from one status to another
///
public var lastTransitionTime: String?
public var lastTransitionTime: Date?
///
/// message is a human-readable explanation containing details about the transition
///
Expand All @@ -52,7 +52,7 @@ public extension autoscaling.v2beta2 {
/// Default memberwise initializer
///
public init(
lastTransitionTime: String? = nil,
lastTransitionTime: Date? = nil,
message: String? = nil,
reason: String? = nil,
status: String,
Expand Down Expand Up @@ -83,7 +83,7 @@ extension autoscaling.v2beta2.HorizontalPodAutoscalerCondition {

public init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
self.lastTransitionTime = try container.decodeIfPresent(String.self, forKey: .lastTransitionTime)
self.lastTransitionTime = try container.decodeIfPresent(Date.self, forKey: .lastTransitionTime)
self.message = try container.decodeIfPresent(String.self, forKey: .message)
self.reason = try container.decodeIfPresent(String.self, forKey: .reason)
self.status = try container.decode(String.self, forKey: .status)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public extension autoscaling.v2beta2 {
///
/// lastScaleTime is the last time the HorizontalPodAutoscaler scaled the number of pods, used by the autoscaler to control how often the number of pods is changed.
///
public var lastScaleTime: String?
public var lastScaleTime: Date?
///
/// observedGeneration is the most recent generation observed by this autoscaler.
///
Expand All @@ -60,7 +60,7 @@ public extension autoscaling.v2beta2 {
currentMetrics: [autoscaling.v2beta2.MetricStatus]? = nil,
currentReplicas: Int32,
desiredReplicas: Int32,
lastScaleTime: String? = nil,
lastScaleTime: Date? = nil,
observedGeneration: Int64? = nil
) {
self.conditions = conditions
Expand Down Expand Up @@ -94,7 +94,7 @@ extension autoscaling.v2beta2.HorizontalPodAutoscalerStatus {
self.currentMetrics = try container.decodeIfPresent([autoscaling.v2beta2.MetricStatus].self, forKey: .currentMetrics)
self.currentReplicas = try container.decode(Int32.self, forKey: .currentReplicas)
self.desiredReplicas = try container.decode(Int32.self, forKey: .desiredReplicas)
self.lastScaleTime = try container.decodeIfPresent(String.self, forKey: .lastScaleTime)
self.lastScaleTime = try container.decodeIfPresent(Date.self, forKey: .lastScaleTime)
self.observedGeneration = try container.decodeIfPresent(Int64.self, forKey: .observedGeneration)
}

Expand Down
Loading

0 comments on commit aac4c74

Please sign in to comment.