Skip to content

Commit 0082369

Browse files
algolia-botmillotp
andcommitted
fix(specs): browse response required properties
algolia/api-clients-automation#3348 Co-authored-by: Pierre Millot <[email protected]>
1 parent c666d86 commit 0082369

File tree

7 files changed

+62
-132
lines changed

7 files changed

+62
-132
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on
2+
// https://github.com/algolia/api-clients-automation. DO NOT EDIT.
3+
4+
import Foundation
5+
#if canImport(Core)
6+
import Core
7+
#endif
8+
9+
public struct DockerStreamsInput: Codable, JSONEncodable {
10+
public var streams: AnyCodable
11+
12+
public init(streams: AnyCodable) {
13+
self.streams = streams
14+
}
15+
16+
public enum CodingKeys: String, CodingKey, CaseIterable {
17+
case streams
18+
}
19+
20+
// Encodable protocol methods
21+
22+
public func encode(to encoder: Encoder) throws {
23+
var container = encoder.container(keyedBy: CodingKeys.self)
24+
try container.encode(self.streams, forKey: .streams)
25+
}
26+
}
27+
28+
extension DockerStreamsInput: Equatable {
29+
public static func ==(lhs: DockerStreamsInput, rhs: DockerStreamsInput) -> Bool {
30+
lhs.streams == rhs.streams
31+
}
32+
}
33+
34+
extension DockerStreamsInput: Hashable {
35+
public func hash(into hasher: inout Hasher) {
36+
hasher.combine(self.streams.hashValue)
37+
}
38+
}

Sources/Ingestion/Models/OnDemandDateUtilsInput.swift

Lines changed: 0 additions & 54 deletions
This file was deleted.

Sources/Ingestion/Models/ScheduleDateUtilsInput.swift

Lines changed: 0 additions & 47 deletions
This file was deleted.

Sources/Ingestion/Models/StreamingUtilsInput.swift renamed to Sources/Ingestion/Models/StreamingInput.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88

99
/// Input for a &#x60;streaming&#x60; task whose source is of type &#x60;ga4BigqueryExport&#x60; and for which extracted
1010
/// data is continuously streamed.
11-
public struct StreamingUtilsInput: Codable, JSONEncodable {
11+
public struct StreamingInput: Codable, JSONEncodable {
1212
public var mapping: MappingInput
1313

1414
public init(mapping: MappingInput) {
@@ -27,13 +27,13 @@ public struct StreamingUtilsInput: Codable, JSONEncodable {
2727
}
2828
}
2929

30-
extension StreamingUtilsInput: Equatable {
31-
public static func ==(lhs: StreamingUtilsInput, rhs: StreamingUtilsInput) -> Bool {
30+
extension StreamingInput: Equatable {
31+
public static func ==(lhs: StreamingInput, rhs: StreamingInput) -> Bool {
3232
lhs.mapping == rhs.mapping
3333
}
3434
}
3535

36-
extension StreamingUtilsInput: Hashable {
36+
extension StreamingInput: Hashable {
3737
public func hash(into hasher: inout Hasher) {
3838
hasher.combine(self.mapping.hashValue)
3939
}

Sources/Ingestion/Models/TaskInput.swift

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ import Foundation
88

99
/// Configuration of the task, depending on its type.
1010
public enum TaskInput: Codable, JSONEncodable, AbstractEncodable {
11-
case onDemandDateUtilsInput(OnDemandDateUtilsInput)
12-
case scheduleDateUtilsInput(ScheduleDateUtilsInput)
13-
case streamingUtilsInput(StreamingUtilsInput)
11+
case streamingInput(StreamingInput)
12+
case dockerStreamsInput(DockerStreamsInput)
1413
case shopifyInput(ShopifyInput)
1514

1615
public func encode(to encoder: Encoder) throws {
1716
var container = encoder.singleValueContainer()
1817
switch self {
19-
case let .onDemandDateUtilsInput(value):
18+
case let .streamingInput(value):
2019
try container.encode(value)
21-
case let .scheduleDateUtilsInput(value):
22-
try container.encode(value)
23-
case let .streamingUtilsInput(value):
20+
case let .dockerStreamsInput(value):
2421
try container.encode(value)
2522
case let .shopifyInput(value):
2623
try container.encode(value)
@@ -29,12 +26,10 @@ public enum TaskInput: Codable, JSONEncodable, AbstractEncodable {
2926

3027
public init(from decoder: Decoder) throws {
3128
let container = try decoder.singleValueContainer()
32-
if let value = try? container.decode(OnDemandDateUtilsInput.self) {
33-
self = .onDemandDateUtilsInput(value)
34-
} else if let value = try? container.decode(ScheduleDateUtilsInput.self) {
35-
self = .scheduleDateUtilsInput(value)
36-
} else if let value = try? container.decode(StreamingUtilsInput.self) {
37-
self = .streamingUtilsInput(value)
29+
if let value = try? container.decode(StreamingInput.self) {
30+
self = .streamingInput(value)
31+
} else if let value = try? container.decode(DockerStreamsInput.self) {
32+
self = .dockerStreamsInput(value)
3833
} else if let value = try? container.decode(ShopifyInput.self) {
3934
self = .shopifyInput(value)
4035
} else {
@@ -47,12 +42,10 @@ public enum TaskInput: Codable, JSONEncodable, AbstractEncodable {
4742

4843
public func GetActualInstance() -> Encodable {
4944
switch self {
50-
case let .onDemandDateUtilsInput(value):
51-
value as OnDemandDateUtilsInput
52-
case let .scheduleDateUtilsInput(value):
53-
value as ScheduleDateUtilsInput
54-
case let .streamingUtilsInput(value):
55-
value as StreamingUtilsInput
45+
case let .streamingInput(value):
46+
value as StreamingInput
47+
case let .dockerStreamsInput(value):
48+
value as DockerStreamsInput
5649
case let .shopifyInput(value):
5750
value as ShopifyInput
5851
}

Sources/Ingestion/Models/Transformation.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct Transformation: Codable, JSONEncodable {
1414
/// The uniquely identified name of your transformation.
1515
public var name: String
1616
/// A descriptive name for your transformation of what it does.
17-
public var description: String
17+
public var description: String?
1818
/// Date of creation in RFC 3339 format.
1919
public var createdAt: String
2020
/// Date of last update in RFC 3339 format.
@@ -24,7 +24,7 @@ public struct Transformation: Codable, JSONEncodable {
2424
transformationID: String,
2525
code: String,
2626
name: String,
27-
description: String,
27+
description: String? = nil,
2828
createdAt: String,
2929
updatedAt: String? = nil
3030
) {
@@ -52,7 +52,7 @@ public struct Transformation: Codable, JSONEncodable {
5252
try container.encode(self.transformationID, forKey: .transformationID)
5353
try container.encode(self.code, forKey: .code)
5454
try container.encode(self.name, forKey: .name)
55-
try container.encode(self.description, forKey: .description)
55+
try container.encodeIfPresent(self.description, forKey: .description)
5656
try container.encode(self.createdAt, forKey: .createdAt)
5757
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
5858
}
@@ -74,7 +74,7 @@ extension Transformation: Hashable {
7474
hasher.combine(self.transformationID.hashValue)
7575
hasher.combine(self.code.hashValue)
7676
hasher.combine(self.name.hashValue)
77-
hasher.combine(self.description.hashValue)
77+
hasher.combine(self.description?.hashValue)
7878
hasher.combine(self.createdAt.hashValue)
7979
hasher.combine(self.updatedAt?.hashValue)
8080
}

Sources/Ingestion/Models/TransformationCreate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public struct TransformationCreate: Codable, JSONEncodable {
1313
/// The uniquely identified name of your transformation.
1414
public var name: String
1515
/// A descriptive name for your transformation of what it does.
16-
public var description: String
16+
public var description: String?
1717

18-
public init(code: String, name: String, description: String) {
18+
public init(code: String, name: String, description: String? = nil) {
1919
self.code = code
2020
self.name = name
2121
self.description = description
@@ -33,7 +33,7 @@ public struct TransformationCreate: Codable, JSONEncodable {
3333
var container = encoder.container(keyedBy: CodingKeys.self)
3434
try container.encode(self.code, forKey: .code)
3535
try container.encode(self.name, forKey: .name)
36-
try container.encode(self.description, forKey: .description)
36+
try container.encodeIfPresent(self.description, forKey: .description)
3737
}
3838
}
3939

@@ -49,6 +49,6 @@ extension TransformationCreate: Hashable {
4949
public func hash(into hasher: inout Hasher) {
5050
hasher.combine(self.code.hashValue)
5151
hasher.combine(self.name.hashValue)
52-
hasher.combine(self.description.hashValue)
52+
hasher.combine(self.description?.hashValue)
5353
}
5454
}

0 commit comments

Comments
 (0)