Structures

The following structures are available globally.

  • A type-erased Codable value.

    The AnyCodable type forwards encoding and decoding responsibilities to an underlying value, hiding its specific underlying type.

    You can encode or decode mixed-type values in dictionaries and other collections that require Encodable or Decodable conformance by declaring their contained type to be AnyCodable.

    See also

    AnyEncodable

    See also

    AnyDecodable
    See more

    Declaration

    Swift

    public struct AnyCodable: Codable
  • A type-erased Decodable value.

    The AnyDecodable type forwards decoding responsibilities to an underlying value, hiding its specific underlying type.

    You can decode mixed-type values in dictionaries and other collections that require Decodable conformance by declaring their contained type to be AnyDecodable:

    let json = """
    {
        "boolean": true,
        "integer": 1,
        "double": 3.14159265358979323846,
        "string": "string",
        "array": [1, 2, 3],
        "nested": {
            "a": "alpha",
            "b": "bravo",
            "c": "charlie"
        }
    }
    """.data(using: .utf8)!
    
    let decoder = JSONDecoder()
    let dictionary = try! decoder.decode([String: AnyCodable].self, from: json)
    
    See more

    Declaration

    Swift

    public struct AnyDecodable: Decodable
  • A type-erased Encodable value.

    The AnyEncodable type forwards encoding responsibilities to an underlying value, hiding its specific underlying type.

    You can encode mixed-type values in dictionaries and other collections that require Encodable conformance by declaring their contained type to be AnyEncodable:

    let dictionary: [String: AnyEncodable] = [
        "boolean": true,
        "integer": 1,
        "double": 3.14159265358979323846,
        "string": "string",
        "array": [1, 2, 3],
        "nested": [
            "a": "alpha",
            "b": "bravo",
            "c": "charlie"
        ]
    ]
    
    let encoder = JSONEncoder()
    let json = try! encoder.encode(dictionary)
    
    See more

    Declaration

    Swift

    public struct AnyEncodable: Encodable
  • Representation of a client stored in ThinCloud.

    See more

    Declaration

    Swift

    public struct Client: Codable
  • GeoJSON Point structure.

    See more

    Declaration

    Swift

    public struct Location: Codable
  • Representation of a device creation request to ThinCloud.

    Declaration

    Swift

    public struct DeviceCreateRequest: Codable
  • Representation of a device update request to ThinCloud.

    Declaration

    Swift

    public struct DeviceUpdateRequest: Codable
  • Representation of a device stored in ThinCloud.

    See more

    Declaration

    Swift

    public struct Device: Codable
  • A command dispatched to a device.

    See more

    Declaration

    Swift

    public struct DeviceCommand: Codable
  • Representation of a user update request to ThinCloud.

    Declaration

    Swift

    public struct UserUpdateRequest: Codable
  • Representation of a user stored in ThinCloud.

    See more

    Declaration

    Swift

    public struct User: Codable