ConnectorConfig.swift 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Copyright 2024 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. import Foundation
  15. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *)
  16. public struct ConnectorConfig: Hashable, Equatable {
  17. public private(set) var serviceId: String
  18. public private(set) var location: String
  19. public private(set) var connector: String
  20. public init(serviceId: String, location: String, connector: String) {
  21. self.serviceId = serviceId
  22. self.location = location
  23. self.connector = connector
  24. }
  25. public func hash(into hasher: inout Hasher) {
  26. hasher.combine(serviceId)
  27. hasher.combine(location)
  28. hasher.combine(connector)
  29. }
  30. public static func == (lhs: Self, rhs: Self) -> Bool {
  31. return lhs.serviceId == rhs.serviceId &&
  32. lhs.location == rhs.location &&
  33. lhs.connector == rhs.connector
  34. }
  35. }