//
// Copyright 2020 Swiftkube Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

///
/// Generated by Swiftkube:ModelGen
/// Kubernetes v1.20.9
/// core.v1.PodIP
///

import Foundation

public extension core.v1 {

	///
	/// IP address information for entries in the (plural) PodIPs field. Each entry includes:
	///    IP: An IP address allocated to the pod. Routable at least within the cluster.
	///
	struct PodIP: KubernetesResource {
		///
		/// ip is an IP address (IPv4 or IPv6) assigned to the pod
		///
		public var ip: String?
		///
		/// Default memberwise initializer
		///
		public init(
			ip: String? = nil
		) {
			self.ip = ip
		}
	}
}

///
/// Codable conformance
///
public extension core.v1.PodIP {

	private enum CodingKeys: String, CodingKey {

		case ip = "ip"
	}

	init(from decoder: Decoder) throws {
		let container = try decoder.container(keyedBy: CodingKeys.self)
		self.ip = try container.decodeIfPresent(String.self, forKey: .ip)
	}

	func encode(to encoder: Encoder) throws {
		var encodingContainer = encoder.container(keyedBy: CodingKeys.self)

		try encodingContainer.encode(ip, forKey: .ip)
	}
}
