// --------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for
// license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
// --------------------------------------------------------------------------

import AzureCore
import Foundation
// swiftlint:disable superfluous_disable_command
// swiftlint:disable identifier_name
// swiftlint:disable line_length
// swiftlint:disable cyclomatic_complexity

public struct GeoJsonGeometryCollectionData: Codable {
    // MARK: Properties

    /// Contains a list of valid `GeoJSON` geometry objects. **Note** that coordinates in GeoJSON are in x, y order (longitude, latitude).
    public let geometries: [GeoJsonObject]

    // MARK: Initializers

    /// Initialize a `GeoJsonGeometryCollectionData` structure.
    /// - Parameters:
    ///   - geometries: Contains a list of valid `GeoJSON` geometry objects. **Note** that coordinates in GeoJSON are in x, y order (longitude, latitude).
    public init(
        geometries: [GeoJsonObject]
    ) {
        self.geometries = geometries
    }

    // MARK: Codable

    enum CodingKeys: String, CodingKey {
        case geometries = "geometries"
    }

    /// Initialize a `GeoJsonGeometryCollectionData` structure from decoder
    public init(from decoder: Decoder) throws {
        let container = try decoder.container(keyedBy: CodingKeys.self)
        self.geometries = try container.decode([GeoJsonObject].self, forKey: .geometries)
    }

    /// Encode a `GeoJsonGeometryCollectionData` structure
    public func encode(to encoder: Encoder) throws {
        var container = encoder.container(keyedBy: CodingKeys.self)
        try container.encode(geometries, forKey: .geometries)
    }
}
