Skip to content

Commit 0d686b2

Browse files
committed
Re-generate OFREP types from current main branch
1 parent 5a53ddd commit 0d686b2

File tree

3 files changed

+84
-5
lines changed

3 files changed

+84
-5
lines changed

Sources/OFREP/Generated/Client.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ internal struct Client: APIProtocol {
9393
switch chosenContentType {
9494
case "application/json":
9595
body = try await converter.getResponseBodyAsJSON(
96-
Components.Schemas.EvaluationSuccess.self,
96+
Components.Schemas.ServerEvaluationSuccess.self,
9797
from: responseBody,
9898
transforming: { value in
9999
.json(value)

Sources/OFREP/Generated/Types.swift

+82-3
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,50 @@ internal enum Components {
231231
case context
232232
}
233233
}
234+
/// - Remark: Generated from `#/components/schemas/serverEvaluationSuccess`.
235+
internal struct ServerEvaluationSuccess: Codable, Hashable, Sendable {
236+
/// - Remark: Generated from `#/components/schemas/serverEvaluationSuccess/value1`.
237+
internal var value1: Components.Schemas.EvaluationSuccess
238+
/// - Remark: Generated from `#/components/schemas/serverEvaluationSuccess/value2`.
239+
internal struct Value2Payload: Codable, Hashable, Sendable {
240+
/// Let the provider know that this flag evaluation can be cached
241+
///
242+
/// - Remark: Generated from `#/components/schemas/serverEvaluationSuccess/value2/cacheable`.
243+
internal var cacheable: Swift.Bool?
244+
/// Creates a new `Value2Payload`.
245+
///
246+
/// - Parameters:
247+
/// - cacheable: Let the provider know that this flag evaluation can be cached
248+
internal init(cacheable: Swift.Bool? = nil) {
249+
self.cacheable = cacheable
250+
}
251+
internal enum CodingKeys: String, CodingKey {
252+
case cacheable
253+
}
254+
}
255+
/// - Remark: Generated from `#/components/schemas/serverEvaluationSuccess/value2`.
256+
internal var value2: Components.Schemas.ServerEvaluationSuccess.Value2Payload
257+
/// Creates a new `ServerEvaluationSuccess`.
258+
///
259+
/// - Parameters:
260+
/// - value1:
261+
/// - value2:
262+
internal init(
263+
value1: Components.Schemas.EvaluationSuccess,
264+
value2: Components.Schemas.ServerEvaluationSuccess.Value2Payload
265+
) {
266+
self.value1 = value1
267+
self.value2 = value2
268+
}
269+
internal init(from decoder: any Decoder) throws {
270+
self.value1 = try .init(from: decoder)
271+
self.value2 = try .init(from: decoder)
272+
}
273+
internal func encode(to encoder: any Encoder) throws {
274+
try self.value1.encode(to: encoder)
275+
try self.value2.encode(to: encoder)
276+
}
277+
}
234278
/// Flag evaluation success response.
235279
///
236280
/// - Remark: Generated from `#/components/schemas/evaluationSuccess`.
@@ -688,21 +732,27 @@ internal enum Components {
688732
internal var cacheInvalidation: Components.Schemas.FeatureCacheInvalidation?
689733
/// - Remark: Generated from `#/components/schemas/configurationResponse/capabilities/flagEvaluation`.
690734
internal var flagEvaluation: Components.Schemas.FlagEvaluation?
735+
/// - Remark: Generated from `#/components/schemas/configurationResponse/capabilities/caching`.
736+
internal var caching: Components.Schemas.FeatureCaching?
691737
/// Creates a new `CapabilitiesPayload`.
692738
///
693739
/// - Parameters:
694740
/// - cacheInvalidation:
695741
/// - flagEvaluation:
742+
/// - caching:
696743
internal init(
697744
cacheInvalidation: Components.Schemas.FeatureCacheInvalidation? = nil,
698-
flagEvaluation: Components.Schemas.FlagEvaluation? = nil
745+
flagEvaluation: Components.Schemas.FlagEvaluation? = nil,
746+
caching: Components.Schemas.FeatureCaching? = nil
699747
) {
700748
self.cacheInvalidation = cacheInvalidation
701749
self.flagEvaluation = flagEvaluation
750+
self.caching = caching
702751
}
703752
internal enum CodingKeys: String, CodingKey {
704753
case cacheInvalidation
705754
case flagEvaluation
755+
case caching
706756
}
707757
}
708758
/// Capabilities of the flag management system and how to configure them in the provider.
@@ -809,6 +859,35 @@ internal enum Components {
809859
case minPollingIntervalMs
810860
}
811861
}
862+
/// Configuration of the caching mechanism in the provider (used by server providers)
863+
///
864+
/// - Remark: Generated from `#/components/schemas/featureCaching`.
865+
internal struct FeatureCaching: Codable, Hashable, Sendable {
866+
/// set to true if you want the provider to cache the evaluation results
867+
///
868+
/// - Remark: Generated from `#/components/schemas/featureCaching/enabled`.
869+
internal var enabled: Swift.Bool?
870+
/// number (in millisecond) to wait before invalidating the cache. If we have cacheInvalidation enabled, the cache can also be evicted if a configuration change happen.
871+
///
872+
/// - Remark: Generated from `#/components/schemas/featureCaching/ttl`.
873+
internal var ttl: Swift.Double?
874+
/// Creates a new `FeatureCaching`.
875+
///
876+
/// - Parameters:
877+
/// - enabled: set to true if you want the provider to cache the evaluation results
878+
/// - ttl: number (in millisecond) to wait before invalidating the cache. If we have cacheInvalidation enabled, the cache can also be evicted if a configuration change happen.
879+
internal init(
880+
enabled: Swift.Bool? = nil,
881+
ttl: Swift.Double? = nil
882+
) {
883+
self.enabled = enabled
884+
self.ttl = ttl
885+
}
886+
internal enum CodingKeys: String, CodingKey {
887+
case enabled
888+
case ttl
889+
}
890+
}
812891
}
813892
/// Types generated from the `#/components/parameters` section of the OpenAPI document.
814893
internal enum Parameters {}
@@ -885,12 +964,12 @@ internal enum Operations {
885964
/// - Remark: Generated from `#/paths/ofrep/v1/evaluate/flags/{key}/POST/responses/200/content`.
886965
internal enum Body: Sendable, Hashable {
887966
/// - Remark: Generated from `#/paths/ofrep/v1/evaluate/flags/{key}/POST/responses/200/content/application\/json`.
888-
case json(Components.Schemas.EvaluationSuccess)
967+
case json(Components.Schemas.ServerEvaluationSuccess)
889968
/// The associated value of the enum case if `self` is `.json`.
890969
///
891970
/// - Throws: An error if `self` is not `.json`.
892971
/// - SeeAlso: `.json`.
893-
internal var json: Components.Schemas.EvaluationSuccess {
972+
internal var json: Components.Schemas.ServerEvaluationSuccess {
894973
get throws {
895974
switch self {
896975
case let .json(body):

protocol

0 commit comments

Comments
 (0)