| // DO NOT EDIT. |
| // swift-format-ignore-file |
| // |
| // Generated by the Swift generator plugin for the protocol buffer compiler. |
| // Source: org/apache/beam/model/pipeline/v1/standard_window_fns.proto |
| // |
| // For information on using the generated types, please see the documentation: |
| // https://github.com/apple/swift-protobuf/ |
| |
| // |
| // Licensed to the Apache Software Foundation (ASF) under one |
| // or more contributor license agreements. See the NOTICE file |
| // distributed with this work for additional information |
| // regarding copyright ownership. The ASF licenses this file |
| // to you 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. |
| |
| // |
| // Protocol Buffers describing the Runner API, which is the runner-independent, |
| // SDK-independent definition of the Beam model. |
| |
| import Foundation |
| import SwiftProtobuf |
| |
| // If the compiler emits an error on this type, it is because this file |
| // was generated by a version of the `protoc` Swift plug-in that is |
| // incompatible with the version of SwiftProtobuf to which you are linking. |
| // Please ensure that you are building against the same version of the API |
| // that was used to generate this file. |
| fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { |
| struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} |
| typealias Version = _2 |
| } |
| |
| /// By default, all data in a PCollection is assigned to the single global |
| /// window. See BeamConstants for the time span this window encompasses. |
| /// |
| /// See https://beam.apache.org/documentation/programming-guide/#single-global-window |
| /// for additional details. |
| struct Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload { |
| // SwiftProtobuf.Message conformance is added in an extension below. See the |
| // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| // methods supported on all messages. |
| |
| var unknownFields = SwiftProtobuf.UnknownStorage() |
| |
| enum Enum: SwiftProtobuf.Enum { |
| typealias RawValue = Int |
| case properties // = 0 |
| case UNRECOGNIZED(Int) |
| |
| init() { |
| self = .properties |
| } |
| |
| init?(rawValue: Int) { |
| switch rawValue { |
| case 0: self = .properties |
| default: self = .UNRECOGNIZED(rawValue) |
| } |
| } |
| |
| var rawValue: Int { |
| switch self { |
| case .properties: return 0 |
| case .UNRECOGNIZED(let i): return i |
| } |
| } |
| |
| } |
| |
| init() {} |
| } |
| |
| #if swift(>=4.2) |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload.Enum: CaseIterable { |
| // The compiler won't synthesize support with the UNRECOGNIZED case. |
| static var allCases: [Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload.Enum] = [ |
| .properties, |
| ] |
| } |
| |
| #endif // swift(>=4.2) |
| |
| /// A fixed time window represents a consistent duration size, non overlapping |
| /// time interval in the data stream. |
| /// |
| /// See https://beam.apache.org/documentation/programming-guide/#fixed-time-windows |
| /// for additional details. |
| struct Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload { |
| // SwiftProtobuf.Message conformance is added in an extension below. See the |
| // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| // methods supported on all messages. |
| |
| /// (Required) Represents the size of the window. |
| var size: SwiftProtobuf.Google_Protobuf_Duration { |
| get {return _size ?? SwiftProtobuf.Google_Protobuf_Duration()} |
| set {_size = newValue} |
| } |
| /// Returns true if `size` has been explicitly set. |
| var hasSize: Bool {return self._size != nil} |
| /// Clears the value of `size`. Subsequent reads from it will return its default value. |
| mutating func clearSize() {self._size = nil} |
| |
| /// (Required) Represents the timestamp of when the first window begins. |
| /// Window N will start at offset + N * size. |
| var offset: SwiftProtobuf.Google_Protobuf_Timestamp { |
| get {return _offset ?? SwiftProtobuf.Google_Protobuf_Timestamp()} |
| set {_offset = newValue} |
| } |
| /// Returns true if `offset` has been explicitly set. |
| var hasOffset: Bool {return self._offset != nil} |
| /// Clears the value of `offset`. Subsequent reads from it will return its default value. |
| mutating func clearOffset() {self._offset = nil} |
| |
| var unknownFields = SwiftProtobuf.UnknownStorage() |
| |
| enum Enum: SwiftProtobuf.Enum { |
| typealias RawValue = Int |
| case properties // = 0 |
| case UNRECOGNIZED(Int) |
| |
| init() { |
| self = .properties |
| } |
| |
| init?(rawValue: Int) { |
| switch rawValue { |
| case 0: self = .properties |
| default: self = .UNRECOGNIZED(rawValue) |
| } |
| } |
| |
| var rawValue: Int { |
| switch self { |
| case .properties: return 0 |
| case .UNRECOGNIZED(let i): return i |
| } |
| } |
| |
| } |
| |
| init() {} |
| |
| fileprivate var _size: SwiftProtobuf.Google_Protobuf_Duration? = nil |
| fileprivate var _offset: SwiftProtobuf.Google_Protobuf_Timestamp? = nil |
| } |
| |
| #if swift(>=4.2) |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload.Enum: CaseIterable { |
| // The compiler won't synthesize support with the UNRECOGNIZED case. |
| static var allCases: [Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload.Enum] = [ |
| .properties, |
| ] |
| } |
| |
| #endif // swift(>=4.2) |
| |
| /// A sliding time window represents time intervals in the data stream that can |
| /// overlap. For example, each window might capture 60 seconds worth of data, but |
| /// a new window starts every 30 seconds. The frequency with which sliding |
| /// windows begin is called the period. Therefore, our example would have a |
| /// window size of 60 seconds and a period of 30 seconds. |
| /// |
| /// Because multiple windows overlap, most elements in a data set will belong to |
| /// more than one window. This kind of windowing is useful for taking running |
| /// averages of data; using sliding time windows, you can compute a running |
| /// average of the past 60 seconds’ worth of data, updated every 30 seconds, in |
| /// our example. |
| /// |
| /// See https://beam.apache.org/documentation/programming-guide/#sliding-time-windows |
| /// for additional details. |
| struct Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload { |
| // SwiftProtobuf.Message conformance is added in an extension below. See the |
| // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| // methods supported on all messages. |
| |
| /// (Required) Represents the size of the window. |
| var size: SwiftProtobuf.Google_Protobuf_Duration { |
| get {return _size ?? SwiftProtobuf.Google_Protobuf_Duration()} |
| set {_size = newValue} |
| } |
| /// Returns true if `size` has been explicitly set. |
| var hasSize: Bool {return self._size != nil} |
| /// Clears the value of `size`. Subsequent reads from it will return its default value. |
| mutating func clearSize() {self._size = nil} |
| |
| /// (Required) Represents the timestamp of when the first window begins. |
| /// Window N will start at offset + N * period. |
| var offset: SwiftProtobuf.Google_Protobuf_Timestamp { |
| get {return _offset ?? SwiftProtobuf.Google_Protobuf_Timestamp()} |
| set {_offset = newValue} |
| } |
| /// Returns true if `offset` has been explicitly set. |
| var hasOffset: Bool {return self._offset != nil} |
| /// Clears the value of `offset`. Subsequent reads from it will return its default value. |
| mutating func clearOffset() {self._offset = nil} |
| |
| /// (Required) Represents the amount of time between each start of a window. |
| var period: SwiftProtobuf.Google_Protobuf_Duration { |
| get {return _period ?? SwiftProtobuf.Google_Protobuf_Duration()} |
| set {_period = newValue} |
| } |
| /// Returns true if `period` has been explicitly set. |
| var hasPeriod: Bool {return self._period != nil} |
| /// Clears the value of `period`. Subsequent reads from it will return its default value. |
| mutating func clearPeriod() {self._period = nil} |
| |
| var unknownFields = SwiftProtobuf.UnknownStorage() |
| |
| enum Enum: SwiftProtobuf.Enum { |
| typealias RawValue = Int |
| case properties // = 0 |
| case UNRECOGNIZED(Int) |
| |
| init() { |
| self = .properties |
| } |
| |
| init?(rawValue: Int) { |
| switch rawValue { |
| case 0: self = .properties |
| default: self = .UNRECOGNIZED(rawValue) |
| } |
| } |
| |
| var rawValue: Int { |
| switch self { |
| case .properties: return 0 |
| case .UNRECOGNIZED(let i): return i |
| } |
| } |
| |
| } |
| |
| init() {} |
| |
| fileprivate var _size: SwiftProtobuf.Google_Protobuf_Duration? = nil |
| fileprivate var _offset: SwiftProtobuf.Google_Protobuf_Timestamp? = nil |
| fileprivate var _period: SwiftProtobuf.Google_Protobuf_Duration? = nil |
| } |
| |
| #if swift(>=4.2) |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload.Enum: CaseIterable { |
| // The compiler won't synthesize support with the UNRECOGNIZED case. |
| static var allCases: [Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload.Enum] = [ |
| .properties, |
| ] |
| } |
| |
| #endif // swift(>=4.2) |
| |
| /// A session window function defines windows that contain elements that are |
| /// within a certain gap size of another element. Session windowing applies |
| /// on a per-key basis and is useful for data that is irregularly distributed |
| /// with respect to time. For example, a data stream representing user mouse |
| /// activity may have long periods of idle time interspersed with high |
| /// concentrations of clicks. If data arrives after the minimum specified gap |
| /// size duration, this initiates the start of a new window. |
| /// |
| /// See https://beam.apache.org/documentation/programming-guide/#session-windows |
| /// for additional details. |
| struct Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload { |
| // SwiftProtobuf.Message conformance is added in an extension below. See the |
| // `Message` and `Message+*Additions` files in the SwiftProtobuf library for |
| // methods supported on all messages. |
| |
| /// (Required) Minimum duration of gaps between sessions. |
| var gapSize: SwiftProtobuf.Google_Protobuf_Duration { |
| get {return _gapSize ?? SwiftProtobuf.Google_Protobuf_Duration()} |
| set {_gapSize = newValue} |
| } |
| /// Returns true if `gapSize` has been explicitly set. |
| var hasGapSize: Bool {return self._gapSize != nil} |
| /// Clears the value of `gapSize`. Subsequent reads from it will return its default value. |
| mutating func clearGapSize() {self._gapSize = nil} |
| |
| var unknownFields = SwiftProtobuf.UnknownStorage() |
| |
| enum Enum: SwiftProtobuf.Enum { |
| typealias RawValue = Int |
| case properties // = 0 |
| case UNRECOGNIZED(Int) |
| |
| init() { |
| self = .properties |
| } |
| |
| init?(rawValue: Int) { |
| switch rawValue { |
| case 0: self = .properties |
| default: self = .UNRECOGNIZED(rawValue) |
| } |
| } |
| |
| var rawValue: Int { |
| switch self { |
| case .properties: return 0 |
| case .UNRECOGNIZED(let i): return i |
| } |
| } |
| |
| } |
| |
| init() {} |
| |
| fileprivate var _gapSize: SwiftProtobuf.Google_Protobuf_Duration? = nil |
| } |
| |
| #if swift(>=4.2) |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload.Enum: CaseIterable { |
| // The compiler won't synthesize support with the UNRECOGNIZED case. |
| static var allCases: [Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload.Enum] = [ |
| .properties, |
| ] |
| } |
| |
| #endif // swift(>=4.2) |
| |
| #if swift(>=5.5) && canImport(_Concurrency) |
| extension Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload.Enum: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload.Enum: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload.Enum: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload: @unchecked Sendable {} |
| extension Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload.Enum: @unchecked Sendable {} |
| #endif // swift(>=5.5) && canImport(_Concurrency) |
| |
| // MARK: - Code below here is support for the SwiftProtobuf runtime. |
| |
| fileprivate let _protobuf_package = "org.apache.beam.model.pipeline.v1" |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| static let protoMessageName: String = _protobuf_package + ".GlobalWindowsPayload" |
| static let _protobuf_nameMap = SwiftProtobuf._NameMap() |
| |
| mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| while let _ = try decoder.nextFieldNumber() { |
| } |
| } |
| |
| func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| try unknownFields.traverse(visitor: &visitor) |
| } |
| |
| static func ==(lhs: Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload, rhs: Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload) -> Bool { |
| if lhs.unknownFields != rhs.unknownFields {return false} |
| return true |
| } |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_GlobalWindowsPayload.Enum: SwiftProtobuf._ProtoNameProviding { |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 0: .same(proto: "PROPERTIES"), |
| ] |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| static let protoMessageName: String = _protobuf_package + ".FixedWindowsPayload" |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 1: .same(proto: "size"), |
| 2: .same(proto: "offset"), |
| ] |
| |
| mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| while let fieldNumber = try decoder.nextFieldNumber() { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every case branch when no optimizations are |
| // enabled. https://github.com/apple/swift-protobuf/issues/1034 |
| switch fieldNumber { |
| case 1: try { try decoder.decodeSingularMessageField(value: &self._size) }() |
| case 2: try { try decoder.decodeSingularMessageField(value: &self._offset) }() |
| default: break |
| } |
| } |
| } |
| |
| func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every if/case branch local when no optimizations |
| // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and |
| // https://github.com/apple/swift-protobuf/issues/1182 |
| try { if let v = self._size { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 1) |
| } }() |
| try { if let v = self._offset { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 2) |
| } }() |
| try unknownFields.traverse(visitor: &visitor) |
| } |
| |
| static func ==(lhs: Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload, rhs: Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload) -> Bool { |
| if lhs._size != rhs._size {return false} |
| if lhs._offset != rhs._offset {return false} |
| if lhs.unknownFields != rhs.unknownFields {return false} |
| return true |
| } |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_FixedWindowsPayload.Enum: SwiftProtobuf._ProtoNameProviding { |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 0: .same(proto: "PROPERTIES"), |
| ] |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| static let protoMessageName: String = _protobuf_package + ".SlidingWindowsPayload" |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 1: .same(proto: "size"), |
| 2: .same(proto: "offset"), |
| 3: .same(proto: "period"), |
| ] |
| |
| mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| while let fieldNumber = try decoder.nextFieldNumber() { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every case branch when no optimizations are |
| // enabled. https://github.com/apple/swift-protobuf/issues/1034 |
| switch fieldNumber { |
| case 1: try { try decoder.decodeSingularMessageField(value: &self._size) }() |
| case 2: try { try decoder.decodeSingularMessageField(value: &self._offset) }() |
| case 3: try { try decoder.decodeSingularMessageField(value: &self._period) }() |
| default: break |
| } |
| } |
| } |
| |
| func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every if/case branch local when no optimizations |
| // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and |
| // https://github.com/apple/swift-protobuf/issues/1182 |
| try { if let v = self._size { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 1) |
| } }() |
| try { if let v = self._offset { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 2) |
| } }() |
| try { if let v = self._period { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 3) |
| } }() |
| try unknownFields.traverse(visitor: &visitor) |
| } |
| |
| static func ==(lhs: Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload, rhs: Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload) -> Bool { |
| if lhs._size != rhs._size {return false} |
| if lhs._offset != rhs._offset {return false} |
| if lhs._period != rhs._period {return false} |
| if lhs.unknownFields != rhs.unknownFields {return false} |
| return true |
| } |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SlidingWindowsPayload.Enum: SwiftProtobuf._ProtoNameProviding { |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 0: .same(proto: "PROPERTIES"), |
| ] |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { |
| static let protoMessageName: String = _protobuf_package + ".SessionWindowsPayload" |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 1: .standard(proto: "gap_size"), |
| ] |
| |
| mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws { |
| while let fieldNumber = try decoder.nextFieldNumber() { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every case branch when no optimizations are |
| // enabled. https://github.com/apple/swift-protobuf/issues/1034 |
| switch fieldNumber { |
| case 1: try { try decoder.decodeSingularMessageField(value: &self._gapSize) }() |
| default: break |
| } |
| } |
| } |
| |
| func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws { |
| // The use of inline closures is to circumvent an issue where the compiler |
| // allocates stack space for every if/case branch local when no optimizations |
| // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and |
| // https://github.com/apple/swift-protobuf/issues/1182 |
| try { if let v = self._gapSize { |
| try visitor.visitSingularMessageField(value: v, fieldNumber: 1) |
| } }() |
| try unknownFields.traverse(visitor: &visitor) |
| } |
| |
| static func ==(lhs: Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload, rhs: Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload) -> Bool { |
| if lhs._gapSize != rhs._gapSize {return false} |
| if lhs.unknownFields != rhs.unknownFields {return false} |
| return true |
| } |
| } |
| |
| extension Org_Apache_Beam_Model_Pipeline_V1_SessionWindowsPayload.Enum: SwiftProtobuf._ProtoNameProviding { |
| static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ |
| 0: .same(proto: "PROPERTIES"), |
| ] |
| } |